From: James Clark <james.clark@linaro.org>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
namhyung@kernel.org, irogers@google.com
Subject: Re: [PATCH] perf report: Fix input reload/switch functionality
Date: Wed, 8 Jan 2025 15:23:55 +0000 [thread overview]
Message-ID: <384d6c4b-d2ce-47f8-9030-6225758b5923@linaro.org> (raw)
In-Reply-To: <20250108063628.215577-1-dvyukov@google.com>
On 08/01/2025 6:36 am, Dmitry Vyukov wrote:
> 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.
>
Hi Dmitry,
A reproducer with before and after behavior might be helpful for the review.
It might be unrelated to your change here, but the input switch thing
didn't seem to do anything for me. If I record two files, open the first
one, press S and select the second file nothing seems to change. I
assumed it would show the other file but nothing changes?
$ perf record -- true
$ perf record -o 2.data -- ls
$ perf report
S key
load 2.data
> Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
> Fixes: ec6ae74fe8f0 ("perf report: Display average IPC and IPC coverage per symbol")
> Cc: Namhyung Kim <namhyung@kernel.org>> Cc: Ian Rogers
<irogers@google.com>
> Cc: linux-perf-users@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
> tools/perf/builtin-report.c | 30 ++++++++++++++++--------------
> 1 file changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index 048c91960ba91..42d7dfdf07d9b 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -1721,22 +1721,24 @@ int cmd_report(int argc, const char **argv)
> 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) &&
>
> base-commit: 09a0fa92e5b45e99cf435b2fbf5ebcf889cf8780
next prev parent reply other threads:[~2025-01-08 15:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-08 6:36 Dmitry Vyukov
2025-01-08 15:23 ` James Clark [this message]
2025-01-08 15:35 ` Dmitry Vyukov
2025-01-09 14:50 ` James Clark
2025-01-10 12:19 ` Dmitry Vyukov
2025-01-13 15:19 ` James Clark
2025-01-13 15:39 ` Dmitry Vyukov
2025-02-10 22:53 ` Namhyung Kim
2025-02-20 18:26 ` Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=384d6c4b-d2ce-47f8-9030-6225758b5923@linaro.org \
--to=james.clark@linaro.org \
--cc=dvyukov@google.com \
--cc=irogers@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®