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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1453643615-1616-9-git-send-email-namhyung@kernel.org>
Date:	Sun, 24 Jan 2016 22:53:31 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Jiri Olsa <jolsa@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Andi Kleen <andi@...stfloor.org>,
	David Ahern <dsahern@...il.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Wang Nan <wangnan0@...wei.com>
Subject: [PATCH 08/12] perf hists browser: Apply callchain percent limit

Currently 'perf report --tui' misses to check percent limit on
callchains.  Fix it.

Reported-by: Andi Kleen <andi@...stfloor.org>
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
---
 tools/perf/ui/browsers/hists.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index c7ca36dae89f..3d64a6573d0c 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -681,6 +681,14 @@ static int hist_browser__show_callchain_flat(struct hist_browser *browser,
 		char folded_sign = ' ';
 		int first = true;
 		int extra_offset = 0;
+		double percent;
+		u64 hits;
+
+		hits = callchain_cumul_hits(child);
+		percent = 100.0 * hits / total;
+
+		if (percent < callchain_param.min_percent)
+			goto next;
 
 		list_for_each_entry(chain, &child->parent_val, list) {
 			bool was_first = first;
@@ -784,12 +792,20 @@ static int hist_browser__show_callchain_folded(struct hist_browser *browser,
 		int first = true;
 		char *value_str = NULL, *value_str_alloc = NULL;
 		char *chain_str = NULL, *chain_str_alloc = NULL;
+		double percent;
+		u64 hits;
 
 		if (arg->row_offset != 0) {
 			arg->row_offset--;
 			goto next;
 		}
 
+		hits = callchain_cumul_hits(child);
+		percent = 100.0 * hits / total;
+
+		if (percent < callchain_param.min_percent)
+			goto next;
+
 		if (need_percent) {
 			char buf[64];
 
@@ -869,6 +885,14 @@ static int hist_browser__show_callchain_graph(struct hist_browser *browser,
 		char folded_sign = ' ';
 		int first = true;
 		int extra_offset = 0;
+		double percent;
+		u64 hits;
+
+		hits = callchain_cumul_hits(child);
+		percent = 100.0 * hits / total;
+
+		if (percent < callchain_param.min_percent)
+			goto next;
 
 		list_for_each_entry(chain, &child->val, list) {
 			bool was_first = first;
@@ -905,6 +929,7 @@ static int hist_browser__show_callchain_graph(struct hist_browser *browser,
 							    new_level, row, new_total,
 							    print, arg, is_output_full);
 		}
+next:
 		if (is_output_full(browser, row))
 			break;
 		node = next;
-- 
2.6.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