Fix: compaction mm_compaction_isolate_template update for Linux 4.0+
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 19 Mar 2015 18:32:59 +0000 (14:32 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 19 Mar 2015 19:31:38 +0000 (15:31 -0400)
Updated by Linux commit:

commit b7aba6984dc048503b69c2a885098cdd430832bf
Author: Mel Gorman <mel@csn.ul.ie>
Date:   Thu Jan 13 15:45:54 2011 -0800

    mm: compaction: add trace events for memory compaction activity

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/compaction.h

index 3becac87d1cac18d88b0a30e476f1823f2ad8621..7914e234c471631fe927ef9ec9c301aa22e2c2e3 100644 (file)
@@ -9,6 +9,60 @@
 #include <linux/version.h>
 #include <trace/events/gfpflags.h>
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
+
+LTTNG_TRACEPOINT_EVENT_CLASS(mm_compaction_isolate_template,
+
+       TP_PROTO(unsigned long start_pfn,
+               unsigned long end_pfn,
+               unsigned long nr_scanned,
+               unsigned long nr_taken),
+
+       TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken),
+
+       TP_STRUCT__entry(
+               __field(unsigned long, start_pfn)
+               __field(unsigned long, end_pfn)
+               __field(unsigned long, nr_scanned)
+               __field(unsigned long, nr_taken)
+       ),
+
+       TP_fast_assign(
+               tp_assign(start_pfn, start_pfn)
+               tp_assign(end_pfn, end_pfn)
+               tp_assign(nr_scanned, nr_scanned)
+               tp_assign(nr_taken, nr_taken)
+       ),
+
+       TP_printk("range=(0x%lx ~ 0x%lx) nr_scanned=%lu nr_taken=%lu",
+               __entry->start_pfn,
+               __entry->end_pfn,
+               __entry->nr_scanned,
+               __entry->nr_taken)
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_compaction_isolate_template, mm_compaction_isolate_migratepages,
+
+       TP_PROTO(unsigned long start_pfn,
+               unsigned long end_pfn,
+               unsigned long nr_scanned,
+               unsigned long nr_taken),
+
+       TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken)
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_compaction_isolate_template, mm_compaction_isolate_freepages,
+
+       TP_PROTO(unsigned long start_pfn,
+               unsigned long end_pfn,
+               unsigned long nr_scanned,
+               unsigned long nr_taken),
+
+       TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken)
+)
+
+#else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) */
+
 LTTNG_TRACEPOINT_EVENT_CLASS(mm_compaction_isolate_template,
 
        TP_PROTO(unsigned long nr_scanned,
@@ -46,6 +100,8 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_compaction_isolate_template, mm_compaction_is
        TP_ARGS(nr_scanned, nr_taken)
 )
 
+#endif /* #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) */
+
 #if LTTNG_KERNEL_RANGE(3,12,30, 3,13,0) || \
        LTTNG_KERNEL_RANGE(3,14,25, 3,15,0) || \
        (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
This page took 0.027073 seconds and 4 git commands to generate.