提交 2e8b79e7 编写于 作者: J Jiri Olsa 提交者: Arnaldo Carvalho de Melo

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: NJiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1453109064-1026-5-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 b21a763e
...@@ -629,20 +629,12 @@ unsigned int hists__sort_list_width(struct hists *hists) ...@@ -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) void perf_hpp__reset_width(struct perf_hpp_fmt *fmt, struct hists *hists)
{ {
int idx;
if (perf_hpp__is_sort_entry(fmt)) if (perf_hpp__is_sort_entry(fmt))
return perf_hpp__reset_sort_width(fmt, hists); return perf_hpp__reset_sort_width(fmt, hists);
for (idx = 0; idx < PERF_HPP__MAX_INDEX; idx++) { BUG_ON(fmt->idx >= PERF_HPP__MAX_INDEX);
if (fmt == &perf_hpp__format[idx])
break;
}
if (idx == PERF_HPP__MAX_INDEX)
return;
switch (idx) { switch (fmt->idx) {
case PERF_HPP__OVERHEAD: case PERF_HPP__OVERHEAD:
case PERF_HPP__OVERHEAD_SYS: case PERF_HPP__OVERHEAD_SYS:
case PERF_HPP__OVERHEAD_US: case PERF_HPP__OVERHEAD_US:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册