All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] perf tui: Only support --tui with slang
@ 2022-01-23 19:18 Ian Rogers
  2022-01-23 19:18 ` [PATCH 2/2] perf gtk: Only support --gtk if compiled in Ian Rogers
  2022-01-23 21:49 ` [PATCH 1/2] perf tui: Only support --tui with slang xaizek
  0 siblings, 2 replies; 4+ messages in thread
From: Ian Rogers @ 2022-01-23 19:18 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim, xaizek,
	linux-perf-users, linux-kernel
  Cc: Ian Rogers

Make the --tui command line flags dependent HAVE_SLANG_SUPPORT. This was
reported as confusing in:
https://lore.kernel.org/linux-perf-users/YevaTkzdXmFKdGpc@zx-spectrum.none/

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/builtin-annotate.c | 10 +++++++++-
 tools/perf/builtin-report.c   | 10 +++++++++-
 tools/perf/builtin-top.c      |  4 ++++
 tools/perf/util/top.h         |  5 ++++-
 4 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 490bb9b8cf17..5e038d9bab05 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -46,7 +46,11 @@ struct perf_annotate {
 	struct perf_tool tool;
 	struct perf_session *session;
 	struct annotation_options opts;
-	bool	   use_tui, use_stdio, use_stdio2, use_gtk;
+#ifdef HAVE_SLANG_SUPPORT
+	bool	   use_tui;
+#endif
+	bool	   use_stdio, use_stdio2;
+	bool	   use_gtk;
 	bool	   skip_missing;
 	bool	   has_br_stack;
 	bool	   group_set;
@@ -503,7 +507,9 @@ int cmd_annotate(int argc, const char **argv)
 	OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
 		    "dump raw trace in ASCII"),
 	OPT_BOOLEAN(0, "gtk", &annotate.use_gtk, "Use the GTK interface"),
+#ifdef HAVE_SLANG_SUPPORT
 	OPT_BOOLEAN(0, "tui", &annotate.use_tui, "Use the TUI interface"),
+#endif
 	OPT_BOOLEAN(0, "stdio", &annotate.use_stdio, "Use the stdio interface"),
 	OPT_BOOLEAN(0, "stdio2", &annotate.use_stdio2, "Use the stdio interface"),
 	OPT_BOOLEAN(0, "ignore-vmlinux", &symbol_conf.ignore_vmlinux,
@@ -624,8 +630,10 @@ int cmd_annotate(int argc, const char **argv)
 
 	if (annotate.use_stdio || annotate.use_stdio2)
 		use_browser = 0;
+#ifdef HAVE_SLANG_SUPPORT
 	else if (annotate.use_tui)
 		use_browser = 1;
+#endif
 	else if (annotate.use_gtk)
 		use_browser = 2;
 
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 1dd92d8c9279..1ad75c7ba074 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -71,7 +71,11 @@ struct report {
 	struct perf_tool	tool;
 	struct perf_session	*session;
 	struct evswitch		evswitch;
-	bool			use_tui, use_gtk, use_stdio;
+#ifdef HAVE_SLANG_SUPPORT
+	bool			use_tui;
+#endif
+	bool			use_gtk;
+	bool			use_stdio;
 	bool			show_full_info;
 	bool			show_threads;
 	bool			inverted_callchain;
@@ -1206,7 +1210,9 @@ int cmd_report(int argc, const char **argv)
 		    "Show per-thread event counters"),
 	OPT_STRING(0, "pretty", &report.pretty_printing_style, "key",
 		   "pretty printing style key: normal raw"),
+#ifdef HAVE_SLANG_SUPPORT
 	OPT_BOOLEAN(0, "tui", &report.use_tui, "Use the TUI interface"),
+#endif
 	OPT_BOOLEAN(0, "gtk", &report.use_gtk, "Use the GTK2 interface"),
 	OPT_BOOLEAN(0, "stdio", &report.use_stdio,
 		    "Use the stdio interface"),
@@ -1492,8 +1498,10 @@ int cmd_report(int argc, const char **argv)
 
 	if (report.use_stdio)
 		use_browser = 0;
+#ifdef HAVE_SLANG_SUPPORT
 	else if (report.use_tui)
 		use_browser = 1;
+#endif
 	else if (report.use_gtk)
 		use_browser = 2;
 
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 1fc390f136dd..e1a134a0a377 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1486,7 +1486,9 @@ int cmd_top(int argc, const char **argv)
 		    "display this many functions"),
 	OPT_BOOLEAN('U', "hide_user_symbols", &top.hide_user_symbols,
 		    "hide user symbols"),
