public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Daniel Bristot de Oliveira <bristot@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Tom Zanussi <zanussi@kernel.org>
Subject: [for-next][PATCH 05/20] tracing: Add numeric delta time to the trace event benchmark
Date: Tue, 27 Sep 2022 12:02:21 -0400	[thread overview]
Message-ID: <20220927160243.204183194@goodmis.org> (raw)
In-Reply-To: 20220927160216.349640304@goodmis.org

From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

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>
---
 kernel/trace/trace_benchmark.c | 2 +-
 kernel/trace/trace_benchmark.h | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/kernel/trace/trace_benchmark.c b/kernel/trace/trace_benchmark.c
index 801c2a7f7605..54d5fa35c90a 100644
--- a/kernel/trace/trace_benchmark.c
+++ b/kernel/trace/trace_benchmark.c
@@ -51,7 +51,7 @@ static void trace_do_benchmark(void)
 
 	local_irq_disable();
 	start = trace_clock_local();
-	trace_benchmark_event(bm_str);
+	trace_benchmark_event(bm_str, bm_last);
 	stop = trace_clock_local();
 	local_irq_enable();
 
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
 );
-- 
2.35.1

  parent reply	other threads:[~2022-09-27 16:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27 16:02 [for-next][PATCH 00/20] tracing: Update for 6.1 Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 01/20] tracing/eprobe: Add eprobe filter support Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 02/20] selftests/ftrace: Add eprobe syntax error testcase Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 03/20] rv/monitors: add static qualifier for local symbols Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 04/20] rv/dot2K: add static qualifier for local variable Steven Rostedt
2022-09-27 16:02 ` Steven Rostedt [this message]
2022-09-27 16:02 ` [for-next][PATCH 06/20] tracing/hist: Call hist functions directly via a switch statement Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 07/20] tracing: Move struct filter_pred into trace_events_filter.c Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 08/20] tracing/filter: Call filter predicate functions directly via a switch statement Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 09/20] tracepoint: Optimize the critical region of mutex_lock in tracepoint_module_coming() Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 10/20] x86/ftrace: Remove unused modifying_ftrace_code declaration Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 11/20] x86/kprobes: Remove unused arch_kprobe_override_function() declaration Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 12/20] tracing: kprobe: Fix kprobe event gen test module on exit Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 13/20] tracing: kprobe: Make gen test module work in arm and riscv Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 14/20] tracing/osnoise: Fix possible recursive locking in stop_per_cpu_kthreads Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 15/20] rv/monitor: Add __init/__exit annotations to module init/exit funcs Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 16/20] tracing: Disable interrupt or preemption before acquiring arch_spinlock_t Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 17/20] ftrace: Remove obsoleted code from ftrace and task_struct Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 18/20] x86: kprobes: Remove unused macro stack_addr Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 19/20] tracing/eprobe: Fix alloc event dir failed when event name no set Steven Rostedt
2022-09-27 16:02 ` [for-next][PATCH 20/20] ftrace: Properly unset FTRACE_HASH_FL_MOD Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220927160243.204183194@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=bristot@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=zanussi@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox