aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/stdio
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2014-03-10 03:43:52 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-03-14 17:08:40 -0400
commit94a0793ddf7fa9890006a8dc203b985e7b120785 (patch)
tree720b78163960b35bb0d2eed1254a39cd6fefe8b4 /tools/perf/ui/stdio
parent52a3cb8cfca16db73cf825cb94325cf54da8304f (diff)
perf ui hists: Pass evsel to hpp->header/width functions explicitly
Those functions need evsel to investigate event group and it's passed via hpp->ptr. However as it can be missed easily so it's better to pass it via an argument IMHO. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1394437440-11609-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/stdio')
-rw-r--r--tools/perf/ui/stdio/hist.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index 9bad89228472..d59893edf031 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -379,7 +379,6 @@ size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
379 struct perf_hpp dummy_hpp = { 379 struct perf_hpp dummy_hpp = {
380 .buf = bf, 380 .buf = bf,
381 .size = sizeof(bf), 381 .size = sizeof(bf),
382 .ptr = hists_to_evsel(hists),
383 }; 382 };
384 bool first = true; 383 bool first = true;
385 size_t linesz; 384 size_t linesz;
@@ -398,7 +397,7 @@ size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
398 else 397 else
399 first = false; 398 first = false;
400 399
401 fmt->header(fmt, &dummy_hpp); 400 fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists));
402 fprintf(fp, "%s", bf); 401 fprintf(fp, "%s", bf);
403 } 402 }
404 403
@@ -443,7 +442,7 @@ size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
443 else 442 else
444 first = false; 443 first = false;
445 444
446 width = fmt->width(fmt, &dummy_hpp); 445 width = fmt->width(fmt, &dummy_hpp, hists_to_evsel(hists));
447 for (i = 0; i < width; i++) 446 for (i = 0; i < width; i++)
448 fprintf(fp, "."); 447 fprintf(fp, ".");
449 } 448 }