Skip to content

Commit 22af969

Browse files
namhyungolsajiri
authored andcommitted
perf tools: Call perf_hpp__init() before setting up GUI browsers
So that it can be set properly prior to set up output fields. That makes easy to handle/warn errors during the setup since it doesn't need to be bothered with the GUI. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1400480762-22852-11-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
1 parent 512ae1b commit 22af969

5 files changed

Lines changed: 5 additions & 9 deletions

File tree

‎tools/perf/builtin-report.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,16 +823,16 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
823823
goto error;
824824
}
825825

826+
perf_hpp__init();
827+
826828
/* Force tty output for header output. */
827829
if (report.header || report.header_only)
828830
use_browser = 0;
829831

830832
if (strcmp(input_name, "-") != 0)
831833
setup_browser(true);
832-
else {
834+
else
833835
use_browser = 0;
834-
perf_hpp__init();
835-
}
836836

837837
if (report.header || report.header_only) {
838838
perf_session__fprintf_info(session, stdout,

‎tools/perf/builtin-top.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
11471147
/* display thread wants entries to be collapsed in a different tree */
11481148
sort__need_collapse = 1;
11491149

1150+
perf_hpp__init();
1151+
11501152
if (top.use_stdio)
11511153
use_browser = 0;
11521154
else if (top.use_tui)

‎tools/perf/ui/browsers/hists.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,8 +661,6 @@ __HPP_COLOR_PERCENT_FN(overhead_guest_us, period_guest_us)
661661

662662
void hist_browser__init_hpp(void)
663663
{
664-
perf_hpp__init();
665-
666664
perf_hpp__format[PERF_HPP__OVERHEAD].color =
667665
hist_browser__hpp_color_overhead;
668666
perf_hpp__format[PERF_HPP__OVERHEAD_SYS].color =

‎tools/perf/ui/gtk/hists.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ __HPP_COLOR_PERCENT_FN(overhead_guest_us, period_guest_us)
5858

5959
void perf_gtk__init_hpp(void)
6060
{
61-
perf_hpp__init();
62-
6361
perf_hpp__format[PERF_HPP__OVERHEAD].color =
6462
perf_gtk__hpp_color_overhead;
6563
perf_hpp__format[PERF_HPP__OVERHEAD_SYS].color =

‎tools/perf/ui/setup.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ void setup_browser(bool fallback_to_pager)
8686
use_browser = 0;
8787
if (fallback_to_pager)
8888
setup_pager();
89-
90-
perf_hpp__init();
9189
break;
9290
}
9391
}

0 commit comments

Comments
 (0)