wic*_*ick 7 performance linux-kernel perf
我正在尝试了解 myApp 非常忙的事情(90% cpu 单线程)。这是一个我不应该重新启动的服务器。我收集了样本
\nperf record -p 5068 -F 99 --call-graph dwarf sleep 10\nRun Code Online (Sandbox Code Playgroud)\n并perf report给了我这个:
+ 100.00% 0.00% myApp [unknown] [.] 0xffffffffffffffff \xe2\x97\x86\n+ 80.67% 0.67% myApp myApp [.] pipeline_run \xe2\x96\x92\n+ 67.71% 0.00% myApp myApp [.] QueryProcessor::process\nRun Code Online (Sandbox Code Playgroud)\n我花了一些时间谷歌搜索和阅读文档,我怀疑 0xffffffffffffffff 无法解析,因为perf不知道堆栈底部在哪里,因为它没有启动该过程。但有人可以证实这一点或指出我正确的方向吗?
就我而言,这是由于perf使用太小的堆栈转储大小引起的。这会导致被截断的堆栈底部变成0xffffffffffffffff,这会让perf report朋友们认为该函数0xffffffffffffffff被大量使用。
当我使用最大堆栈转储捕获大小时,我摆脱了大部分0xffffffffffffffff. 如果传递,将使用--call-graph dwarf默认堆栈转储大小。8192要最大化它,请更改为--call-graph dwarf,65528.
从perf record --help:
When "dwarf" recording is used, perf also records (user) stack dump
when sampled. Default size of the stack dump is 8192 (bytes).
User can change the size by passing the size after comma like
"--call-graph dwarf,4096".
Run Code Online (Sandbox Code Playgroud)
如果您尝试使用的值大于65528您得到的值
callchain: Incorrect stack dump size (max 65528): 128000
Run Code Online (Sandbox Code Playgroud)