diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2025-01-08 07:36:23 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-10 14:44:28 +0200 |
| commit | ef27051ba8c4f4f298d210c7d23fec1c295abbfd (patch) | |
| tree | 84c52d58f6930cc294ec46b79d7d84a8dfa55b0d /tools | |
| parent | 5947290922450a33576fee7955be6420dbbad6b2 (diff) | |
| download | linux-ef27051ba8c4f4f298d210c7d23fec1c295abbfd.tar.gz linux-ef27051ba8c4f4f298d210c7d23fec1c295abbfd.tar.bz2 linux-ef27051ba8c4f4f298d210c7d23fec1c295abbfd.zip | |
perf report: Fix input reload/switch with symbol sort key
[ Upstream commit 6353255e7cfab568058580424fa0967bf4504fe5 ]
Currently the code checks that there is no "ipc" in the sort order
and add an ipc string. This will always error out on the second pass
after input reload/switch, since the sort order already contains "ipc".
Do the ipc check/fixup only on the first pass.
Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Link: https://lore.kernel.org/r/20250108063628.215577-1-dvyukov@google.com
Fixes: ec6ae74fe8f0 ("perf report: Display average IPC and IPC coverage per symbol")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/perf/builtin-report.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index c99b14a852db..19175fe9a8b1 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -1719,22 +1719,24 @@ repeat: symbol_conf.annotate_data_sample = true; } - if (sort_order && strstr(sort_order, "ipc")) { - parse_options_usage(report_usage, options, "s", 1); - goto error; - } - - if (sort_order && strstr(sort_order, "symbol")) { - if (sort__mode == SORT_MODE__BRANCH) { - snprintf(sort_tmp, sizeof(sort_tmp), "%s,%s", - sort_order, "ipc_lbr"); - report.symbol_ipc = true; - } else { - snprintf(sort_tmp, sizeof(sort_tmp), "%s,%s", - sort_order, "ipc_null"); + if (last_key != K_SWITCH_INPUT_DATA) { + if (sort_order && strstr(sort_order, "ipc")) { + parse_options_usage(report_usage, options, "s", 1); + goto error; } - sort_order = sort_tmp; + if (sort_order && strstr(sort_order, "symbol")) { + if (sort__mode == SORT_MODE__BRANCH) { + snprintf(sort_tmp, sizeof(sort_tmp), "%s,%s", + sort_order, "ipc_lbr"); + report.symbol_ipc = true; + } else { + snprintf(sort_tmp, sizeof(sort_tmp), "%s,%s", + sort_order, "ipc_null"); + } + + sort_order = sort_tmp; + } } if ((last_key != K_SWITCH_INPUT_DATA && last_key != K_RELOAD) && |
