Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
5142 Discussions

Getting callgraph information on already running process

marco_krieger
Beginner
652 Views
Hi,
is it possible to get callgraph data when the process of interest is already running ? With '-c callgraph' you need to specify an application (which will be started) and a module of interest. But I want to get callgraph information on a process that is already there. Is this possible, or should I specify an application that will fork my own process and will I see callgraph information on all children then ?
Thanks and regards,
Marco.
0 Kudos
4 Replies
jeffrey-gallagher
652 Views
Interesting question Marco.
Callgraph copiesthe executable (-moi, -app) you are going to test, inserts some of its own code into to it, and then runs that modified version of the code, NOT the original. If the process is running already, callgraph can't do that and tells you so.
I think you should try the experiment you described, create a test case that will launch the code within the context of a callgraph collection activity. If you don't have source for that particular process, you can omit it from the instrumentation phase, and see what happens.
Let us back here know what you find.
cheers
jdg
0 Kudos
marco_krieger
Beginner
652 Views
Hi, it seems to work for small testprograms (-c app /tmp/parent -moi /tmp/child), but for more complicated setups (parent and child communicating) it fails. Sometimes the MOI is instrumented, but the test fails because the parent can't talk to the child. If I do the same test then, the module is not instrumented: instrumentation will only happen again if I relink the MOI. Also: the instrumented executable is much smaller than the original one, is this intended, or is there some limit that I can override ?
The resulting executable is wrong, causing all comms between the 2 processes to fail. So 2 items: the instrumentation does not always happen (maybe it's cached ?) and the resulting executable is very small compared to the original.
Cheers,
Marco.
0 Kudos
plipcsei
Beginner
652 Views

Hi,

I have the same problem as Marco. I would like to somehow attach vtune to a running process, collect call-graph data than without stopping the process analize the results. But as I understand this is not possible with the current vtune for linux.

0 Kudos
jeffrey-gallagher
652 Views

Just guessing here, but when callgraph instruments an application, it renames it, yes?

I remember running callgraph on /bin/ls, and noticing in the working directory that the instrumented "ls" command was called "bin__ls", as an example.

If the parent is unaware of the new name of the child, that is, if the child's name is hardcoded into the parent app, could that be the reason there's a disconnect in your situations?

All thoughts invited.

jdg

0 Kudos
Reply