Commit 0b7bcea
committed
perf trace: Add missing perf_tool__init()
JIRA: https://issues.redhat.com/browse/RHEL-83634
upstream
========
commit 2337b72
Author: Athira Rajeev <atrajeev@linux.ibm.com>
Date: Tue Feb 25 17:01:57 2025 +0530
description
===========
Perf trace on perf.data fails as below:
./perf trace record -- sleep 1
./perf trace -i perf.data
perf: Segmentation fault
Segmentation fault (core dumped)
Backtrace pointed to :
?? ()
perf_session.process_user_event ()
reader.read_event ()
perf_session.process_events ()
cmd_trace ()
run_builtin ()
handle_internal_command ()
main ()
Further debug pointed that, segmentation fault happens when
trying to access id_index. Code snippet:
case PERF_RECORD_ID_INDEX:
err = tool->id_index(session, event);
Since 'commit 15d4a6f ("perf tool: Remove
perf_tool__fill_defaults()")', perf_tool__fill_defaults is
removed. All tools are initialized using perf_tool__init()
prior to use. But in builtin-trace, perf_tool__init is not
used and hence the defaults are not initialized. Use
perf_tool__init() in perf trace to handle the initialization.
Reported-by: Tejas Manhas <Tejas.Manhas1@ibm.com>
Signed-off-by: Athira Rajeev <atrajeev@linux.ibm.com>
Link: https://lore.kernel.org/r/20250225113157.28836-1-atrajeev@linux.ibm.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Anubhav Shelat <ashelat@redhat.com>1 parent c1fb3da commit 0b7bcea
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4525 | 4525 | | |
4526 | 4526 | | |
4527 | 4527 | | |
| 4528 | + | |
4528 | 4529 | | |
4529 | 4530 | | |
4530 | 4531 | | |
| |||
0 commit comments