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

callgraph fails after first thread spawned

mathewmills
Beginner
532 Views
It seems that vtl fails for any threaded application I run.
I think it is exiting the main thread after the first call to create_thread.

Here is an example:
#include
#include
#include

void * worker (void *arg)
{
printf("in thread ");
return NULL;
}

int main (int argc, char *argv[])
{
int i;
for (i=0; i<2; i++)
{
pthread_t thr;
printf("before ");
pthread_create (&thr, 0, worker, NULL) ;
printf("after ");
}

sleep(3);

exit (0);
}


compiled with:
g++ -Wall -fPIC -D_REENTRANT -D_PTHREADS -D_POSIX_PTHREADS_SEMANTICS -O2 -o play ./play.cpp -Wl,-Bdynamic -lpthread

Works as expected running normally:
>./play
before
after
before
in thread
after
in thread

but fails under vtl:
>vtl activity -c callgraph -app ./play -moi ./play
>vtl run
VTune Performance Analyzer 1.1 for Linux*
Copyright (C) 2000-2003 Intel Corporation. All rights reserved.

The Activity is running.
Reading property files failed.

Sat Jun 21 14:52:30 2003 Static instrumentation started
Sat Jun 21 14:52:30 2003 All functions instrumentation of module play was successful.
Sat Jun 21 14:52:31 2003 None instrumentation of module ld-linux.so.2 was skipped.
Sat Jun 21 14:52:35 2003 All functions instrumentation of module libc.so.6 was successful.
Sat Jun 21 14:52:36 2003 All functions instrumentation of module libm.so.6 was successful.
Sat Jun 21 14:52:36 2003 All functions instrumentation of module libpthread.so.0 was successful.
Sat Jun 21 14:52:36 2003 Static instrumentation done
before
in thread
Sat Jun 21 14:52:38 2003 Data collection started...
Sat Jun 21 14:52:43 2003 Data collection finished...
Sat Jun 21 14:52:43 2003 Updating call graph database...
The Activity has finished running.



Any suggestions?
0 Kudos
4 Replies
jeffrey-gallagher
532 Views
Hey mathewmills,

Just in case this is a new installation: can you get successful run just on something trivial, like /bin/ls, or other test apps on your system?

Just for comparison, have you tried for something as simple as:

# vtl activity -c callgraph -app /bin/ls -moi /bin/ls run

0 Kudos
mathewmills
Beginner
532 Views
Yes, I have profiled a few non-threaded apps without much trouble.

>vtl activity -c callgraph -app /bin/ls -moi /bin/ls run
>vtl view -calls
runs without trouble and provides the expected data


FYI, my test system is a 6-way PIII w/ 4GB RAM running RedHat 7.2 with 2.4.18-14smp and glibc 2.2.4.

Is there a particular set of sysv ipc settings required?
0 Kudos
mathewmills
Beginner
532 Views
After clearing the Cache directory, my simple play program and other threaded programs are profiling fine.
0 Kudos
jeffrey-gallagher
532 Views
Excellent detective work, mathewmills.

By chance, before clearing that directory, did you happen to notice how full that particular filesystem was? I only ask because if it was quite full, it may fill up again soon, no doubt at a very unexpected and bad time...


0 Kudos
Reply