Fix: update sched instrumentation for kernel 4.12
[lttng-modules.git] / instrumentation / events / lttng-module / compaction.h
CommitLineData
b87700e3
AG
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM compaction
3
3bc29f0a
MD
4#if !defined(LTTNG_TRACE_COMPACTION_H) || defined(TRACE_HEADER_MULTI_READ)
5#define LTTNG_TRACE_COMPACTION_H
b87700e3 6
6ec43db8 7#include <probes/lttng-tracepoint-event.h>
b87700e3 8#include <linux/types.h>
00073447 9#include <linux/version.h>
b87700e3 10
a57f014e
MD
11#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
12
9bbf98da 13LTTNG_TRACEPOINT_EVENT_CLASS(compaction_isolate_template,
a57f014e
MD
14
15 TP_PROTO(unsigned long start_pfn,
16 unsigned long end_pfn,
17 unsigned long nr_scanned,
18 unsigned long nr_taken),
19
20 TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken),
21
f127e61e
MD
22 TP_FIELDS(
23 ctf_integer(unsigned long, start_pfn, start_pfn)
24 ctf_integer(unsigned long, end_pfn, end_pfn)
25 ctf_integer(unsigned long, nr_scanned, nr_scanned)
26 ctf_integer(unsigned long, nr_taken, nr_taken)
27 )
a57f014e
MD
28)
29
c3857419
MD
30LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template,
31
32 mm_compaction_isolate_migratepages,
33
34 compaction_isolate_migratepages,
a57f014e
MD
35
36 TP_PROTO(unsigned long start_pfn,
37 unsigned long end_pfn,
38 unsigned long nr_scanned,
39 unsigned long nr_taken),
40
41 TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken)
42)
43
c3857419
MD
44LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template,
45
46 mm_compaction_isolate_freepages,
47
48 compaction_isolate_freepages,
a57f014e
MD
49
50 TP_PROTO(unsigned long start_pfn,
51 unsigned long end_pfn,
52 unsigned long nr_scanned,
53 unsigned long nr_taken),
54
55 TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken)
56)
57
58#else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) */
59
9bbf98da 60LTTNG_TRACEPOINT_EVENT_CLASS(compaction_isolate_template,
b87700e3
AG
61
62 TP_PROTO(unsigned long nr_scanned,
63 unsigned long nr_taken),
64
65 TP_ARGS(nr_scanned, nr_taken),
66
f127e61e
MD
67 TP_FIELDS(
68 ctf_integer(unsigned long, nr_scanned, nr_scanned)
69 ctf_integer(unsigned long, nr_taken, nr_taken)
70 )
b87700e3
AG
71)
72
9bbf98da
MD
73LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template,
74
75 mm_compaction_isolate_migratepages,
76
77 compaction_isolate_migratepages,
b87700e3
AG
78
79 TP_PROTO(unsigned long nr_scanned,
80 unsigned long nr_taken),
81
82 TP_ARGS(nr_scanned, nr_taken)
83)
84
9bbf98da
MD
85LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template,
86
87 mm_compaction_isolate_freepages,
88
89 compaction_isolate_freepages,
90
b87700e3
AG
91 TP_PROTO(unsigned long nr_scanned,
92 unsigned long nr_taken),
93
94 TP_ARGS(nr_scanned, nr_taken)
95)
96
a57f014e
MD
97#endif /* #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) */
98
24ce932c
DE
99#if LTTNG_KERNEL_RANGE(3,12,30, 3,13,0) || \
100 LTTNG_KERNEL_RANGE(3,14,25, 3,15,0) || \
290d1667 101 (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
f127e61e 102LTTNG_TRACEPOINT_EVENT_CODE_MAP(mm_compaction_migratepages,
9bbf98da
MD
103
104 compaction_migratepages,
00073447
MD
105
106 TP_PROTO(unsigned long nr_all,
107 int migrate_rc,
108 struct list_head *migratepages),
109
110 TP_ARGS(nr_all, migrate_rc, migratepages),
111
f127e61e
MD
112 TP_locvar(
113 unsigned long nr_failed;
00073447
MD
114 ),
115
265822ae 116 TP_code_pre(
f127e61e
MD
117 tp_locvar->nr_failed = 0;
118
119 {
120 struct list_head *page_lru;
121
122 if (migrate_rc >= 0)
123 tp_locvar->nr_failed = migrate_rc;
124 else
125 list_for_each(page_lru, migratepages)
126 tp_locvar->nr_failed++;
127 }
00073447
MD
128 ),
129
f127e61e
MD
130 TP_FIELDS(
131 ctf_integer(unsigned long, nr_migrated, nr_all - tp_locvar->nr_failed)
132 ctf_integer(unsigned long, nr_failed, tp_locvar->nr_failed)
265822ae
MD
133 ),
134
135 TP_code_post()
00073447
MD
136)
137#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
9bbf98da
MD
138LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages,
139
140 compaction_migratepages,
b87700e3
AG
141
142 TP_PROTO(unsigned long nr_migrated,
143 unsigned long nr_failed),
144
145 TP_ARGS(nr_migrated, nr_failed),
146
f127e61e
MD
147 TP_FIELDS(
148 ctf_integer(unsigned long, nr_migrated, nr_migrated)
149 ctf_integer(unsigned long, nr_failed, nr_failed)
150 )
b87700e3 151)
00073447 152#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
b87700e3 153
3bc29f0a 154#endif /* LTTNG_TRACE_COMPACTION_H */
b87700e3
AG
155
156/* This part must be outside protection */
6ec43db8 157#include <probes/define_trace.h>
This page took 0.039743 seconds and 4 git commands to generate.