What is the __tcf_0 function? (Visible when using gprof and g ++)

We are using g ++ 4.2.4, and I am trying to identify some performance issues in my code.

I run gprof to create a profile, and I get the following β€œweirdness” in that the most expensive function is __tcf_0:

Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls ms/call ms/call name 40.00 0.04 0.04 1 40.00 95.00 __tcf_0 

This function then calls most of my user-defined functions (i.e. this is the one that is called from the main one). The closest explanation I found for this was here , but this link refers to static objects and atexit, and I don't think this applies in my case.

If this is useful, I use Boost (program_options and fusion) and the HDF5 libraries.

UPDATE:

The command I use when creating:

 g++ -Wreturn-type -Wunused -Winline -pg -DLINUX -DHAS_SETENV \ -DFUSION_MAX_MAP_SIZE=15 -DFUSION_MAX_VECTOR_SIZE=15 -g -O0 \ --param large-function-growth=300 --param inline-unit-growth=200 
+6
c ++ g ++ gprof
source share
2 answers

__ tcf_0 is apparently a function that calls the static object destructor and which is registered for each static object that should be called on exit (taking for granted what is said on this page )

Now the result of your gprof is rather strange, since the function that takes most of the time takes only 0.04 seconds, which means that the whole program takes 0.1 s to execute. If I am not mistaken, I assume that you have configured the profile incorrectly. Have you compiled your code with profiling enabled?

+3
source share

g ++ generates functions with this name. They call the static object destructor and register with atexit () when the constructor is called.

+5
source share

All Articles