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

simple test application shows no callstack on CentOS 5.3??

plynch1976
Beginner
520 Views
Hi all,
this may sound like a very basic question, but does anybody have a very simple (1 file) sample application to use with vtune that WILL show a callstack etc?

I've been trying to use "Hotspots" and each time I run my app with it I get "No data to show". I've tried all of the dropdowns and nothing shows up. It works fine when I run the Intel samples through it.

my test file is simply called
test1.c

to compile I use
gcc -g -O2 test1.c

I then run it through vtune using the same settings as I did for the sample applications (changing the args & executable)

What am I missing? I'm assuming it's something simple

All I want to verify is that I can see a callstack and that vtune is something that my company could use for profiling.

Thanks for your time & help in advance,

Patrick.
0 Kudos
12 Replies
Peter_W_Intel
Employee
520 Views
Hi Patrick,

Please read this article, hope it helps.

BTW, can you use VTune Amplifier XE on example program come with the product?
It seems that Hardware PMU event-based sampling works fine.

Regards, Peter
0 Kudos
plynch1976
Beginner
520 Views
Hi Peter,
thanks for the reply.

Yes, the sample applications that come with the product work fine (i.e. they show the callstack etc after the run).

My own sample applications show nothing though (simple sample code - 1 with just a main(), another with main() that spawns threads). Maybe my expectations are wrong?

I'm obviously missing something very simple, but I have no idea what that is at the moment.

I'll take a look at the article that you suggested.

thanks again for taking the time to help.

regards,
Patrick.
0 Kudos
plynch1976
Beginner
520 Views
Hi Peter,
that does seem to have worked for my simple sample application - thank you.

For my larger application however, it still comes back straight away saying "No data to show". This would point to the application failing to launch?

Is there a log file anywhere I can see what happened on my run? It runs fine outside of vtune (has loops, takes 10 mins to run etc)

Thanks again for your help

regards,
Patrick
0 Kudos
Peter_W_Intel
Employee
520 Views
Hi Patrick,

(I'm sorry there is no log file). Is it possible that you can provide large application which causes this problem? So I can investigate in detail. Thank you.

You might use another way, launch application manually then use attach-to-process to collect performance data.

BTW, do you have this problem in latest Update 3?

Regards, Peter
0 Kudos
plynch1976
Beginner
520 Views
Hi Peter,
thanks for the info - I'll try attaching to an already running process.

Unfortunately I can't share the larger application since it has custom code.

Thanks again for your help.

regards,
Patrick
0 Kudos
plynch1976
Beginner
520 Views
Hi Peter,
unfortunately attaching to an already running process has not worked.

I started amplxe-gui from terminal ("./amplxe-gui &"), created the project and started my app from the command line (same terminal window as I had started the gui from). Verified that it runs ok (needs ctrl+c to quit). Restarted my sample app and used hotspots to attach to that running process.

amplxe-gui said that it was collecting data. When the sample app completed (which I knew from the terminal output), I typed ctrl+c. It stayed at shutdown and on the gui said that it was collecting data (which would take a few moments). I left it there overnight & unfortunately it had stalled there.

I had to kill my sample app (kill -9). amplxe-gui then showed the message "Failed to initialize the result". I've tried a number of combinations of this including clicking stop in the GUI instead of doing ctrl+c on the app.

any ideas? am I missing something?

thanks,
Patrick.
0 Kudos
Peter_W_Intel
Employee
520 Views

Hi Patrick,

First at all, ensure you are using latest VTune Amplifier XE 2011 Update3.

My opinion isthat you can try to collect data in short time first, assume that your application is running (whatever it was luanched from GUI, or command line...)

Use "ps -axe" to get pid ofprocess, or use application name directly (if no two application running with same name).

You can try - ("n"means number for "n seconds", e.g. n=120 for 2 minutes)

amplxe-cl -collecthotspots -duration n -target-process program, OR

amplxe-cl -collecthotspots -duration n -target-pid pid

After data collecting completed, resultdirectory will be generated - then you can use amplxe-gui to open results.

Regards, Peter

0 Kudos
Peter_W_Intel
Employee
520 Views
About using Ctrl-c to interrupt data collection, but failed to do finalization - please read this article.
0 Kudos
plynch1976
Beginner
520 Views
Hi Peter,
I tried using the vtune GUI to attach to an already running process and only collect data for 30 seconds. It seems to be stuck in the "Collecting Hotspots data" part. Still there after 10 mins.. I have not touched my sample application (i.e. it is still running) - should collection not have stopped?

I've verified that the version is the latest (I only downloaded and installed it mid last week for review)

It may be the case that this just won't work for what I need.

thanks again,
Patrick.
0 Kudos
Peter_W_Intel
Employee
520 Views

Hi Patrick,

Did you have any problem when you run command? I verified both on CLI and GUI without any problem - I specified "Automatically stop collection after (sec) 10" in Projeict Properties, and running application is eclipse.

Sothere wasno problem to stop data collection after 10 sec, and eclipse still is running. I can see report - Elapsed Time is 10 sec around.

My version -
[root@NHM02 ~]# amplxe-cl -version
Intel VTune Amplifier XE 2011 Update 3 (build 150226) Command Line Tool
Copyright (C) 2009-2011 Intel Corporation. All rights reserved.

Regards, Peter

0 Kudos
plynch1976
Beginner
520 Views
Hi Peter,
thanks for all of your patience on this.

I tried it with Firefox and another (smaller) sample application and it worked perfectly. I can't see why it doesn't work on my larger code though (larger code contains many disk writes, is asynchronous in nature etc). I hope to get back looking at it after the weekend.

[plynch@centos-53-1 bin64]$ ./amplxe-cl --version
Intel VTune Amplifier XE 2011 Update 3 (build 150226) Command Line Tool
Copyright (C) 2009-2011 Intel Corporation. All rights reserved.

Have a great weekend.

thanks again.
Patrick.
0 Kudos
Peter_W_Intel
Employee
520 Views

Thank you againforthe update.

One thing is - "hotspots analysis" is only for application only (user mode), for some code (e.g. device driver) working on system mode, it's not adequate...you may try "lightweight-hotspots", verify which is the hottest module, which is the hottest function.

amplxe-cl -collectlightweight-hotspots -duration30 -target-pid pid

Another thing - program may spend less CPU time on main process, and most of time was spent on spawned process, so target pid should be spawned process.

Have a great weekend, you too.

Regards, Peter

0 Kudos
Reply