+#ifdef HAVE_SLANG_SUPPORT
 	OPT_BOOLEAN(0, "tui", &top.use_tui, "Use the TUI interface"),
+#endif
 	OPT_BOOLEAN(0, "stdio", &top.use_stdio, "Use the stdio interface"),
 	OPT_INCR('v', "verbose", &verbose,
 		    "be more verbose (show counter open errors, etc)"),
@@ -1667,8 +1669,10 @@ int cmd_top(int argc, const char **argv)
 
 	if (top.use_stdio)
 		use_browser = 0;
+#ifdef HAVE_SLANG_SUPPORT
 	else if (top.use_tui)
 		use_browser = 1;
+#endif
 
 	setup_browser(false);
 
diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h
index ff8391208ecd..1c2c0a838430 100644
--- a/tools/perf/util/top.h
+++ b/tools/perf/util/top.h
@@ -33,7 +33,10 @@ struct perf_top {
 	int		   print_entries, count_filter, delay_secs;
 	int		   max_stack;
 	bool		   hide_kernel_symbols, hide_user_symbols, zero;
-	bool		   use_tui, use_stdio;
+#ifdef HAVE_SLANG_SUPPORT
+	bool		   use_tui;
+#endif
+	bool		   use_stdio;
 	bool		   vmlinux_warned;
 	bool		   dump_symtab;
 	bool		   stitch_lbr;
-- 
2.35.0.rc0.227.g00780c9af4-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] perf gtk: Only support --gtk if compiled in
  2022-01-23 19:18 [PATCH 1/2] perf tui: Only support --tui with slang Ian Rogers
@ 2022-01-23 19:18 ` Ian Rogers
  2022-01-23 21:49 ` [PATCH 1/2] perf tui: Only support --tui with slang xaizek
  1 sibling, 0 replies; 4+ messages in thread
From: Ian Rogers @ 2022-01-23 19:18 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim, xaizek,
	linux-perf-users, linux-kernel
  Cc: Ian Rogers

If HAVE_GTK2_SUPPORT isn't defined then --gtk can't succeed, don't
support it as a command line option in this case.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/builtin-annotate.c | 8 ++++++++
 tools/perf/builtin-report.c   | 6 ++++++
 2 files changed, 14 insertions(+)

diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 5e038d9bab05..7664e54bb785 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -50,7 +50,9 @@ struct perf_annotate {
 	bool	   use_tui;
 #endif
 	bool	   use_stdio, use_stdio2;
+#ifdef HAVE_GTK2_SUPPORT
 	bool	   use_gtk;
+#endif
 	bool	   skip_missing;
 	bool	   has_br_stack;
 	bool	   group_set;
@@ -506,7 +508,9 @@ int cmd_annotate(int argc, const char **argv)
 	OPT_BOOLEAN('q', "quiet", &quiet, "do now show any message"),
 	OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
 		    "dump raw trace in ASCII"),
+#ifdef HAVE_GTK2_SUPPORT
 	OPT_BOOLEAN(0, "gtk", &annotate.use_gtk, "Use the GTK interface"),
+#endif
 #ifdef HAVE_SLANG_SUPPORT
 	OPT_BOOLEAN(0, "tui", &annotate.use_tui, "Use the TUI interface"),
 #endif
@@ -592,10 +596,12 @@ int cmd_annotate(int argc, const char **argv)
 	if (annotate_check_args(&annotate.opts) < 0)
 		return -EINVAL;
 
+#ifdef HAVE_GTK2_SUPPORT
 	if (symbol_conf.show_nr_samples && annotate.use_gtk) {
 		pr_err("--show-nr-samples is not available in --gtk mode at this time\n");
 		return ret;
 	}
