[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-2e8b79e706f504801fbce19fa9f16f3c858a105e@git.kernel.org>
Date: Thu, 4 Feb 2016 04:34:34 -0800
From: tip-bot for Jiri Olsa <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: a.p.zijlstra@...llo.nl, linux-kernel@...r.kernel.org,
acme@...hat.com, hpa@...or.com, namhyung@...nel.org,
dsahern@...il.com, mingo@...nel.org, tglx@...utronix.de,
jolsa@...nel.org
Subject: [tip:perf/core] perf hists: Use struct perf_hpp_fmt::
idx in perf_hpp__reset_width
Commit-ID: 2e8b79e706f504801fbce19fa9f16f3c858a105e
Gitweb: http://git.kernel.org/tip/2e8b79e706f504801fbce19fa9f16f3c858a105e
Author: Jiri Olsa <jolsa@...nel.org>
AuthorDate: Mon, 18 Jan 2016 10:24:02 +0100
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Wed, 3 Feb 2016 11:13:12 -0300
perf hists: Use struct perf_hpp_fmt::idx in perf_hpp__reset_width
We are going to add dynamic hpp format fields, so we need to make the
'len' change for the format itself, not in the perf_hpp__format
template.
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Cc: David Ahern <dsahern@...il.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Link: http://lkml.kernel.org/r/1453109064-1026-5-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/ui/hist.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index d392801..5a11bf0 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -629,20 +629,12 @@ unsigned int hists__sort_list_width(struct hists *hists)
void perf_hpp__reset_width(struct perf_hpp_fmt *fmt, struct hists *hists)
{
- int idx;
-
if (perf_hpp__is_sort_entry(fmt))
return perf_hpp__reset_sort_width(fmt, hists);
- for (idx = 0; idx < PERF_HPP__MAX_INDEX; idx++) {
- if (fmt == &perf_hpp__format[idx])
- break;
- }
-
- if (idx == PERF_HPP__MAX_INDEX)
- return;
+ BUG_ON(fmt->idx >= PERF_HPP__MAX_INDEX);
- switch (idx) {
+ switch (fmt->idx) {
case PERF_HPP__OVERHEAD:
case PERF_HPP__OVERHEAD_SYS:
case PERF_HPP__OVERHEAD_US:
Powered by blists - more mailing lists