From: Aaron Tomlin <atomlin@atomlin.com>
To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
namhyung@kernel.org, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@kernel.org,
irogers@google.com, adrian.hunter@intel.com,
kan.liang@linux.intel.com
Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
atomlin@atomlin.com
Subject: [PATCH] perf probe: Introduce --no-advice option when a new event is created
Date: Sat, 14 Dec 2024 19:34:52 +0000 [thread overview]
Message-ID: <20241214193452.16627-1-atomlin@atomlin.com> (raw)
This patch introduces a new option namely "--no-advice" to be used with
the add command. Now one has the ability to avoid the generation of any
advice when a new event is created. Thus making the output reasonable.
For example:
# perf probe --no-advice --add 'user_path_at%return return=$retval:s32'
Added new event:
probe:user_path_at__return (on user_path_at%return with return=$retval:s32)
#
Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>
---
tools/perf/builtin-probe.c | 4 +++-
tools/perf/util/probe-event.h | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 69800e4d9530..36b8e08f3725 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -391,7 +391,7 @@ static int perf_add_probe_events(struct perf_probe_event *pevs, int npevs)
}
/* Note that it is possible to skip all events because of blacklist */
- if (event) {
+ if (event && !probe_conf.no_advice) {
#ifndef HAVE_LIBTRACEEVENT
pr_info("\nperf is not linked with libtraceevent, to use the new probe you can use tracefs:\n\n");
pr_info("\tcd /sys/kernel/tracing/\n");
@@ -577,6 +577,8 @@ __cmd_probe(int argc, const char **argv)
"directory", "path to kernel source"),
OPT_BOOLEAN('\0', "no-inlines", &probe_conf.no_inlines,
"Don't search inlined functions"),
+ OPT_BOOLEAN('\0', "no-advice", &probe_conf.no_advice,
+ "Don't provide any advice after a new event is created."),
OPT__DRY_RUN(&probe_event_dry_run),
OPT_INTEGER('\0', "max-probes", &probe_conf.max_probes,
"Set how many probe points can be found for a probe."),
diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h
index 61a5f4ff4e9c..be0dce26e133 100644
--- a/tools/perf/util/probe-event.h
+++ b/tools/perf/util/probe-event.h
@@ -14,6 +14,7 @@ struct probe_conf {
bool show_location_range;
bool force_add;
bool no_inlines;
+ bool no_advice;
bool cache;
bool bootconfig;
int max_probes;
--
2.47.1
next reply other threads:[~2024-12-14 19:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-14 19:34 Aaron Tomlin [this message]
2025-01-24 0:25 ` [PATCH] perf probe: Introduce --no-advice option when a new event is created Namhyung Kim
2025-01-24 10:54 ` Aaron Tomlin
2025-01-24 17:37 ` Namhyung Kim
2025-01-25 12:22 ` Aaron Tomlin
2025-03-23 18:39 ` [PATCH 0/1] perf probe: Extend the quiet option Aaron Tomlin
2025-03-23 18:39 ` [PATCH 1/1] " Aaron Tomlin
[not found] ` <CA+JHD92anFo9rNOZ8NVyY4j23ukyWO-LRroHfUTnuOLnL-05-g@mail.gmail.com>
2025-01-25 12:31 ` [PATCH] perf probe: Introduce --no-advice option when a new event is created Aaron Tomlin
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=20241214193452.16627-1-atomlin@atomlin.com \
--to=atomlin@atomlin.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.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