stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org
Subject: [PATCH 3/3] perf-probe: Do not show the skipped events
Date: Thu, 23 Apr 2020 20:01:22 +0900	[thread overview]
Message-ID: <158763968263.30755.12800484151476026340.stgit@devnote2> (raw)
In-Reply-To: <158763965400.30755.14484569071233923742.stgit@devnote2>

When a probe point is expanded to several places (like inlined) and
if some of them are skipped because of blacklisted or __init function,
those trace_events has no event name. It must be skipped while showing
results.

Without this fix, you can see "(null):(null)" on the list,
===========
  # ./perf probe request_resource
  reserve_setup is out of .text, skip it.
  Added new events:
    (null):(null)        (on request_resource)
    probe:request_resource (on request_resource)

  You can now use it in all perf tools, such as:

  	perf record -e probe:request_resource -aR sleep 1

===========

With this fix, it is ignored.
===========
  # ./perf probe request_resource
  reserve_setup is out of .text, skip it.
  Added new events:
    probe:request_resource (on request_resource)

  You can now use it in all perf tools, such as:

  	perf record -e probe:request_resource -aR sleep 1

===========

Fixes: 5a51fcd1f30c ("perf probe: Skip kernel symbols which is out of .text")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: stable@vger.kernel.org
---
 tools/perf/builtin-probe.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 70548df2abb9..6b1507566770 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -364,6 +364,9 @@ static int perf_add_probe_events(struct perf_probe_event *pevs, int npevs)
 
 		for (k = 0; k < pev->ntevs; k++) {
 			struct probe_trace_event *tev = &pev->tevs[k];
+			/* Skipped events have no event name */
+			if (!tev->event)
+				continue;
 
 			/* We use tev's name for showing new events */
 			show_perf_probe_event(tev->group, tev->event, pev,


  parent reply	other threads:[~2020-04-23 11:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23 11:00 [PATCH 0/3] perf-probe: Fix __init function and blacklist checking Masami Hiramatsu
2020-04-23 11:01 ` [PATCH 1/3] perf-probe: Fix to check blacklist address correctly Masami Hiramatsu
2020-04-26 15:03   ` Sasha Levin
2020-05-06 16:44   ` Arnaldo Carvalho de Melo
2020-04-23 11:01 ` [PATCH 2/3] perf-probe: Check address correctness by map instead of _etext Masami Hiramatsu
2020-04-23 14:01   ` Arnaldo Carvalho de Melo
2020-04-23 11:01 ` Masami Hiramatsu [this message]
2020-04-23 14:01   ` [PATCH 3/3] perf-probe: Do not show the skipped events Arnaldo Carvalho de Melo
2020-04-23 23:33     ` Masami Hiramatsu
2020-04-24 13:08       ` Arnaldo Carvalho de Melo
2020-05-06 16:48 ` [PATCH 0/3] perf-probe: Fix __init function and blacklist checking Arnaldo Carvalho de Melo

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=158763968263.30755.12800484151476026340.stgit@devnote2 \
    --to=mhiramat@kernel.org \
    --cc=acme@kernel.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=stable@vger.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;
as well as URLs for NNTP newsgroup(s).