aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2016-06-14 14:19:19 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-06-15 09:49:18 -0400
commit053721736011ee52e83b8e8794d922d1c511a4d3 (patch)
tree1049064003f9eb6f777aca31981a44bed11884ea /tools/perf/ui
parentd05e3aaeea56d7cd23976cb1fa626faf1a8bfbed (diff)
perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback
Replacing perf_evsel arg perf_hpp_fmt's header callback with hists object. None of the actual callbacks actually use evsel object, also this will be helpful in future for non evsel related hist browsers. Signed-off-by: Jiri 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/1465928361-2442-10-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui')
-rw-r--r--tools/perf/ui/browsers/hists.c6
-rw-r--r--tools/perf/ui/gtk/hists.c2
-rw-r--r--tools/perf/ui/hist.c4
-rw-r--r--tools/perf/ui/stdio/hist.c6
4 files changed, 9 insertions, 9 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index e21ea52da164..c20425d7d9ae 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1531,7 +1531,7 @@ static int hists_browser__scnprintf_headers(struct hist_browser *browser, char *
1531 if (perf_hpp__should_skip(fmt, hists) || column++ < browser->b.horiz_scroll) 1531 if (perf_hpp__should_skip(fmt, hists) || column++ < browser->b.horiz_scroll)
1532 continue; 1532 continue;
1533 1533
1534 ret = fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists)); 1534 ret = fmt->header(fmt, &dummy_hpp, hists);
1535 if (advance_hpp_check(&dummy_hpp, ret)) 1535 if (advance_hpp_check(&dummy_hpp, ret))
1536 break; 1536 break;
1537 1537
@@ -1568,7 +1568,7 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows
1568 if (column++ < browser->b.horiz_scroll) 1568 if (column++ < browser->b.horiz_scroll)
1569 continue; 1569 continue;
1570 1570
1571 ret = fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists)); 1571 ret = fmt->header(fmt, &dummy_hpp, hists);
1572 if (advance_hpp_check(&dummy_hpp, ret)) 1572 if (advance_hpp_check(&dummy_hpp, ret))
1573 break; 1573 break;
1574 1574
@@ -1605,7 +1605,7 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows
1605 } 1605 }
1606 first_col = false; 1606 first_col = false;
1607 1607
1608 ret = fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists)); 1608 ret = fmt->header(fmt, &dummy_hpp, hists);
1609 dummy_hpp.buf[ret] = '\0'; 1609 dummy_hpp.buf[ret] = '\0';
1610 1610
1611 start = trim(dummy_hpp.buf); 1611 start = trim(dummy_hpp.buf);
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index 932adfaa05af..e5c1325b0340 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -549,7 +549,7 @@ static void perf_gtk__show_hierarchy(GtkWidget *window, struct hists *hists,
549 strcat(buf, "+"); 549 strcat(buf, "+");
550 first_col = false; 550 first_col = false;
551 551
552 fmt->header(fmt, &hpp, hists_to_evsel(hists)); 552 fmt->header(fmt, &hpp, hists);
553 strcat(buf, ltrim(rtrim(hpp.buf))); 553 strcat(buf, ltrim(rtrim(hpp.buf)));
554 } 554 }
555 } 555 }
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index af07ffb129ca..0b232d61310c 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -229,9 +229,9 @@ static int hpp__width_fn(struct perf_hpp_fmt *fmt,
229} 229}
230 230
231static int hpp__header_fn(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, 231static int hpp__header_fn(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
232 struct perf_evsel *evsel) 232 struct hists *hists)
233{ 233{
234 int len = hpp__width_fn(fmt, hpp, evsel); 234 int len = hpp__width_fn(fmt, hpp, hists_to_evsel(hists));
235 return scnprintf(hpp->buf, hpp->size, "%*s", len, fmt->name); 235 return scnprintf(hpp->buf, hpp->size, "%*s", len, fmt->name);
236} 236}
237 237
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index 9a972cb00458..d0534fac46ae 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -549,7 +549,7 @@ static int print_hierarchy_header(struct hists *hists, struct perf_hpp *hpp,
549 struct perf_hpp_list_node, list); 549 struct perf_hpp_list_node, list);
550 550
551 perf_hpp_list__for_each_format(&fmt_node->hpp, fmt) { 551 perf_hpp_list__for_each_format(&fmt_node->hpp, fmt) {
552 fmt->header(fmt, hpp, hists_to_evsel(hists)); 552 fmt->header(fmt, hpp, hists);
553 fprintf(fp, "%s%s", hpp->buf, sep ?: " "); 553 fprintf(fp, "%s%s", hpp->buf, sep ?: " ");
554 } 554 }
555 555
@@ -569,7 +569,7 @@ static int print_hierarchy_header(struct hists *hists, struct perf_hpp *hpp,
569 header_width += fprintf(fp, "+"); 569 header_width += fprintf(fp, "+");
570 first_col = false; 570 first_col = false;
571 571
572 fmt->header(fmt, hpp, hists_to_evsel(hists)); 572 fmt->header(fmt, hpp, hists);
573 573
574 header_width += fprintf(fp, "%s", trim(hpp->buf)); 574 header_width += fprintf(fp, "%s", trim(hpp->buf));
575 } 575 }
@@ -658,7 +658,7 @@ hists__fprintf_standard_headers(struct hists *hists,
658 else 658 else
659 first = false; 659 first = false;
660 660
661 fmt->header(fmt, hpp, hists_to_evsel(hists)); 661 fmt->header(fmt, hpp, hists);
662 fprintf(fp, "%s", hpp->buf); 662 fprintf(fp, "%s", hpp->buf);
663 } 663 }
664 664