[lttng-dev] [PATCH lttng-modules 2/3] Fix: use struct reclaim_stat in mm_vmscan_lru_shrink_inactive for 4.17
Michael Jeanson
mjeanson at efficios.com
Tue Apr 17 11:07:46 EDT 2018
See upstream commit:
commit d51d1e64500fcb48fc6a18c77c965b8f48a175f2
Author: Steven Rostedt <rostedt at goodmis.org>
Date: Tue Apr 10 16:28:07 2018 -0700
mm, vmscan, tracing: use pointer to reclaim_stat struct in trace event
The trace event trace_mm_vmscan_lru_shrink_inactive() currently has 12
parameters! Seven of them are from the reclaim_stat structure. This
structure is currently local to mm/vmscan.c. By moving it to the global
vmstat.h header, we can also reference it from the vmscan tracepoints.
In moving it, it brings down the overhead of passing so many arguments
to the trace event. In the future, we may limit the number of arguments
that a trace event may pass (ideally just 6, but more realistically it
may be 8).
Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
instrumentation/events/lttng-module/mm_vmscan.h | 26 ++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/instrumentation/events/lttng-module/mm_vmscan.h b/instrumentation/events/lttng-module/mm_vmscan.h
index 9661c9d..9a77ead 100644
--- a/instrumentation/events/lttng-module/mm_vmscan.h
+++ b/instrumentation/events/lttng-module/mm_vmscan.h
@@ -550,7 +550,31 @@ LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage,
)
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
+LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
+
+ TP_PROTO(int nid,
+ unsigned long nr_scanned, unsigned long nr_reclaimed,
+ struct reclaim_stat *stat, int priority, int file),
+
+ TP_ARGS(nid, nr_scanned, nr_reclaimed, stat, priority, file),
+
+ TP_FIELDS(
+ ctf_integer(int, nid, nid)
+ ctf_integer(unsigned long, nr_scanned, nr_scanned)
+ ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
+ ctf_integer(unsigned long, nr_dirty, stat->nr_dirty)
+ ctf_integer(unsigned long, nr_writeback, stat->nr_writeback)
+ ctf_integer(unsigned long, nr_congested, stat->nr_congested)
+ ctf_integer(unsigned long, nr_immediate, stat->nr_immediate)
+ ctf_integer(unsigned long, nr_activate, stat->nr_activate)
+ ctf_integer(unsigned long, nr_ref_keep, stat->nr_ref_keep)
+ ctf_integer(unsigned long, nr_unmap_fail, stat->nr_unmap_fail)
+ ctf_integer(int, priority, priority)
+ ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
+ )
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
TP_PROTO(int nid,
--
2.7.4
More information about the lttng-dev
mailing list