Skip to content

Commit 726721a

Browse files
Tom Zanussirostedt
authored andcommitted
tracing: Move synthetic events to a separate file
With the addition of the in-kernel synthetic event API, synthetic events are no longer specifically tied to the histogram triggers. The synthetic event code is also making trace_event_hist.c very bloated, so for those reasons, move it to a separate file, trace_events_synth.c, along with a new trace_synth.h header file. Because synthetic events are now independent from hist triggers, add a new CONFIG_SYNTH_EVENTS config option, and have CONFIG_HIST_TRIGGERS select it, and have CONFIG_SYNTH_EVENT_GEN_TEST depend on it. Link: http://lkml.kernel.org/r/4d1fa1f85ed5982706ac44844ac92451dcb04715.1590693308.git.zanussi@kernel.org Signed-off-by: Tom Zanussi <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 5bbf959 commit 726721a

File tree

5 files changed

+1989
-1928
lines changed

5 files changed

+1989
-1928
lines changed

kernel/trace/Kconfig

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,12 +623,30 @@ config TRACING_MAP
623623
generally used outside of that context, and is normally
624624
selected by tracers that use it.
625625

626+
config SYNTH_EVENTS
627+
bool "Synthetic trace events"
628+
select TRACING
629+
select DYNAMIC_EVENTS
630+
default n
631+
help
632+
Synthetic events are user-defined trace events that can be
633+
used to combine data from other trace events or in fact any
634+
data source. Synthetic events can be generated indirectly
635+
via the trace() action of histogram triggers or directly
636+
by way of an in-kernel API.
637+
638+
See Documentation/trace/events.rst or
639+
Documentation/trace/histogram.rst for details and examples.
640+
641+
If in doubt, say N.
642+
626643
config HIST_TRIGGERS
627644
bool "Histogram triggers"
628645
depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
629646
select TRACING_MAP
630647
select TRACING
631648
select DYNAMIC_EVENTS
649+
select SYNTH_EVENTS
632650
default n
633651
help
634652
Hist triggers allow one or more arbitrary trace event fields
@@ -824,7 +842,7 @@ config PREEMPTIRQ_DELAY_TEST
824842

825843
config SYNTH_EVENT_GEN_TEST
826844
tristate "Test module for in-kernel synthetic event generation"
827-
depends on HIST_TRIGGERS
845+
depends on SYNTH_EVENTS
828846
help
829847
This option creates a test module to check the base
830848
functionality of in-kernel synthetic event definition and

kernel/trace/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ endif
7272
obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o
7373
obj-$(CONFIG_EVENT_TRACING) += trace_events_trigger.o
7474
obj-$(CONFIG_TRACE_EVENT_INJECT) += trace_events_inject.o
75+
obj-$(CONFIG_SYNTH_EVENTS) += trace_events_synth.o
7576
obj-$(CONFIG_HIST_TRIGGERS) += trace_events_hist.o
7677
obj-$(CONFIG_BPF_EVENTS) += bpf_trace.o
7778
obj-$(CONFIG_KPROBE_EVENTS) += trace_kprobe.o

0 commit comments

Comments
 (0)