Skip to contentSkip to conversation

perf tools: set browser mode right before setup_browser()

PATCH New Seokho Song 2 participants 2 messages Dec 4, 2017 – Dec 6, 2017 perf events

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 perf tools: set browser mode right before setup_browser()

There are codes that print messages to the screen between assignment of the use_browser variable and setup_browser().

But since the GUI browser is not initialized during that period, all messages fail to show if the user passed the --gtk option to perf as GTK is not initialized yet.

Reorder the code to assign use_browser variable right before setup_browser() is called.

---
 tools/perf/builtin-report.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
tools/perf/builtin-report.c +7 -7
index 1394cd8d96f7..c763390084b9 100644
@@ -918,13 +918,6 @@ int cmd_report(int argc, const char **argv)
 		return -EINVAL;
 	}
 
-	if (report.use_stdio)
-		use_browser = 0;
-	else if (report.use_tui)
-		use_browser = 1;
-	else if (report.use_gtk)
-		use_browser = 2;
-
 	if (report.inverted_callchain)
 		callchain_param.order = ORDER_CALLER;
 	if (symbol_conf.cumulate_callchain && !callchain_param.order_set)
@@ -1011,6 +1004,13 @@ int cmd_report(int argc, const char **argv)
 		perf_hpp_list.need_collapse = true;
 	}
 
+	if (report.use_stdio)
+		use_browser = 0;
+	else if (report.use_tui)
+		use_browser = 1;
+	else if (report.use_gtk)
+		use_browser = 2;
+
 	/* Force tty output for header output and per-thread stat. */
 	if (report.header || report.header_only || report.show_threads)
 		use_browser = 0;
Signature · 1 line
2.15.1
#1 lore raw

[tip:perf/core] perf report: Set browser mode right before setup_browser()

perf report: Set browser mode right before setup_browser()
Commit-ID:  712d36db5a5c57eb79e962a0f9b85964640e8415
Gitweb:     https://git.kernel.org/tip/712d36db5a5c57eb79e962a0f9b85964640e8415
Author:     Seokho Song <[email protected]>
AuthorDate: Tue, 5 Dec 2017 01:02:44 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 5 Dec 2017 15:43:56 -0300

perf report: Set browser mode right before setup_browser()

There are codes that print messages to the screen between assignment of the use_browser variable and setup_browser().

But since the GUI browser is not initialized during that period, all messages fail to show if the user passed the --gtk option to perf as GTK is not initialized yet.

Reorder the code to assign use_browser variable right before setup_browser() is called.

---
 tools/perf/builtin-report.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
tools/perf/builtin-report.c +7 -7
index af5dd03..eb9ce63 100644
@@ -921,13 +921,6 @@ int cmd_report(int argc, const char **argv)
 		return -EINVAL;
 	}
 
-	if (report.use_stdio)
-		use_browser = 0;
-	else if (report.use_tui)
-		use_browser = 1;
-	else if (report.use_gtk)
-		use_browser = 2;
-
 	if (report.inverted_callchain)
 		callchain_param.order = ORDER_CALLER;
 	if (symbol_conf.cumulate_callchain && !callchain_param.order_set)
@@ -1014,6 +1007,13 @@ repeat:
 		perf_hpp_list.need_collapse = true;
 	}
 
+	if (report.use_stdio)
+		use_browser = 0;
+	else if (report.use_tui)
+		use_browser = 1;
+	else if (report.use_gtk)
+		use_browser = 2;
+
 	/* Force tty output for header output and per-thread stat. */
 	if (report.header || report.header_only || report.show_threads)
 		use_browser = 0;