* [PATCH v1] perf c2c: Use stdio interface if slang is not supported
@ 2022-05-26 14:39 Leo Yan
2022-05-26 14:55 ` Leo Yan
0 siblings, 1 reply; 2+ messages in thread
From: Leo Yan @ 2022-05-26 14:39 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
Joe Mario, linux-perf-users, linux-kernel
Cc: Leo Yan
If slang lib is not installed on the system, perf c2c tool disables
TUI mode and roll back to use stdio mode; but the flag 'c2c.use_stdio'
is missed to set true and thus it wrongly applies UI quirks in the
function ui_quirks().
This commit forces to use stdio interface if slang is not supported,
and it can avoid to apply the UI quirks and show the correct metric
header.
Before:
=================================================
Shared Cache Line Distribution Pareto
=================================================
-------------------------------------------------------------------------------
0 0 0 99 0 0 0 0xaaaac17d6000
-------------------------------------------------------------------------------
0.00% 0.00% 6.06% 0.00% 0.00% 0.00% 0x20 N/A 0 0xaaaac17c25ac 0 0 43 375 18469 2 [.] 0x00000000000025ac memstress memstress[25ac] 0
0.00% 0.00% 93.94% 0.00% 0.00% 0.00% 0x29 N/A 0 0xaaaac17c3e88 0 0 173 180 135 2 [.] 0x0000000000003e88 memstress memstress[3e88] 0
After:
=================================================
Shared Cache Line Distribution Pareto
=================================================
-------------------------------------------------------------------------------
0 0 0 99 0 0 0 0xaaaac17d6000
-------------------------------------------------------------------------------
0.00% 0.00% 6.06% 0.00% 0.00% 0.00% 0x20 N/A 0 0xaaaac17c25ac 0 0 43 375 18469 2 [.] 0x00000000000025ac memstress memstress[25ac] 0
0.00% 0.00% 93.94% 0.00% 0.00% 0.00% 0x29 N/A 0 0xaaaac17c3e88 0 0 173 180 135 2 [.] 0x0000000000003e88 memstress memstress[3e88] 0
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
tools/perf/builtin-c2c.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 042431b7b6ba..42eb5cf95816 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -2926,9 +2926,7 @@ static int perf_c2c__report(int argc, const char **argv)
"the input file to process"),
OPT_INCR('N', "node-info", &c2c.node_info,
"show extra node info in report (repeat for more info)"),
-#ifdef HAVE_SLANG_SUPPORT
OPT_BOOLEAN(0, "stdio", &c2c.use_stdio, "Use the stdio interface"),
-#endif
OPT_BOOLEAN(0, "stats", &c2c.stats_only,
"Display only statistic tables (implies --stdio)"),
OPT_BOOLEAN(0, "full-symbols", &c2c.symbol_full,
@@ -2958,6 +2956,10 @@ static int perf_c2c__report(int argc, const char **argv)
if (argc)
usage_with_options(report_c2c_usage, options);
+#ifndef HAVE_SLANG_SUPPORT
+ c2c.use_stdio = true;
+#endif
+
if (c2c.stats_only)
c2c.use_stdio = true;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1] perf c2c: Use stdio interface if slang is not supported
2022-05-26 14:39 [PATCH v1] perf c2c: Use stdio interface if slang is not supported Leo Yan
@ 2022-05-26 14:55 ` Leo Yan
0 siblings, 0 replies; 2+ messages in thread
From: Leo Yan @ 2022-05-26 14:55 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
Joe Mario, linux-perf-users, linux-kernel
On Thu, May 26, 2022 at 10:39:17PM +0800, Leo Yan wrote:
> If slang lib is not installed on the system, perf c2c tool disables
> TUI mode and roll back to use stdio mode; but the flag 'c2c.use_stdio'
> is missed to set true and thus it wrongly applies UI quirks in the
> function ui_quirks().
Have sent out v2 for adding fixes and reported tags. Sorry for
spamming.
Leo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-26 14:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-26 14:39 [PATCH v1] perf c2c: Use stdio interface if slang is not supported Leo Yan
2022-05-26 14:55 ` Leo Yan
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.