Fix: scsi: sd: Atomic write support added in 6.11-rc1
[lttng-modules.git] / include / instrumentation / events / compaction.h
1 // SPDX-FileCopyrightText: 2012 Andrew Gabbasov <andrew_gabbasov@mentor.com>
2 //
3 // SPDX-License-Identifier: GPL-2.0-only
4
5 #undef TRACE_SYSTEM
6 #define TRACE_SYSTEM compaction
7
8 #if !defined(LTTNG_TRACE_COMPACTION_H) || defined(TRACE_HEADER_MULTI_READ)
9 #define LTTNG_TRACE_COMPACTION_H
10
11 #include <lttng/tracepoint-event.h>
12 #include <linux/types.h>
13 #include <lttng/kernel-version.h>
14
15 LTTNG_TRACEPOINT_EVENT_CLASS(compaction_isolate_template,
16
17 TP_PROTO(unsigned long start_pfn,
18 unsigned long end_pfn,
19 unsigned long nr_scanned,
20 unsigned long nr_taken),
21
22 TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken),
23
24 TP_FIELDS(
25 ctf_integer(unsigned long, start_pfn, start_pfn)
26 ctf_integer(unsigned long, end_pfn, end_pfn)
27 ctf_integer(unsigned long, nr_scanned, nr_scanned)
28 ctf_integer(unsigned long, nr_taken, nr_taken)
29 )
30 )
31
32 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template,
33
34 mm_compaction_isolate_migratepages,
35
36 compaction_isolate_migratepages,
37
38 TP_PROTO(unsigned long start_pfn,
39 unsigned long end_pfn,
40 unsigned long nr_scanned,
41 unsigned long nr_taken),
42
43 TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken)
44 )
45
46 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template,
47
48 mm_compaction_isolate_freepages,
49
50 compaction_isolate_freepages,
51
52 TP_PROTO(unsigned long start_pfn,
53 unsigned long end_pfn,
54 unsigned long nr_scanned,
55 unsigned long nr_taken),
56
57 TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken)
58 )
59
60 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0))
61 LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages,
62
63 compaction_migratepages,
64
65 TP_PROTO(unsigned int nr_migratepages,
66 unsigned int nr_succeeded),
67
68 TP_ARGS(nr_migratepages, nr_succeeded),
69
70 TP_FIELDS(
71 ctf_integer(unsigned long, nr_migrated, nr_succeeded)
72 ctf_integer(unsigned long, nr_failed, nr_migratepages - nr_succeeded)
73 )
74 )
75 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0) || \
76 LTTNG_RHEL_KERNEL_RANGE(5,14,0,163,0,0, 5,15,0,0,0,0))
77 LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages,
78
79 compaction_migratepages,
80
81 TP_PROTO(struct compact_control *cc,
82 unsigned int nr_succeeded),
83
84 TP_ARGS(cc, nr_succeeded),
85
86 TP_FIELDS(
87 ctf_integer(unsigned long, nr_migrated, nr_succeeded)
88 ctf_integer(unsigned long, nr_failed, cc->nr_migratepages - nr_succeeded)
89 )
90 )
91 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0))
92 LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages,
93
94 compaction_migratepages,
95
96 TP_PROTO(unsigned long nr_all,
97 unsigned int nr_succeeded),
98
99 TP_ARGS(nr_all, nr_succeeded),
100
101 TP_FIELDS(
102 ctf_integer(unsigned long, nr_migrated, nr_succeeded)
103 ctf_integer(unsigned long, nr_failed, nr_all - nr_succeeded)
104 )
105 )
106 #else
107 LTTNG_TRACEPOINT_EVENT_CODE_MAP(mm_compaction_migratepages,
108
109 compaction_migratepages,
110
111 TP_PROTO(unsigned long nr_all,
112 int migrate_rc,
113 struct list_head *migratepages),
114
115 TP_ARGS(nr_all, migrate_rc, migratepages),
116
117 TP_locvar(
118 unsigned long nr_failed;
119 ),
120
121 TP_code_pre(
122 tp_locvar->nr_failed = 0;
123
124 {
125 struct list_head *page_lru;
126
127 if (migrate_rc >= 0)
128 tp_locvar->nr_failed = migrate_rc;
129 else
130 list_for_each(page_lru, migratepages)
131 tp_locvar->nr_failed++;
132 }
133 ),
134
135 TP_FIELDS(
136 ctf_integer(unsigned long, nr_migrated, nr_all - tp_locvar->nr_failed)
137 ctf_integer(unsigned long, nr_failed, tp_locvar->nr_failed)
138 ),
139
140 TP_code_post()
141 )
142 #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0)) */
143
144 #endif /* LTTNG_TRACE_COMPACTION_H */
145
146 /* This part must be outside protection */
147 #include <lttng/define_trace.h>
This page took 0.041856 seconds and 5 git commands to generate.