tracing: Add support for dynamic strings to synthetic events
Currently, sythetic events only support static string fields such as: # echo 'test_latency u64 lat; char somename[32]' > /sys/kernel/debug/tracing/synthetic_events Which is fine, but wastes a lot of space in the event. It also prevents the most commonly-defined strings in the existing trace events e.g. those defined using __string(), from being passed to synthetic events via the trace() action. With this change, synthetic events with dynamic fields can be defined: # echo 'test_latency u64 lat; char somename[]' > /sys/kernel/debug/tracing/synthetic_events And the trace() action can be used to generate events using either dynamic or static strings: # echo 'hist:keys=name:lat=common_timestamp.usecs-$ts0:onmatch(sys.event).test_latency($lat,name)' > /sys/kernel/debug/tracing/events The synthetic event dynamic strings are implemented in the same way as the existing __data_loc strings and appear as such in the format file. [ <rostedt@go...
Showing
- Documentation/trace/events.rst 13 additions, 2 deletionsDocumentation/trace/events.rst
- Documentation/trace/histogram.rst 18 additions, 0 deletionsDocumentation/trace/histogram.rst
- kernel/trace/synth_event_gen_test.c 12 additions, 6 deletionskernel/trace/synth_event_gen_test.c
- kernel/trace/trace_events_hist.c 9 additions, 0 deletionskernel/trace/trace_events_hist.c
- kernel/trace/trace_events_synth.c 216 additions, 32 deletionskernel/trace/trace_events_synth.c
- kernel/trace/trace_synth.h 4 additions, 0 deletionskernel/trace/trace_synth.h
Please register or sign in to comment