Skip to content

Commit 0aa1e3e

Browse files
committed
perf script: force stdin for flamegraph in live mode
JIRA: https://issues.redhat.com/browse/RHEL-87957 upstream ======== commit 23e0a63 Author: Anubhav Shelat <ashelat@redhat.com> Date: Fri Jan 31 09:57:05 2025 -0500 description =========== Currently, running "perf script flamegraph -a -F 99 sleep 1" should produce flamegraph.html containing the flamegraph. Howevever, it gives a segmentation fault. This is caused because the flamegraph.py script is supposed to take as input the output of "perf record", which should be in stdin. This would require passing "-i -" to flamegraph.py. However, the "flamegraph-report" script causes "perf script" command to take the "-i -" option instead of flamegraph.py, which causes no problem for "perf script", but causes a seg fault since flamegraph.py has no input file. To fix this I added the "-i -" option directly to the flamegraph-report script to ensure flamegraph.py gets input from stdin. Signed-off-by: Anubhav Shelat <ashelat@redhat.com> Tested-by: Michael Petlan <mpetlan@redhat.com> Link: https://lore.kernel.org/r/20250131145704.3164542-2-ashelat@redhat.com Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
1 parent 818e414 commit 0aa1e3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22
# description: create flame graphs
3-
perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@"
3+
perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -i - -- "$@"

0 commit comments

Comments
 (0)