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

PLease help: What is the difference between sampling System-WIde and sampling a stand alone process?

summergirl
Beginner
789 Views
Hi all, I am currently using Vtune. I am testing with some applications which make multiple calls to MySQL server for database queries. I am using event based sampling and found some results were not as expected. My questions are:

In my case, what is the difference between sampling with "Analyze System-Wide" toggled on and off? If I turn it off, can I still sample the events for the queries of my applications? Can anyone help please?

Thanks very much!
0 Kudos
8 Replies
Peter_W_Intel
Employee
789 Views
PMU event-based sampling can collect performance data from *all* active processes in system.

1. If you specified option "-analyze-system" for data collection, performance data for all active processes (include your target process) will be collected. The advantage of this option is to know CPU consumption in other processes. Sometime other processes activity will impact your process'es performance.

2. If you specified option "-no-analyze-system", collect performance data from your process only. It means, the toolwill drop samples which is not belong to your process.

Regards, Peter
0 Kudos
summergirl
Beginner
789 Views
Thanks very much for your reply!

So if I want to see the samples belong to the DB queries called by my application, should I turn on the "analyze-system-wide"? Will VTune also collect the samples for the DB queries if I turn the option off? From my test, it seems if I don't turn it on, the result remains the same no matter what query I used. Please help...
0 Kudos
Peter_W_Intel
Employee
789 Views
Whatever you collected data with "-analyze-system" or not, you can display hotspots of DB queries in your report, no change. For example:

amplxe-cl -report hw-events-result-dir r00???-group-by function -filter module=DB_queries_module, or use amplxe-gui to open result to filter other modules.

Again, using option "-analyze-system" gives you additional info (performance data)on other active processes.

Regards, Peter
0 Kudos
summergirl
Beginner
789 Views
Thank you for your reply.

This was what I was expecting. However in my example, the hotspot couldn't catch the hotspots of the DB queries.(I was using the GUI) I put two functions into my application, one is some caculations that consume some CPU time, the other is doing a DB query, the report only shows the CPU time for the first function. In the summary view, it shows:

Elapsed Time: 83.064s
Total Thread Count: 2
CPU Time: 5.850s

And this CPU Time 5.850s almost equals the time of the first fuction without calling the DB. I drilled down to the source code view. For the second function that calls the DB, it only shows 0.010s CPU Time when it should have run for more than 1 minute.

And this also holds for hardware event based sampling.

Could you please tell me what step I might be missing or misunderstanding?

Thank you very much!



0 Kudos
Peter_W_Intel
Employee
789 Views

There was nomistake in your report, it did make sense.

Please increase workload of doing DB query, so your 2nd function will be hot function.

0 Kudos
summergirl
Beginner
789 Views
Ok, I will try to increase the workload and see. But why a query running for 1 minute is not enough workload? Could you please explain me what was the reason for a big difference between the CPU Time and the Elpased Time so that I can understand the report better? I've been stuck on this for a few days.

I really appriciate your help!
0 Kudos
Peter_W_Intel
Employee
789 Views
Elapse time is program's execution time, is not equivalentCPU time, could be one situation of below:
1. Program might be inIDLE state
2. Program is running, but spend CPU time little
3. Program (one thread) is suspended (including IO waits), wait state
4. Program consumed much CPU time, high computation?

If your application is serial, Elapsed Time >= CPU Time
If your application is multithreaded application, usually CPU Time> Elapsed Time, but CPU Time iscollectedfrom multi-cores, they are paralleled.

Regards, Peter
0 Kudos
summergirl
Beginner
789 Views
Ok, I see. I misunderstood some of the concepts. Thank you very much for your answers.

Best regards
0 Kudos
Reply