1 From 0007344741ef65259bc52dea72259173dfbf96c0 Mon Sep 17 00:00:00 2001
2 From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
3 Date: Sun, 13 Jul 2014 13:33:21 -0400
4 Subject: [PATCH 2/2] Update compaction instrumentation to 3.16 kernel
6 Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 instrumentation/events/lttng-module/compaction.h | 45 +++++++++++++++++++++++-
9 1 file changed, 44 insertions(+), 1 deletion(-)
11 diff --git a/instrumentation/events/lttng-module/compaction.h b/instrumentation/events/lttng-module/compaction.h
12 index 1b237fa45ab0..22024e9ee582 100644
13 --- a/instrumentation/events/lttng-module/compaction.h
14 +++ b/instrumentation/events/lttng-module/compaction.h
17 #include <linux/types.h>
18 #include <linux/tracepoint.h>
19 +#include <linux/version.h>
20 #include <trace/events/gfpflags.h>
22 DECLARE_EVENT_CLASS(mm_compaction_isolate_template,
23 @@ -45,6 +46,48 @@ DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_freepages,
24 TP_ARGS(nr_scanned, nr_taken)
27 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
28 +TRACE_EVENT(mm_compaction_migratepages,
30 + TP_PROTO(unsigned long nr_all,
32 + struct list_head *migratepages),
34 + TP_ARGS(nr_all, migrate_rc, migratepages),
37 + __field(unsigned long, nr_migrated)
38 + __field(unsigned long, nr_failed)
42 + tp_assign(nr_migrated,
44 + (migrate_rc >= 0 ? migrate_rc :
46 + unsigned long nr_failed = 0;
47 + struct list_head *page_lru;
49 + list_for_each(page_lru, migratepages)
53 + tp_assign(nr_failed,
55 + unsigned long nr_failed = 0;
56 + struct list_head *page_lru;
58 + list_for_each(page_lru, migratepages)
64 + TP_printk("nr_migrated=%lu nr_failed=%lu",
65 + __entry->nr_migrated,
68 +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
69 TRACE_EVENT(mm_compaction_migratepages,
71 TP_PROTO(unsigned long nr_migrated,
72 @@ -66,7 +109,7 @@ TRACE_EVENT(mm_compaction_migratepages,
77 +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
79 #endif /* _TRACE_COMPACTION_H */