Linux 3.12.39
[linux/fpc-iii.git] / include / trace / events / compaction.h
blobc6814b917bdfb17bfaf6a8f096787b49913343a2
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM compaction
4 #if !defined(_TRACE_COMPACTION_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_COMPACTION_H
7 #include <linux/types.h>
8 #include <linux/list.h>
9 #include <linux/tracepoint.h>
10 #include <trace/events/gfpflags.h>
12 DECLARE_EVENT_CLASS(mm_compaction_isolate_template,
14 TP_PROTO(unsigned long nr_scanned,
15 unsigned long nr_taken),
17 TP_ARGS(nr_scanned, nr_taken),
19 TP_STRUCT__entry(
20 __field(unsigned long, nr_scanned)
21 __field(unsigned long, nr_taken)
24 TP_fast_assign(
25 __entry->nr_scanned = nr_scanned;
26 __entry->nr_taken = nr_taken;
29 TP_printk("nr_scanned=%lu nr_taken=%lu",
30 __entry->nr_scanned,
31 __entry->nr_taken)
34 DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_migratepages,
36 TP_PROTO(unsigned long nr_scanned,
37 unsigned long nr_taken),
39 TP_ARGS(nr_scanned, nr_taken)
42 DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_freepages,
43 TP_PROTO(unsigned long nr_scanned,
44 unsigned long nr_taken),
46 TP_ARGS(nr_scanned, nr_taken)
49 TRACE_EVENT(mm_compaction_migratepages,
51 TP_PROTO(unsigned long nr_all,
52 int migrate_rc,
53 struct list_head *migratepages),
55 TP_ARGS(nr_all, migrate_rc, migratepages),
57 TP_STRUCT__entry(
58 __field(unsigned long, nr_migrated)
59 __field(unsigned long, nr_failed)
62 TP_fast_assign(
63 unsigned long nr_failed = 0;
64 struct list_head *page_lru;
67 * migrate_pages() returns either a non-negative number
68 * with the number of pages that failed migration, or an
69 * error code, in which case we need to count the remaining
70 * pages manually
72 if (migrate_rc >= 0)
73 nr_failed = migrate_rc;
74 else
75 list_for_each(page_lru, migratepages)
76 nr_failed++;
78 __entry->nr_migrated = nr_all - nr_failed;
79 __entry->nr_failed = nr_failed;
82 TP_printk("nr_migrated=%lu nr_failed=%lu",
83 __entry->nr_migrated,
84 __entry->nr_failed)
87 TRACE_EVENT(mm_compaction_begin,
88 TP_PROTO(unsigned long zone_start, unsigned long migrate_start,
89 unsigned long free_start, unsigned long zone_end),
91 TP_ARGS(zone_start, migrate_start, free_start, zone_end),
93 TP_STRUCT__entry(
94 __field(unsigned long, zone_start)
95 __field(unsigned long, migrate_start)
96 __field(unsigned long, free_start)
97 __field(unsigned long, zone_end)
100 TP_fast_assign(
101 __entry->zone_start = zone_start;
102 __entry->migrate_start = migrate_start;
103 __entry->free_start = free_start;
104 __entry->zone_end = zone_end;
107 TP_printk("zone_start=%lu migrate_start=%lu free_start=%lu zone_end=%lu",
108 __entry->zone_start,
109 __entry->migrate_start,
110 __entry->free_start,
111 __entry->zone_end)
114 TRACE_EVENT(mm_compaction_end,
115 TP_PROTO(int status),
117 TP_ARGS(status),
119 TP_STRUCT__entry(
120 __field(int, status)
123 TP_fast_assign(
124 __entry->status = status;
127 TP_printk("status=%d", __entry->status)
130 #endif /* _TRACE_COMPACTION_H */
132 /* This part must be outside protection */
133 #include <trace/define_trace.h>