From: Masami Hiramatsu <mhiramat@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Masami Hiramatsu <mhiramat@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
linux-perf-users@vger.kernel.org
Subject: [PATCH 2/3] perf/probe: Show return probe correctly with --bootconfig
Date: Sat, 19 Jun 2021 01:11:00 +0900 [thread overview]
Message-ID: <162403265988.528888.9996688190141639740.stgit@devnote2> (raw)
In-Reply-To: <162403264218.528888.2914545241015551186.stgit@devnote2>
Since the bootconfig has to use "%return" suffix for the return
probes, perf probe also needs to add that suffix if the user
defines the return probe. E.g.
$ perf probe -k vmlinux --bootconfig -D vfs_read%return
ftrace.event.kprobes.vfs_read__return.probe = 'vfs_read+0%return'
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
tools/perf/util/probe-event.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 8e30bf97cf0f..99624e39314b 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -2166,15 +2166,17 @@ synthesize_uprobe_trace_def(struct probe_trace_point *tp, struct strbuf *buf)
}
static int
-synthesize_kprobe_trace_def(struct probe_trace_point *tp, struct strbuf *buf)
+synthesize_kprobe_trace_def(struct probe_trace_point *tp, struct strbuf *buf,
+ bool show_return)
{
if (!strncmp(tp->symbol, "0x", 2)) {
/* Absolute address. See try_to_find_absolute_address() */
return strbuf_addf(buf, "%s%s0x%lx", tp->module ?: "",
tp->module ? ":" : "", tp->address);
} else {
- return strbuf_addf(buf, "%s%s%s+%lu", tp->module ?: "",
- tp->module ? ":" : "", tp->symbol, tp->offset);
+ return strbuf_addf(buf, "%s%s%s+%lu%s", tp->module ?: "",
+ tp->module ? ":" : "", tp->symbol, tp->offset,
+ show_return && tp->retprobe ? "%return" : "");
}
}
@@ -2195,7 +2197,7 @@ char *synthesize_probe_trace_command(struct probe_trace_event *tev)
if (tev->uprobes)
err = synthesize_uprobe_trace_def(tp, &buf);
else
- err = synthesize_kprobe_trace_def(tp, &buf);
+ err = synthesize_kprobe_trace_def(tp, &buf, false);
if (err >= 0)
err = synthesize_probe_trace_args(tev, &buf);
@@ -3574,7 +3576,7 @@ static int show_bootconfig_event(struct probe_trace_event *tev)
if (strbuf_init(&buf, 32) < 0)
return -ENOMEM;
- err = synthesize_kprobe_trace_def(tp, &buf);
+ err = synthesize_kprobe_trace_def(tp, &buf, true);
if (err >= 0)
err = synthesize_probe_trace_args(tev, &buf);
if (err >= 0)
next prev parent reply other threads:[~2021-06-18 16:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-04 16:28 [PATCH 0/3] perf probe: Boot time tracing support Masami Hiramatsu
2021-06-04 16:28 ` [PATCH 1/3] perf/probe: Support probes on init functions for offline kernel Masami Hiramatsu
2021-06-04 16:28 ` [PATCH 2/3] perf/probe: Cleanup synthesize_probe_trace_command Masami Hiramatsu
2021-06-04 16:28 ` [PATCH 3/3] perf/probe: Add --bootconfig to output definition in bootconfig format Masami Hiramatsu
2021-06-18 13:14 ` Arnaldo Carvalho de Melo
2021-06-18 15:07 ` Masami Hiramatsu
2021-06-18 16:10 ` [PATCH 0/3] perf probe: Boot time tracing support followup Masami Hiramatsu
2021-06-18 16:10 ` [PATCH 1/3] [v2] perf/probe: Add --bootconfig to output definition in bootconfig format Masami Hiramatsu
2021-06-18 16:11 ` Masami Hiramatsu [this message]
2021-06-18 16:11 ` [PATCH 3/3] perf/probe: docs: Add --bootconfig option to perf-probe manual Masami Hiramatsu
2021-06-18 15:55 ` [PATCH 3/3] perf/probe: Add --bootconfig to output definition in bootconfig format Masami Hiramatsu
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=162403265988.528888.9996688190141639740.stgit@devnote2 \
--to=mhiramat@kernel.org \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.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).