diff options
author | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-09-06 18:53:14 -0400 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-09-26 13:01:09 -0400 |
commit | b7b037eb5f548cc947e743d456d66eb110316f1e (patch) | |
tree | 8013c24d87ad7dcd107596bac7cd1827154979b3 /kernel/trace/trace_benchmark.h | |
parent | 4359a011e259a4608afc7fb3635370c9d4ba5943 (diff) | |
download | lwn-b7b037eb5f548cc947e743d456d66eb110316f1e.tar.gz lwn-b7b037eb5f548cc947e743d456d66eb110316f1e.zip |
tracing: Add numeric delta time to the trace event benchmark
In order to testing filtering and histograms via the trace event
benchmark, record the delta time of the last event as a numeric value
(currently, it just saves it within the string) so that filters and
histograms can use it.
Link: https://lkml.kernel.org/r/20220906225529.213677569@goodmis.org
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_benchmark.h')
-rw-r--r-- | kernel/trace/trace_benchmark.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/trace/trace_benchmark.h b/kernel/trace/trace_benchmark.h index 79e6fbe5b365..c3e91060dc94 100644 --- a/kernel/trace/trace_benchmark.h +++ b/kernel/trace/trace_benchmark.h @@ -14,19 +14,21 @@ extern void trace_benchmark_unreg(void); TRACE_EVENT_FN(benchmark_event, - TP_PROTO(const char *str), + TP_PROTO(const char *str, u64 delta), - TP_ARGS(str), + TP_ARGS(str, delta), TP_STRUCT__entry( __array( char, str, BENCHMARK_EVENT_STRLEN ) + __field( u64, delta) ), TP_fast_assign( memcpy(__entry->str, str, BENCHMARK_EVENT_STRLEN); + __entry->delta = delta; ), - TP_printk("%s", __entry->str), + TP_printk("%s delta=%llu", __entry->str, __entry->delta), trace_benchmark_reg, trace_benchmark_unreg ); |