PLease help: What is the difference between sampling System-WIde and sampling a stand alone process?
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?
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.
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...
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?
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.
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.