I have a "big precompiled program" which calls a Tcl script, which calls another (my) C program. Trying to clarify, the scenario looks like:
Big Precompiled Program (BPP) ----> Tcl script ----> my C program (MCP)
I want to run a profiling only in MCP but it have not the ability to run in a standalone mode (i.e. it has no main
function).
I used the -pg
option in gcc
when I compiled MCP, but when I run the BPP, no gmon.out
was created. Should I search a way to compile also BPP with -pg
or there is another way?
EDIT:
The BPP should have a main loop inside. BPP call the entire Tcl script prior to the loop for initialization stuff (faster), but then, in each iteration BPP call only one process defined in this script. At the same time, this Tcl process call the main function of my MCP. So, I want to profile only MCP, since the Tcl script don't make any relevant operation, is just like a conector.