summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/lttng/lttng-modules/Update-compaction-instrumentation-to-3.16-kernel.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/lttng/lttng-modules/Update-compaction-instrumentation-to-3.16-kernel.patch')
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/Update-compaction-instrumentation-to-3.16-kernel.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-modules/Update-compaction-instrumentation-to-3.16-kernel.patch b/meta/recipes-kernel/lttng/lttng-modules/Update-compaction-instrumentation-to-3.16-kernel.patch
new file mode 100644
index 0000000000..0a056a9475
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/Update-compaction-instrumentation-to-3.16-kernel.patch
@@ -0,0 +1,83 @@
1From 0007344741ef65259bc52dea72259173dfbf96c0 Mon Sep 17 00:00:00 2001
2From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
3Date: Sun, 13 Jul 2014 13:33:21 -0400
4Subject: [PATCH 2/2] Update compaction instrumentation to 3.16 kernel
5
6Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7---
8 instrumentation/events/lttng-module/compaction.h | 45 +++++++++++++++++++++++-
9 1 file changed, 44 insertions(+), 1 deletion(-)
10
11diff --git a/instrumentation/events/lttng-module/compaction.h b/instrumentation/events/lttng-module/compaction.h
12index 1b237fa45ab0..22024e9ee582 100644
13--- a/instrumentation/events/lttng-module/compaction.h
14+++ b/instrumentation/events/lttng-module/compaction.h
15@@ -6,6 +6,7 @@
16
17 #include <linux/types.h>
18 #include <linux/tracepoint.h>
19+#include <linux/version.h>
20 #include <trace/events/gfpflags.h>
21
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)
25 )
26
27+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
28+TRACE_EVENT(mm_compaction_migratepages,
29+
30+ TP_PROTO(unsigned long nr_all,
31+ int migrate_rc,
32+ struct list_head *migratepages),
33+
34+ TP_ARGS(nr_all, migrate_rc, migratepages),
35+
36+ TP_STRUCT__entry(
37+ __field(unsigned long, nr_migrated)
38+ __field(unsigned long, nr_failed)
39+ ),
40+
41+ TP_fast_assign(
42+ tp_assign(nr_migrated,
43+ nr_all -
44+ (migrate_rc >= 0 ? migrate_rc :
45+ ({
46+ unsigned long nr_failed = 0;
47+ struct list_head *page_lru;
48+
49+ list_for_each(page_lru, migratepages)
50+ nr_failed++;
51+ nr_failed;
52+ })))
53+ tp_assign(nr_failed,
54+ ({
55+ unsigned long nr_failed = 0;
56+ struct list_head *page_lru;
57+
58+ list_for_each(page_lru, migratepages)
59+ nr_failed++;
60+ nr_failed;
61+ }))
62+ ),
63+
64+ TP_printk("nr_migrated=%lu nr_failed=%lu",
65+ __entry->nr_migrated,
66+ __entry->nr_failed)
67+)
68+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
69 TRACE_EVENT(mm_compaction_migratepages,
70
71 TP_PROTO(unsigned long nr_migrated,
72@@ -66,7 +109,7 @@ TRACE_EVENT(mm_compaction_migratepages,
73 __entry->nr_migrated,
74 __entry->nr_failed)
75 )
76-
77+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
78
79 #endif /* _TRACE_COMPACTION_H */
80
81--
821.8.1.2
83