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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 24 Jul 2012 18:01:29 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>,
	Ingo Molnar <mingo@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Stephane Eranian <eranian@...gle.com>,
	Jiri Olsa <jolsa@...hat.com>,
	Ulrich Drepper <drepper@...il.com>,
	Andi Kleen <andi@...stfloor.org>,
	Namhyung Kim <namhyung.kim@....com>
Subject: [PATCH 08/12] perf ui/browser: Add support to group viewing

From: Namhyung Kim <namhyung.kim@....com>

Show group members' overhead also when showing the leader's.

Signed-off-by: Namhyung Kim <namhyung@...nel.org>
---
 tools/perf/ui/browsers/hists.c |   28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 69584d79097e..bdb1b2f9f819 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -553,6 +553,33 @@ static int hist_browser__show_callchain(struct hist_browser *browser,
 	return row - first_row;
 }
 
+static int hist_browser__hpp_color_overhead(struct hist_print_context *ctx,
+					    struct hist_entry *he)
+{
+	int ret;
+	double percent = 100.0 * he->stat.period / ctx->total_period;
+
+	/* the leader determines the color */
+	*(double *)ctx->ptr = percent;
+
+	ret = scnprintf(ctx->s, ctx->size, "%5.2f%%", percent);
+
+	if (symbol_conf.report_group) {
+		struct perf_evsel *evsel = hists_2_evsel(ctx->hists);
+		int i;
+
+		for (i = 0; i < evsel->nr_children; i++) {
+			u64 period = he->group_stats[i].period;
+			u64 total_period = ctx->hists->group_stats[i].total_period;
+
+			percent = 100.0 * period / total_period;
+			ret += scnprintf(ctx->s + ret, ctx->size - ret,
+					 "  %5.2f%%", percent);
+		}
+	}
+	return ret;
+}
+
 #define HPP_COLOR_FN(_name, _field)						\
 static int hist_browser__hpp_color_ ## _name(struct hist_print_context *ctx,	\
 					     struct hist_entry *he)		\
@@ -562,7 +589,6 @@ static int hist_browser__hpp_color_ ## _name(struct hist_print_context *ctx,	\
 	return scnprintf(ctx->s, ctx->size, "%5.2f%%", percent);		\
 }
 
-HPP_COLOR_FN(overhead, period)
 HPP_COLOR_FN(overhead_sys, period_sys)
 HPP_COLOR_FN(overhead_us, period_us)
 HPP_COLOR_FN(overhead_guest_sys, period_guest_sys)
-- 
1.7.10.4

--
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