X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=instrumentation%2Fevents%2Flttng-module%2Fcompaction.h;h=2fed729096cf2c3b9a3333c291bf2c25b943bfe1;hb=cd0e562b34209a1196e89b799be2973412a6862a;hp=10edec41425ff3d0c06c839609f8cbb3fad04ace;hpb=f127e61ee231d002fb9a7803643a157e06f6d2e2;p=lttng-modules.git diff --git a/instrumentation/events/lttng-module/compaction.h b/instrumentation/events/lttng-module/compaction.h index 10edec41..2fed7290 100644 --- a/instrumentation/events/lttng-module/compaction.h +++ b/instrumentation/events/lttng-module/compaction.h @@ -1,15 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ #undef TRACE_SYSTEM #define TRACE_SYSTEM compaction #if !defined(LTTNG_TRACE_COMPACTION_H) || defined(TRACE_HEADER_MULTI_READ) #define LTTNG_TRACE_COMPACTION_H -#include "../../../probes/lttng-tracepoint-event.h" +#include #include -#include -#include - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) LTTNG_TRACEPOINT_EVENT_CLASS(compaction_isolate_template, @@ -28,17 +25,11 @@ LTTNG_TRACEPOINT_EVENT_CLASS(compaction_isolate_template, ) ) -LTTNG_TRACEPOINT_EVENT_INSTANCE(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), +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template, - TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken) -) + mm_compaction_isolate_migratepages, -LTTNG_TRACEPOINT_EVENT_INSTANCE(compaction_isolate_template, mm_compaction_isolate_freepages, + compaction_isolate_migratepages, TP_PROTO(unsigned long start_pfn, unsigned long end_pfn, @@ -48,50 +39,20 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(compaction_isolate_template, mm_compaction_isola TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken) ) -#else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) */ - -LTTNG_TRACEPOINT_EVENT_CLASS(compaction_isolate_template, - - TP_PROTO(unsigned long nr_scanned, - unsigned long nr_taken), - - TP_ARGS(nr_scanned, nr_taken), - - TP_FIELDS( - ctf_integer(unsigned long, nr_scanned, nr_scanned) - ctf_integer(unsigned long, nr_taken, nr_taken) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template, - - mm_compaction_isolate_migratepages, - - compaction_isolate_migratepages, - - TP_PROTO(unsigned long nr_scanned, - unsigned long nr_taken), - - TP_ARGS(nr_scanned, nr_taken) -) - LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template, mm_compaction_isolate_freepages, compaction_isolate_freepages, - TP_PROTO(unsigned long nr_scanned, + TP_PROTO(unsigned long start_pfn, + unsigned long end_pfn, + unsigned long nr_scanned, unsigned long nr_taken), - TP_ARGS(nr_scanned, nr_taken) + TP_ARGS(start_pfn, end_pfn, 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)) LTTNG_TRACEPOINT_EVENT_CODE_MAP(mm_compaction_migratepages, compaction_migratepages, @@ -106,7 +67,7 @@ LTTNG_TRACEPOINT_EVENT_CODE_MAP(mm_compaction_migratepages, unsigned long nr_failed; ), - TP_code( + TP_code_pre( tp_locvar->nr_failed = 0; { @@ -123,26 +84,12 @@ LTTNG_TRACEPOINT_EVENT_CODE_MAP(mm_compaction_migratepages, TP_FIELDS( ctf_integer(unsigned long, nr_migrated, nr_all - tp_locvar->nr_failed) ctf_integer(unsigned long, nr_failed, tp_locvar->nr_failed) - ) -) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */ -LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages, - - compaction_migratepages, - - TP_PROTO(unsigned long nr_migrated, - unsigned long nr_failed), - - TP_ARGS(nr_migrated, nr_failed), + ), - TP_FIELDS( - ctf_integer(unsigned long, nr_migrated, nr_migrated) - ctf_integer(unsigned long, nr_failed, nr_failed) - ) + TP_code_post() ) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */ #endif /* LTTNG_TRACE_COMPACTION_H */ /* This part must be outside protection */ -#include "../../../probes/define_trace.h" +#include