开发者

Shorten function names in profling results with gprof2dot.py

I work usually with gprof + gprof2dot.py to profile C++ codes. A new code I am开发者_Go百科 working with uses very long function names, so that the graphical results with gprof2dot.py are a mess. I wonder how can one shorten the function names so that they fit in a small box.


Just add --strip (for shortening) and --wrap (for line wrapping) to gprof2dot and the labels get narrowed.

Seen in the gprof2dot documentation here:

The node labels are too wide. How can I narrow them?

The node labels can get very wide when profiling C++ code, due to inclusion of scope, function arguments, and template arguments in demangled C++ function names.

If you do not need function and template arguments information, then pass the -s / --strip option to strip them.

If you want to keep all that information, or if the labels are still too wide, then you can pass the -w / --wrap, to wrap the labels. Note that because dot does not wrap labels automatically the label margins will not be perfectly aligned.


You can narrow the labels using gprof2py. Is this what you were looking for?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