Re: [PATCH v2] perf trace: Speed up startup time by bypassing the creation of kernel maps
From: Howard Chu
Date: Wed Apr 30 2025 - 19:33:57 EST
Hi Aditya,
Sorry for the late reply — I was really sick over the past two weeks.
Anyway, thank you so much for testing this patch on powerpc. Could you
share the commands you used for testing? I noticed a 2-second runtime,
which makes me think you might have used the time sudo ./perf trace --
sleep 1 command I mentioned earlier. However, that command may not be
ideal for benchmarking this patch, as the extra 1-second time makes
performance gain imperceptible.
Personally, I prefer using 'time sudo ./perf trace -C 0 -- true',
tested both with and without the patch. That said, I think it’s also
valid to apply the patch, and test using the following two commands:
# this will not load the kernel map, should be faster.
time sudo ./perf trace -C 0 -- true
# this enables the kernel map, should take longer than the former command
time sudo ./perf trace --call-graph fp --kernel-syscall-graph -C 0 -- true
And these are the results I gathered, all obtained with the patch applied.
perf $ time sudo ./perf trace -C 0 -- true
real 0m0.264s
user 0m0.004s
sys 0m0.009s
perf $ time sudo ./perf trace --call-graph fp --kernel-syscall-graph
-C 0 -- true
real 0m0.462s
user 0m0.004s
sys 0m0.013s
By the way, the 1-second difference in start up time shown in the
commit message, is obtained using an older Lenovo T480, with Intel
i5-8350 processor. The result I gathered above was from a machine with
i7-12700 processor, where the difference is 200ms. And in your
results, the difference is even smaller, which may indicate that your
machine has a better single-core performance, or faster memory, or
other contributing factors.
Would you like a 'Tested-by:' ? :)
Thanks,
Howard