]> git.pld-linux.org Git - packages/lttng-modules.git/blob - Update-compaction-instrumentation-to-3.16-kernel.patch
0a056a947570b83ca356ee6ced207cd7f5070cd2
[packages/lttng-modules.git] / Update-compaction-instrumentation-to-3.16-kernel.patch
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
5
6 Signed-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
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
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 -- 
82 1.8.1.2
83
This page took 0.05668 seconds and 2 git commands to generate.