perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback
[deliverable/linux.git] / tools / perf / ui / browsers / hists.c
index 538bae880bfee592f9ed962a4b99b7a19027c7a8..c20425d7d9ae3194d8dba63e232bfee5801af9c3 100644 (file)
@@ -1531,7 +1531,7 @@ static int hists_browser__scnprintf_headers(struct hist_browser *browser, char *
                if (perf_hpp__should_skip(fmt, hists)  || column++ < browser->b.horiz_scroll)
                        continue;
 
-               ret = fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists));
+               ret = fmt->header(fmt, &dummy_hpp, hists);
                if (advance_hpp_check(&dummy_hpp, ret))
                        break;
 
@@ -1568,7 +1568,7 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows
                if (column++ < browser->b.horiz_scroll)
                        continue;
 
-               ret = fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists));
+               ret = fmt->header(fmt, &dummy_hpp, hists);
                if (advance_hpp_check(&dummy_hpp, ret))
                        break;
 
@@ -1605,7 +1605,7 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows
                        }
                        first_col = false;
 
-                       ret = fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists));
+                       ret = fmt->header(fmt, &dummy_hpp, hists);
                        dummy_hpp.buf[ret] = '\0';
 
                        start = trim(dummy_hpp.buf);
@@ -1622,21 +1622,38 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows
        return ret;
 }
 
-static void hist_browser__show_headers(struct hist_browser *browser)
+static void hists_browser__hierarchy_headers(struct hist_browser *browser)
 {
        char headers[1024];
 
-       if (symbol_conf.report_hierarchy)
-               hists_browser__scnprintf_hierarchy_headers(browser, headers,
-                                                          sizeof(headers));
-       else
-               hists_browser__scnprintf_headers(browser, headers,
-                                                sizeof(headers));
+       hists_browser__scnprintf_hierarchy_headers(browser, headers,
+                                                  sizeof(headers));
+
        ui_browser__gotorc(&browser->b, 0, 0);
        ui_browser__set_color(&browser->b, HE_COLORSET_ROOT);
        ui_browser__write_nstring(&browser->b, headers, browser->b.width + 1);
 }
 
+static void hists_browser__headers(struct hist_browser *browser)
+{
+       char headers[1024];
+
+       hists_browser__scnprintf_headers(browser, headers,
+                                        sizeof(headers));
+
+       ui_browser__gotorc(&browser->b, 0, 0);
+       ui_browser__set_color(&browser->b, HE_COLORSET_ROOT);
+       ui_browser__write_nstring(&browser->b, headers, browser->b.width + 1);
+}
+
+static void hist_browser__show_headers(struct hist_browser *browser)
+{
+       if (symbol_conf.report_hierarchy)
+               hists_browser__hierarchy_headers(browser);
+       else
+               hists_browser__headers(browser);
+}
+
 static void ui_browser__hists_init_top(struct ui_browser *browser)
 {
        if (browser->top == NULL) {
This page took 0.025622 seconds and 5 git commands to generate.