Redian新闻
>
how to get runtime caller function?
avatar
how to get runtime caller function?# Programming - 葵花宝典
p*u
1
i got a function which is called by many others, now i want to
know who the callers are at runtime. How can I do this in C++, say
print out the caller functions names? thanks.
avatar
P*f
2
also can try some debuger api
you may get some hint
avatar
p*u
3
gprof cannot profile kernel, i used oprof but there's no call graph, sigh.

usage
avatar
k*m
4
Many peformance tools (profiler) can do this. For example, gprof from GNU,
Vtune from Intel, and Sun's Performance Analyzer. Check their manual for usage
.
You problem seems to be a typical call-graph profiling problem. C++ may be
tricky because the function names might be changed by compilers to some
strange ones.

【在 p*u 的大作中提到】
: i got a function which is called by many others, now i want to
: know who the callers are at runtime. How can I do this in C++, say
: print out the caller functions names? thanks.

avatar
p*u
5
thanks a lot, i will give it a try and let you know what i get.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。