Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
621 views
in Technique[技术] by (71.8m points)

profiling - Linux perf call-graph max-stack does not work properly

As discussed in Profiling my program with linux perf and different call graph modes gives different results, sometime when the call-stack is too high, top-level functions like main() gets truncated when doing perf record.

I believe this call-stack recording limit can be changed with the max-stack property, moreover my command is:

perf record -g -e cpu-clock/max-stack=100/ ./myProgram

Question: I ran my program(sjeng) a bunch of times (with max-stack=100) and observe a weird behavior: half of the time main() shows up correctly in perf report, but half of the time main() is only 70%~. I checked perf script for that, and main didn't show up in some of the callstacks, and clearly these callstacks are less than 100 levels.

Half of the time Perf record works abnormally: enter image description here

Does anyone know why this happens? My perf version is 4.15.18


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...