On Tue, Apr 06, 2021 at 11:25:36AM +0800, liuqi (BA) wrote:
[...]
Hi Suzuki,
Thanks for your answer, I've increased the buffer size and use perf record -m, it seems better.
But I meet another question when I use perf report to show the trace data. When I use:
perf report -D -i record.data > log
I could see the trace data in log, but when I only use perf report, it doesn't work:
[root@localhost lq]# ~/perf report -i record.data Error: The record.data data has no samples! # To display the perf.data header info, please use --header/--header-only options. [root@localhost lq]# ~/perf -v perf version 5.8.0-rc4
I find perf report only works when I use -k to figure vmlinux pathname, but I guess this is not the right way for ETM.
It's quite likely you hit the known issue that Perf tool misses to load Kernel and userspace DSOs when parse CoreSight trace data. If the tool fails to find the map (between PC value and DSOs), then it skips to generate samples for CS trace data.
Note, actually there have two issues, one for kernel DSO and another is for userspace DSOs. For the kernel symbols loading, you could specify the option '-k' with kernel vmlinux path, or you could build the kernel with configuration "CONFIG_PROC_KCORE=y", so perf tool can load kernel DSO successfully with any one of these two ways.
For the userspace DSOs loading, this is a known issue; James Clark has a patch set for trying to fix the similiar issue [1]; or you could do a quick try for the patch [2], please note for patch [2], it's not the right fixing (we should move forward based on James' work), just in case if you want to do quickly try and locate if you are running into the same issue.
Thanks, Leo
[1] https://lists.linaro.org/pipermail/coresight/2021-February/005816.html [2] https://lore.kernel.org/patchwork/patch/1340992/