diff options
author | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-03-03 23:05:32 +0100 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-03-11 17:48:43 +0100 |
commit | 953c2f052112a857c00058a641dc0c58ec7551d4 (patch) | |
tree | 4113cdf34d6e167cee72debf067e54716584e89a /samples/Makefile | |
parent | tracing: Allow custom events to be added to the tracefs directory (diff) | |
download | linux-953c2f052112a857c00058a641dc0c58ec7551d4.tar.xz linux-953c2f052112a857c00058a641dc0c58ec7551d4.zip |
tracing: Add sample code for custom trace events
Add sample code to show how to create custom trace events in the tracefs
directory that can be enabled and modified like any event in tracefs
(including triggers, histograms, synthetic events and event probes).
The example is creating a custom sched_switch and a sched_waking to limit
what is recorded:
If the custom sched switch only records the prev_prio, next_prio and
next_pid, it can bring the size from 64 bytes per event, down to just 16
bytes!
If sched_waking only records the prio and pid of the woken event, it will
bring the size down from 36 bytes to 12 bytes per event.
This will allow for a much smaller footprint into the ring buffer and keep
more events from dropping.
Link: https://lkml.kernel.org/r/20220303220625.369226746@goodmis.org
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Tom Zanussi <zanussi@kernel.org>
Suggested-by: Joel Fernandes <joel@joelfernandes.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'samples/Makefile')
-rw-r--r-- | samples/Makefile | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/samples/Makefile b/samples/Makefile index 1ae4de99c983..448343e8faeb 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -20,6 +20,7 @@ obj-$(CONFIG_SAMPLE_RPMSG_CLIENT) += rpmsg/ subdir-$(CONFIG_SAMPLE_SECCOMP) += seccomp subdir-$(CONFIG_SAMPLE_TIMER) += timers obj-$(CONFIG_SAMPLE_TRACE_EVENTS) += trace_events/ +obj-$(CONFIG_SAMPLE_TRACE_CUSTOM_EVENTS) += trace_events/ obj-$(CONFIG_SAMPLE_TRACE_PRINTK) += trace_printk/ obj-$(CONFIG_SAMPLE_FTRACE_DIRECT) += ftrace/ obj-$(CONFIG_SAMPLE_FTRACE_DIRECT_MULTI) += ftrace/ |