[ISSUE] trace_id of ETM will be invalid when there are more than 48 CPUs on chip

liuqi (BA) liuqi115 at huawei.com
Sun May 15 20:51:11 PDT 2022


Hi all,

My colleague Junhao He noticed this issue when tracing CPU48 on 
Kunpeng920 platform, log as follows:

[root at localhost ~]# perf record -e cs_etm/@sink_smb1/ -C 48 -o perf.data 
taskset -c 48 uname -a
[root at localhost ~]# perf report -D --stdio -i perf.data > perf_48.log
0x270 [0xc8]: failed to process type: 70 [Invalid argument]
Error:
failed to process sample
[root at localhost ~]# perf -v
perf version 5.17.rc4.gdeea22e4af29
[root at localhost ~]# ldd /usr/bin/perf | grep opencsd
         libopencsd_c_api.so.1 => /root/lib/libopencsd_c_api.so.1
         libopencsd.so.1 => /root/lib/libopencsd.so.1

As (CORESIGHT_ETM_PMU_SEED + (cpu * 2)) is used in 
coresight_get_trace_id() to cacualate trace_id, if there are more than 
48 CPUs on chip, we will have some ETM device which trace id is 
invalid(trace_id = 0 or trace_id > 0x6F). In this situation, we cannot 
parse trace data using perf tool.

Perhaps we should make trace_id in the range of 1 to 0x6F in 
coresight_get_trace_id()? But there also might be parsing problem if 
duplicate trace ID is used during collection.

Any response will be highly appreciated.

Thanks,
Qi



More information about the linux-arm-kernel mailing list