mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-07 22:42:04 +00:00
953c2f0521
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>
18 lines
665 B
Makefile
18 lines
665 B
Makefile
# SPDX-License-Identifier: GPL-2.0-only
|
|
# builds the trace events example kernel modules;
|
|
# then to use one (as root): insmod <module_name.ko>
|
|
|
|
# If you include a trace header outside of include/trace/events
|
|
# then the file that does the #define CREATE_TRACE_POINTS must
|
|
# have that tracer file in its main search path. This is because
|
|
# define_trace.h will include it, and must be able to find it from
|
|
# the include/trace directory.
|
|
#
|
|
# Here trace-events-sample.c does the CREATE_TRACE_POINTS.
|
|
#
|
|
CFLAGS_trace-events-sample.o := -I$(src)
|
|
|
|
obj-$(CONFIG_SAMPLE_TRACE_EVENTS) += trace-events-sample.o
|
|
|
|
obj-$(CONFIG_SAMPLE_TRACE_CUSTOM_EVENTS) += trace_custom_sched.o
|