Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
663 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...