What does frame_dummy mean in the context of profiling?

前端 未结 2 851
[愿得一人]
[愿得一人] 2021-02-07 12:07

In the process of using gprof to profile a C++ program I\'ve written, I\'ve noticed that the vast majority of execution time is spent in the function \"frame_dummy\". More preci

2条回答
  •  离开以前
    2021-02-07 12:31

    There's a very good explanation here: http://dbp-consulting.com/tutorials/debugging/linuxProgramStartup.html . But I'm not sure why your program would spend so much time in frame_dummy, or why it would get called so many times.

    Perhaps the debug info in your binary is corrupt in some way, or is getting misread by gprof? Or gprof might get confsued by MPI? Here's something to try: run your program in gdb, and with a breakpoint on the frame_dummy function. See whether it really gets called 24 million times, and if it does, then what it's getting called from.

    Also, can you confirm that this is the frame_dummy in crtbegin.o, and not some other frame_dummy?

    Here's the source for frame_dummy in crtbegin.c -- by my reading of the code, it should only get called once.

    Also, I'm assuming that your program runs and produces the correct result? (In particular, if there's a memory bug in your program, then you can get some pretty odd behavior.)

提交回复
热议问题