lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 14 Apr 2015 13:05:03 +0100
From:	Steve Capper <steve.capper@...aro.org>
To:	linux-kernel@...r.kernel.org
Cc:	Steve Capper <steve.capper@...aro.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>,
	Ingo Molnar <mingo@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>
Subject: [RFC PATCH] perf report: Don't add filtered events to histogram

If one filters events by a single comm in perf report via:
 perf report --no-children -c program-name

perf will elide the comm column as only one comm is filtered in. This
lack of distinction by comm can lead to events being merged in
add_hist_entry that have different comm's, including events that have
been filtered out and filtered in. Ultimately, this can lead to events
disappearing from the report.

If one instead invokes perf via:
 perf report --no-children -c program-name,random-made-up-name

Then the comm column remains and all the expected events are present.

This patch prevents filtered out events from being considered by
hist_entry_iter__add.

Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
Signed-off-by: Steve Capper <steve.capper@...aro.org>
---
Hi,
This patch fixes my problem, but I don't know enough perf to
confidently state that this will work everywhere (hence this being
marked as an RFC).

Please let me know if I've missed something and I'll be happy to
re-spin/test/submit.

Cheers,
-- 
Steve
---
 tools/perf/builtin-report.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 2f91094..3eaf46e 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -166,6 +166,9 @@ static int process_sample_event(struct perf_tool *tool,
 	if (al.map != NULL)
 		al.map->dso->hit = 1;
 
+	if (al.filtered)
+		return 0;
+
 	ret = hist_entry_iter__add(&iter, &al, evsel, sample, rep->max_stack,
 				   rep);
 	if (ret < 0)
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