From: Mathieu Desnoyers Date: Thu, 19 Mar 2015 18:32:59 +0000 (-0400) Subject: Fix: compaction mm_compaction_isolate_template update for Linux 4.0+ X-Git-Tag: v2.7.0-rc1~83 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a57f014e9dba7d8674509d13a3ebd2769745b3ca;p=lttng-modules.git Fix: compaction mm_compaction_isolate_template update for Linux 4.0+ Updated by Linux commit: commit b7aba6984dc048503b69c2a885098cdd430832bf Author: Mel Gorman Date: Thu Jan 13 15:45:54 2011 -0800 mm: compaction: add trace events for memory compaction activity Signed-off-by: Mathieu Desnoyers --- diff --git a/instrumentation/events/lttng-module/compaction.h b/instrumentation/events/lttng-module/compaction.h index 3becac87..7914e234 100644 --- a/instrumentation/events/lttng-module/compaction.h +++ b/instrumentation/events/lttng-module/compaction.h @@ -9,6 +9,60 @@ #include #include +#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))