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:	Sun,  2 Feb 2014 22:39:01 +0100
From:	Jiri Olsa <jolsa@...hat.com>
To:	linux-kernel@...r.kernel.org
Cc:	Jiri Olsa <jolsa@...hat.com>,
	Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...e.hu>,
	Namhyung Kim <namhyung@...nel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	David Ahern <dsahern@...il.com>
Subject: [PATCH 13/22] perf tools: Factor hpp_arg struct to carry hist_browser

The hpp_arg struct is used within the hist browser
specific code, so it could pass the hist_browser
struct itself.

We'll need access to hist browser struct within
__hpp__color_fmt function in following patch.

Signed-off-by: Jiri Olsa <jolsa@...hat.com>
Cc: Corey Ashford <cjashfor@...ux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: David Ahern <dsahern@...il.com>
---
 tools/perf/ui/browsers/hists.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 9a95fdc..3dd71d6 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -574,7 +574,7 @@ static int hist_browser__show_callchain(struct hist_browser *browser,
 }
 
 struct hpp_arg {
-	struct ui_browser *b;
+	struct hist_browser *hb;
 	char folded_sign;
 	bool current_entry;
 };
@@ -600,7 +600,7 @@ static int __hpp__color_fmt(struct perf_hpp *hpp, struct hist_entry *he,
 	if (hists->stats.total_period)
 		percent = 100.0 * get_field(he) / hists->stats.total_period;
 
-	ui_browser__set_percent_color(arg->b, percent, arg->current_entry);
+	ui_browser__set_percent_color(&arg->hb->b, percent, arg->current_entry);
 
 	if (callchain_cb)
 		ret += callchain_cb(arg);
@@ -634,7 +634,7 @@ static int __hpp__color_fmt(struct perf_hpp *hpp, struct hist_entry *he,
 				 * zero-fill group members in the middle which
 				 * have no sample
 				 */
-				ui_browser__set_percent_color(arg->b, 0.0,
+				ui_browser__set_percent_color(&arg->hb->b, 0.0,
 							arg->current_entry);
 				ret += scnprintf(hpp->buf, hpp->size,
 						 " %6.2f%%", 0.0);
@@ -642,7 +642,7 @@ static int __hpp__color_fmt(struct perf_hpp *hpp, struct hist_entry *he,
 			}
 
 			percent = 100.0 * period / total;
-			ui_browser__set_percent_color(arg->b, percent,
+			ui_browser__set_percent_color(&arg->hb->b, percent,
 						      arg->current_entry);
 			ret += scnprintf(hpp->buf, hpp->size,
 					 " %6.2f%%", percent);
@@ -657,7 +657,7 @@ static int __hpp__color_fmt(struct perf_hpp *hpp, struct hist_entry *he,
 			/*
 			 * zero-fill group members at last which have no sample
 			 */
-			ui_browser__set_percent_color(arg->b, 0.0,
+			ui_browser__set_percent_color(&arg->hb->b, 0.0,
 						      arg->current_entry);
 			ret += scnprintf(hpp->buf, hpp->size,
 					 " %6.2f%%", 0.0);
@@ -665,8 +665,8 @@ static int __hpp__color_fmt(struct perf_hpp *hpp, struct hist_entry *he,
 		}
 	}
 out:
-	if (!arg->current_entry || !arg->b->navkeypressed)
-		ui_browser__set_color(arg->b, HE_COLORSET_NORMAL);
+	if (!arg->current_entry || !arg->hb->b.navkeypressed)
+		ui_browser__set_color(&arg->hb->b, HE_COLORSET_NORMAL);
 
 	return ret;
 }
@@ -751,7 +751,7 @@ static int hist_browser__show_entry(struct hist_browser *browser,
 
 	if (row_offset == 0) {
 		struct hpp_arg arg = {
-			.b 		= &browser->b,
+			.hb		= browser,
 			.folded_sign	= folded_sign,
 			.current_entry	= current_entry,
 		};
-- 
1.8.3.1

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