+#endif
 
 	ret = symbol__validate_sym_arguments();
 	if (ret)
@@ -634,8 +640,10 @@ int cmd_annotate(int argc, const char **argv)
 	else if (annotate.use_tui)
 		use_browser = 1;
 #endif
+#ifdef HAVE_GTK2_SUPPORT
 	else if (annotate.use_gtk)
 		use_browser = 2;
+#endif
 
 	setup_browser(true);
 
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 1ad75c7ba074..b325d180293d 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -74,7 +74,9 @@ struct report {
 #ifdef HAVE_SLANG_SUPPORT
 	bool			use_tui;
 #endif
+#ifdef HAVE_GTK2_SUPPORT
 	bool			use_gtk;
+#endif
 	bool			use_stdio;
 	bool			show_full_info;
 	bool			show_threads;
@@ -1213,7 +1215,9 @@ int cmd_report(int argc, const char **argv)
 #ifdef HAVE_SLANG_SUPPORT
 	OPT_BOOLEAN(0, "tui", &report.use_tui, "Use the TUI interface"),
 #endif
+#ifdef HAVE_GTK2_SUPPORT
 	OPT_BOOLEAN(0, "gtk", &report.use_gtk, "Use the GTK2 interface"),
+#endif
 	OPT_BOOLEAN(0, "stdio", &report.use_stdio,
 		    "Use the stdio interface"),
 	OPT_BOOLEAN(0, "header", &report.header, "Show data header."),
@@ -1502,8 +1506,10 @@ int cmd_report(int argc, const char **argv)
 	else if (report.use_tui)
 		use_browser = 1;
 #endif
+#ifdef HAVE_GTK2_SUPPORT
 	else if (report.use_gtk)
 		use_browser = 2;
+#endif
 
 	/* Force tty output for header output and per-thread stat. */
 	if (report.header || report.header_only || report.show_threads)
-- 
2.35.0.rc0.227.g00780c9af4-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] perf tui: Only support --tui with slang
  2022-01-23 19:18 [PATCH 1/2] perf tui: Only support --tui with slang Ian Rogers
  2022-01-23 19:18 ` [PATCH 2/2] perf gtk: Only support --gtk if compiled in Ian Rogers
@ 2022-01-23 21:49 ` xaizek
  2022-02-15 14:29   ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 4+ messages in thread
From: xaizek @ 2022-01-23 21:49 UTC (permalink / raw)
  To: Ian Rogers; +Cc: linux-perf-users, linux-kernel

