From: Namhyung Kim <namhyung@kernel.org>
To: Thomas Richter <tmricht@linux.ibm.com>
Cc: "linux-perf-use." <linux-perf-users@vger.kernel.org>,
ashelat@redhat.com, Michael Petlan <mpetlan@redhat.com>
Subject: Re: perf script: perf script hangs forever in linux-next
Date: Thu, 13 Feb 2025 18:13:20 -0800 [thread overview]
Message-ID: <Z66mwEOy06-6hvO_@google.com> (raw)
In-Reply-To: <c41e4b04-e1fd-45ab-80b0-ec2ac6e94310@linux.ibm.com>
On Thu, Feb 13, 2025 at 12:06:41PM +0100, Thomas Richter wrote:
> Command 'perf script report flamegraph' hangs for ever as can
> be seen with these commands:
>
> # perf record -- dd if=/dev/zero of=/dev/null bs=1M count=10K > /dev/null
> 10240+0 records in
> 10240+0 records out
> 10737418240 bytes (11 GB, 10 GiB) copied, 0.387818 s, 27.7 GB/s
> [ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 0.074 MB perf.data (1520 samples) ]
> #
> # time perf script report flamegraph
> ^C
>
> real 0m53.506s
> user 0m0.017s
> sys 0m0.012s
> #
>
> Control-C interrupt is needed to terminate the command.
>
> If I revert commit 23e0a63c6dd3f69cb7ee18411e5f6857cca55b30
> Author: Anubhav Shelat <ashelat@redhat.com>
> Date: Fri Jan 31 09:57:05 2025 -0500
>
> perf script: force stdin for flamegraph in live mode
>
> then everythings works fine again:
>
> # PERF_EXEC_PATH=/root/mirror-linux-next/tools/perf ./perf script report flamegraph
> # dumping data to flamegraph.html
> #
>
> Can you fix this so above invocation works again or revert that patch?
Hmm.. it seems the patch fixes one problem but create another. :(
IIUC the report script should be invoked with "-i -" already, that means
flamegraph-report should see it instead of adding its own. I think it's
because of the "--" before "$@" so that it cannot pass the input file to
perf script and give it to flamegraph.py instead.
Can you please test if the below fixes the problem both for your use
case and the live mode (perf script flamegraph -a -F 99 sleep 1)?
Thanks,
Namhyung
---8<---
diff --git a/tools/perf/scripts/python/bin/flamegraph-report b/tools/perf/scripts/python/bin/flamegraph-report
index 83d5738c75ca4726..453a6918afbe8f72 100755
--- a/tools/perf/scripts/python/bin/flamegraph-report
+++ b/tools/perf/scripts/python/bin/flamegraph-report
@@ -1,3 +1,3 @@
#!/bin/bash
# description: create flame graphs
-perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -i - -- "$@"
+perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py "$@"
---8<---
next prev parent reply other threads:[~2025-02-14 2:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 11:06 perf script: perf script hangs forever in linux-next Thomas Richter
2025-02-14 2:13 ` Namhyung Kim [this message]
2025-02-14 10:21 ` Thomas Richter
2025-02-19 10:13 ` PING " Thomas Richter
2025-02-19 20:34 ` 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=Z66mwEOy06-6hvO_@google.com \
--to=namhyung@kernel.org \
--cc=ashelat@redhat.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=mpetlan@redhat.com \
--cc=tmricht@linux.ibm.com \
/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 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.