gpt4 book ai didi

c++ - 使用 gprof 显示模板化方法调用图的参数格式?

转载 作者:太空宇宙 更新时间:2023-11-04 11:42:17 25 4
gpt4 key购买 nike

使用 gprof 显示模板类中方法的函数调用图的命令行格式是什么?

对于简单的 C 方法,您可以像这样指定它:

gprof -f foo myprogram > gprof.output

如何从以下内容中指定方法 parse:

template <typename T> class A
{
public:
template <typename X> bool parse(X& x, char*buf)
{ ... lots of code here ...;
}
};

最佳答案

这是可以解析这个的 python 脚本:gprof2dot .该页面还有更多引用资料。

就我个人而言,我喜欢 Google Performance Tools除其他外,它还可以直接生成调用图(通过 graphviz/dot)。

关于c++ - 使用 gprof 显示模板化方法调用图的参数格式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1210306/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com