Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf report: Fix input reload/switch with symbol sort key

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>

authored by

Dmitry Vyukov and committed by
Namhyung Kim
6353255e acda4c20

+16 -14
+16 -14
tools/perf/builtin-report.c
··· 1758 1758 symbol_conf.enable_latency = false; 1759 1759 } 1760 1760 1761 - if (sort_order && strstr(sort_order, "ipc")) { 1762 - parse_options_usage(report_usage, options, "s", 1); 1763 - goto error; 1764 - } 1765 - 1766 - if (sort_order && strstr(sort_order, "symbol")) { 1767 - if (sort__mode == SORT_MODE__BRANCH) { 1768 - snprintf(sort_tmp, sizeof(sort_tmp), "%s,%s", 1769 - sort_order, "ipc_lbr"); 1770 - report.symbol_ipc = true; 1771 - } else { 1772 - snprintf(sort_tmp, sizeof(sort_tmp), "%s,%s", 1773 - sort_order, "ipc_null"); 1761 + if (last_key != K_SWITCH_INPUT_DATA) { 1762 + if (sort_order && strstr(sort_order, "ipc")) { 1763 + parse_options_usage(report_usage, options, "s", 1); 1764 + goto error; 1774 1765 } 1775 1766 1776 - sort_order = sort_tmp; 1767 + if (sort_order && strstr(sort_order, "symbol")) { 1768 + if (sort__mode == SORT_MODE__BRANCH) { 1769 + snprintf(sort_tmp, sizeof(sort_tmp), "%s,%s", 1770 + sort_order, "ipc_lbr"); 1771 + report.symbol_ipc = true; 1772 + } else { 1773 + snprintf(sort_tmp, sizeof(sort_tmp), "%s,%s", 1774 + sort_order, "ipc_null"); 1775 + } 1776 + 1777 + sort_order = sort_tmp; 1778 + } 1777 1779 } 1778 1780 1779 1781 if ((last_key != K_SWITCH_INPUT_DATA && last_key != K_RELOAD) &&