From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH v6 0/2] tracing: Add an option to show symbols in _text+offset for function profiler
Date: Fri, 31 Oct 2025 11:13:02 +0900 [thread overview]
Message-ID: <20251031111302.43c44a032d350bc0fd3ac791@kernel.org> (raw)
In-Reply-To: <20251030052548.31130e33@gandalf.local.home>
On Thu, 30 Oct 2025 05:25:48 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Thu, 30 Oct 2025 12:30:05 +0900
> "Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:
>
> > kernel/trace/blktrace.c | 6 +
> > kernel/trace/ftrace.c | 26 ++++++
> > kernel/trace/trace.c | 154 +++++++++++++++++-----------------
> > kernel/trace/trace.h | 40 +++++----
> > kernel/trace/trace_events.c | 4 -
> > kernel/trace/trace_events_synth.c | 2
> > kernel/trace/trace_fprobe.c | 6 +
> > kernel/trace/trace_functions_graph.c | 18 ++--
> > kernel/trace/trace_irqsoff.c | 30 +++----
> > kernel/trace/trace_kdb.c | 2
> > kernel/trace/trace_kprobe.c | 6 +
> > kernel/trace/trace_output.c | 18 ++--
> > kernel/trace/trace_sched_wakeup.c | 24 +++--
> > kernel/trace/trace_syscalls.c | 4 -
> > kernel/trace/trace_wprobe.c | 2
>
> I didn't realize this affected your branch too. Which means I can't apply
> this to any branch.
>
> Also, could you make a helper function...
>
> +++ b/kernel/trace/trace_wprobe.c
> @@ -260,7 +260,7 @@ print_wprobe_event(struct trace_iterator *iter, int flags,
>
> trace_seq_printf(s, "%s: (", trace_probe_name(tp));
>
> - if (!seq_print_ip_sym(s, field->ip, flags | TRACE_ITER_SYM_OFFSET))
> + if (!seq_print_ip_sym(s, field->ip, flags | TRACE_ITER(SYM_OFFSET)))
> goto out;
>
> trace_seq_putc(s, ')');
>
> that both fprobe and wprobe use? And then you don't need to have this open
> coded everywhere.
>
> That is, add this patch:
>
> diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h
> index 591adc9bb1e9..bd26004cc320 100644
> --- a/kernel/trace/trace_probe.h
> +++ b/kernel/trace/trace_probe.h
> @@ -598,3 +598,9 @@ struct uprobe_dispatch_data {
> struct trace_uprobe *tu;
> unsigned long bp_addr;
> };
> +
> +static inline int probe_print_ip_sym(struct trace_seq *s, unsigned long ip,
> + int flags)
> +{
> + retun seq_print_ip_sym(s, field->ip, flags | TRACE_ITER_SYM_OFFSET);
> +}
>
> And use that instead.
I would like to use more generic wrappers:
static inline int seq_print_ip_sym_offset(struct trace_seq *s, unsigned long ip,
unsigned long sym_flags)
{
return seq_print_ip_sym(s,ip, sym_flags | TRACE_ITER(SYM_OFFSET));
}
static inline int seq_print_ip_sym_no_offset(struct trace_seq *s, unsigned long ip,
unsigned long sym_flags)
{
return seq_print_ip_sym(s,ip, sym_flags & ~TRACE_ITER(SYM_OFFSET));
}
In trace_output.h, since this is also used in function_graph tracer.
Thank you,
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
prev parent reply other threads:[~2025-10-31 2:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-30 3:30 [PATCH v6 0/2] tracing: Add an option to show symbols in _text+offset for function profiler Masami Hiramatsu (Google)
2025-10-30 3:30 ` [PATCH v6 1/2] tracing: Allow tracer to add more than 32 options Masami Hiramatsu (Google)
2025-10-30 3:30 ` [PATCH v6 2/2] tracing: Add an option to show symbols in _text+offset for function profiler Masami Hiramatsu (Google)
2025-10-30 9:25 ` [PATCH v6 0/2] " Steven Rostedt
2025-10-31 1:29 ` Masami Hiramatsu
2025-10-31 12:27 ` Steven Rostedt
2025-10-31 2:13 ` Masami Hiramatsu [this message]
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=20251031111302.43c44a032d350bc0fd3ac791@kernel.org \
--to=mhiramat@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=rostedt@goodmis.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;
as well as URLs for NNTP newsgroup(s).