blob: fde1b3e94c7d971c571ca77ef3fdf7cee5f71744 [file] [log] [blame]
Mel Gormanb7aba692011-01-13 15:45:54 -08001#undef TRACE_SYSTEM
2#define TRACE_SYSTEM compaction
3
4#if !defined(_TRACE_COMPACTION_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_COMPACTION_H
6
7#include <linux/types.h>
8#include <linux/tracepoint.h>
David Howellsa1ce3922012-10-02 18:01:25 +01009#include <trace/events/gfpflags.h>
Mel Gormanb7aba692011-01-13 15:45:54 -080010
11DECLARE_EVENT_CLASS(mm_compaction_isolate_template,
12
13 TP_PROTO(unsigned long nr_scanned,
14 unsigned long nr_taken),
15
16 TP_ARGS(nr_scanned, nr_taken),
17
18 TP_STRUCT__entry(
19 __field(unsigned long, nr_scanned)
20 __field(unsigned long, nr_taken)
21 ),
22
23 TP_fast_assign(
24 __entry->nr_scanned = nr_scanned;
25 __entry->nr_taken = nr_taken;
26 ),
27
28 TP_printk("nr_scanned=%lu nr_taken=%lu",
29 __entry->nr_scanned,
30 __entry->nr_taken)
31);
32
33DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_migratepages,
34
35 TP_PROTO(unsigned long nr_scanned,
36 unsigned long nr_taken),
37
38 TP_ARGS(nr_scanned, nr_taken)
39);
40
41DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_freepages,
42 TP_PROTO(unsigned long nr_scanned,
43 unsigned long nr_taken),
44
45 TP_ARGS(nr_scanned, nr_taken)
46);
47
48TRACE_EVENT(mm_compaction_migratepages,
49
50 TP_PROTO(unsigned long nr_migrated,
51 unsigned long nr_failed),
52
53 TP_ARGS(nr_migrated, nr_failed),
54
55 TP_STRUCT__entry(
56 __field(unsigned long, nr_migrated)
57 __field(unsigned long, nr_failed)
58 ),
59
60 TP_fast_assign(
61 __entry->nr_migrated = nr_migrated;
62 __entry->nr_failed = nr_failed;
63 ),
64
65 TP_printk("nr_migrated=%lu nr_failed=%lu",
66 __entry->nr_migrated,
67 __entry->nr_failed)
68);
69
70
71#endif /* _TRACE_COMPACTION_H */
72
73/* This part must be outside protection */
74#include <trace/define_trace.h>