Thank you, Ian.  The patch works as expected on 5.15.12 (--gtk patch
didn't apply on this revision).

Regards,
xaizek

On Sun, Jan 23, 2022 at 11:18:48AM -0800, Ian Rogers wrote:
> Make the --tui command line flags dependent HAVE_SLANG_SUPPORT. This was
> reported as confusing in:
> https://lore.kernel.org/linux-perf-users/YevaTkzdXmFKdGpc@zx-spectrum.none/
> 
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
>  tools/perf/builtin-annotate.c | 10 +++++++++-
>  tools/perf/builtin-report.c   | 10 +++++++++-
>  tools/perf/builtin-top.c      |  4 ++++
>  tools/perf/util/top.h         |  5 ++++-
>  4 files changed, 26 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
> index 490bb9b8cf17..5e038d9bab05 100644
> --- a/tools/perf/builtin-annotate.c
> +++ b/tools/perf/builtin-annotate.c
> @@ -46,7 +46,11 @@ struct perf_annotate {
>  	struct perf_tool tool;
>  	struct perf_session *session;
>  	struct annotation_options opts;
> -	bool	   use_tui, use_stdio, use_stdio2, use_gtk;
> +#ifdef HAVE_SLANG_SUPPORT
> +	bool	   use_tui;
> +#endif
> +	bool	   use_stdio, use_stdio2;
> +	bool	   use_gtk;
>  	bool	   skip_missing;
>  	bool	   has_br_stack;
>  	bool	   group_set;
> @@ -503,7 +507,9 @@ int cmd_annotate(int argc, const char **argv)
>  	OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
>  		    "dump raw trace in ASCII"),
>  	OPT_BOOLEAN(0, "gtk", &annotate.use_gtk, "Use the GTK interface"),
> +#ifdef HAVE_SLANG_SUPPORT
>  	OPT_BOOLEAN(0, "tui", &annotate.use_tui, "Use the TUI interface"),
> +#endif
>  	OPT_BOOLEAN(0, "stdio", &annotate.use_stdio, "Use the stdio interface"),
>  	OPT_BOOLEAN(0, "stdio2", &annotate.use_stdio2, "Use the stdio interface"),
>  	OPT_BOOLEAN(0, "ignore-vmlinux", &symbol_conf.ignore_vmlinux,
> @@ -624,8 +630,10 @@ int cmd_annotate(int argc, const char **argv)
>  
>  	if (annotate.use_stdio || annotate.use_stdio2)
>  		use_browser = 0;
> +#ifdef HAVE_SLANG_SUPPORT
>  	else if (annotate.use_tui)
>  		use_browser = 1;
> +#endif
>  	else if (annotate.use_gtk)
>  		use_browser = 2;
>  
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index 1dd92d8c9279..1ad75c7ba074 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -71,7 +71,11 @@ struct report {
>  	struct perf_tool	tool;
>  	struct perf_session	*session;
>  	struct evswitch		evswitch;
> -	bool			use_tui, use_gtk, use_stdio;
> +#ifdef HAVE_SLANG_SUPPORT
> +	bool			use_tui;
> +#endif
> +	bool			use_gtk;
> +	bool			use_stdio;
>  	bool			show_full_info;
>  	bool			show_threads;
>  	bool			inverted_callchain;
> @@ -1206,7 +1210,9 @@ int cmd_report(int argc, const char **argv)
>  		    "Show per-thread event counters"),
>  	OPT_STRING(0, "pretty", &report.pretty_printing_style, "key",
>  		   "pretty printing style key: normal raw"),
> +#ifdef HAVE_SLANG_SUPPORT
>  	OPT_BOOLEAN(0, "tui", &report.use_tui, "Use the TUI interface"),
> +#endif
>  	OPT_BOOLEAN(0, "gtk", &report.use_gtk, "Use the GTK2 interface"),
>  	OPT_BOOLEAN(0, "stdio", &report.use_stdio,
>  		    "Use the stdio interface"),
> @@ -1492,8 +1498,10 @@ int cmd_report(int argc, const char **argv)
>  
>  	if (report.use_stdio)
>  		use_browser = 0;
> +#ifdef HAVE_SLANG_SUPPORT
>  	else if (report.use_tui)
>  		use_browser = 1;
> +#endif
>  	else if (report.use_gtk)
>  		use_browser = 2;
>  
> diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
> index 1fc390f136dd..e1a134a0a377 100644
> --- a/tools/perf/builtin-top.c
> +++ b/tools/perf/builtin-top.c
> @@ -1486,7 +1486,9 @@ int cmd_top(int argc, const char **argv)
>  		    "display this many functions"),
>  	OPT_BOOLEAN('U', "hide_user_symbols", &top.hide_user_symbols,
>  		    "hide user symbols"),
> +#ifdef HAVE_SLANG_SUPPORT
>  	OPT_BOOLEAN(0, "tui", &top.use_tui, "Use the TUI interface"),
> +#endif
>  	OPT_BOOLEAN(0, "stdio", &top.use_stdio, "Use the stdio interface"),
>  	OPT_INCR('v', "verbose", &verbose,
>  		    "be more verbose (show counter open errors, etc)"),
> @@ -1667,8 +1669,10 @@ int cmd_top(int argc, const char **argv)
>  
>  	if (top.use_stdio)
>  		use_browser = 0;
> +#ifdef HAVE_SLANG_SUPPORT
>  	else if (top.use_tui)
>  		use_browser = 1;
> +#endif
>  
>  	setup_browser(false);
>  
> diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h
> index ff8391208ecd..1c2c0a838430 100644
> --- a/tools/perf/util/top.h
> +++ b/tools/perf/util/top.h
> @@ -33,7 +33,10 @@ struct perf_top {
>  	int		   print_entries, count_filter, delay_secs;
>  	int		   max_stack;
>  	bool		   hide_kernel_symbols, hide_user_symbols, zero;
> -	bool		   use_tui, use_stdio;
> +#ifdef HAVE_SLANG_SUPPORT
> +	bool		   use_tui;
> +#endif
> +	bool		   use_stdio;
>  	bool		   vmlinux_warned;
>  	bool		   dump_symtab;
>  	bool		   stitch_lbr;
> -- 
> 2.35.0.rc0.227.g00780c9af4-goog

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] perf tui: Only support --tui with slang
  2022-01-23 21:49 ` [PATCH 1/2] perf tui: Only support --tui with slang xaizek
@ 2022-02-15 14:29   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-02-15 14:29 UTC (permalink / raw)
  To: xaizek; +Cc: Ian Rogers, linux-perf-users, linux-kernel

Em Sun, Jan 23, 2022 at 09:49:01PM +0000, xaizek escreveu:
> Thank you, Ian.  The patch works as expected on 5.15.12 (--gtk patch
> didn't apply on this revision).

Thanks, applied and added a Reported-by + Tested-by: xaizek.

- Arnaldo
 
> Regards,
> xaizek
> 
> On Sun, Jan 23, 2022 at 11:18:48AM -0800, Ian Rogers wrote:
> > Make the --tui command line flags dependent HAVE_SLANG_SUPPORT. This was
> > reported as confusing in:
> > https://lore.kernel.org/linux-perf-users/YevaTkzdXmFKdGpc@zx-spectrum.none/
> > 
> > Signed-off-by: Ian Rogers <irogers@google.com>
> > ---
> >  tools/perf/builtin-annotate.c | 10 +++++++++-
> >  tools/perf/builtin-report.c   | 10 +++++++++-
> >  tools/perf/builtin-top.c      |  4 ++++
> >  tools/perf/util/top.h         |  5 ++++-
> >  4 files changed, 26 insertions(+), 3 deletions(-)
> > 
> > diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
> > index 490bb9b8cf17..5e038d9bab05 100644
> > --- a/tools/perf/builtin-annotate.c
> > +++ b/tools/perf/builtin-annotate.c
> > @@ -46,7 +46,11 @@ struct perf_annotate {
> >  	struct perf_tool tool;
> >  	struct perf_session *session;
> >  	struct annotation_options opts;
> > -	bool	   use_tui, use_stdio, use_stdio2, use_gtk;
> > +#ifdef HAVE_SLANG_SUPPORT
> > +	bool	   use_tui;
> > +#endif
> > +	bool	   use_stdio, use_stdio2;
> > +	bool	   use_gtk;
> >  	bool	   skip_missing;
> >  	bool	   has_br_stack;
> >  	bool	   group_set;
> > @@ -503,7 +507,9 @@ int cmd_annotate(int argc, const char **argv)
> >  	OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
> >  		    "dump raw trace in ASCII"),
> >  	OPT_BOOLEAN(0, "gtk", &annotate.use_gtk, "Use the GTK interface"),
> > +#ifdef HAVE_SLANG_SUPPORT
> >  	OPT_BOOLEAN(0, "tui", &annotate.use_tui, "Use the TUI interface"),
> > +#endif
> >  	OPT_BOOLEAN(0, "stdio", &annotate.use_stdio, "Use the stdio interface"),
> >  	OPT_BOOLEAN(0, "stdio2", &annotate.use_stdio2, "Use the stdio interface"),
> >  	OPT_BOOLEAN(0, "ignore-vmlinux", &symbol_conf.ignore_vmlinux,
> > @@ -624,8 +630,10 @@ int cmd_annotate(int argc, const char **argv)
> >  
> >  	if (annotate.use_stdio || annotate.use_stdio2)
> >  		use_browser = 0;
> > +#ifdef HAVE_SLANG_SUPPORT
> >  	else if (annotate.use_tui)
> >  		use_browser = 1;
> > +#endif
> >  	else if (annotate.use_gtk)
> >  		use_browser = 2;
> >  
> > diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> > index 1dd92d8c9279..1ad75c7ba074 100644
> > --- a/tools/perf/builtin-report.c
> > +++ b/tools/perf/builtin-report.c
> > @@ -71,7 +71,11 @@ struct report {
> >  	struct perf_tool	tool;
> >  	struct perf_session	*session;
> >  	struct evswitch		evswitch;
> > -	bool			use_tui, use_gtk, use_stdio;
> > +#ifdef HAVE_SLANG_SUPPORT
> > +	bool			use_tui;
> > +#endif
> > +	bool			use_gtk;
> > +	bool			use_stdio;
> >  	bool			show_full_info;
> >  	bool			show_threads;
> >  	bool			inverted_callchain;
> > @@ -1206,7 +1210,9 @@ int cmd_report(int argc, const char **argv)
> >  		    "Show per-thread event counters"),
> >  	OPT_STRING(0, "pretty", &report.pretty_printing_style, "key",
> >  		   "pretty printing style key: normal raw"),
> > +#ifdef HAVE_SLANG_SUPPORT
> >  	OPT_BOOLEAN(0, "tui", &report.use_tui, "Use the TUI interface"),
> > +#endif
> >  	OPT_BOOLEAN(0, "gtk", &report.use_gtk, "Use the GTK2 interface"),
> >  	OPT_BOOLEAN(0, "stdio", &report.use_stdio,
> >  		    "Use the stdio interface"),
> > @@ -1492,8 +1498,10 @@ int cmd_report(int argc, const char **argv)
> >  
> >  	if (report.use_stdio)
> >  		use_browser = 0;
> > +#ifdef HAVE_SLANG_SUPPORT
> >  	else if (report.use_tui)
> >  		use_browser = 1;
> > +#endif
> >  	else if (report.use_gtk)
> >  		use_browser = 2;
> >  
> > diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
> > index 1fc390f136dd..e1a134a0a377 100644
> > --- a/tools/perf/builtin-top.c
> > +++ b/tools/perf/builtin-top.c
> > @@ -1486,7 +1486,9 @@ int cmd_top(int argc, const char **argv)
> >  		    "display this many functions"),
> >  	OPT_BOOLEAN('U', "hide_user_symbols", &top.hide_user_symbols,
> >  		    "hide user symbols"),
> > +#ifdef HAVE_SLANG_SUPPORT
> >  	OPT_BOOLEAN(0, "tui", &top.use_tui, "Use the TUI interface"),
> > +#endif
> >  	OPT_BOOLEAN(0, "stdio", &top.use_stdio, "Use the stdio interface"),
> >  	OPT_INCR('v', "verbose", &verbose,
> >  		    "be more verbose (show counter open errors, etc)"),
> > @@ -1667,8 +1669,10 @@ int cmd_top(int argc, const char **argv)
> >  
> >  	if (top.use_stdio)
> >  		use_browser = 0;
> > +#ifdef HAVE_SLANG_SUPPORT
> >  	else if (top.use_tui)
> >  		use_browser = 1;
> > +#endif
> >  
> >  	setup_browser(false);
> >  
> > diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h
> > index ff8391208ecd..1c2c0a838430 100644
> > --- a/tools/perf/util/top.h
> > +++ b/tools/perf/util/top.h
> > @@ -33,7 +33,10 @@ struct perf_top {
> >  	int		   print_entries, count_filter, delay_secs;
> >  	int		   max_stack;
> >  	bool		   hide_kernel_symbols, hide_user_symbols, zero;
> > -	bool		   use_tui, use_stdio;
> > +#ifdef HAVE_SLANG_SUPPORT
> > +	bool		   use_tui;
> > +#endif
> > +	bool		   use_stdio;
> >  	bool		   vmlinux_warned;
> >  	bool		   dump_symtab;
> >  	bool		   stitch_lbr;
> > -- 
> > 2.35.0.rc0.227.g00780c9af4-goog

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-15 14:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-23 19:18 [PATCH 1/2] perf tui: Only support --tui with slang Ian Rogers
2022-01-23 19:18 ` [PATCH 2/2] perf gtk: Only support --gtk if compiled in Ian Rogers
2022-01-23 21:49 ` [PATCH 1/2] perf tui: Only support --tui with slang xaizek
2022-02-15 14:29   ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.