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

Does clock ticks of _spin_locks in VTune report include spin lock hold time?

mfcking
Beginner
550 Views
Hi,
Recently I have done series of measurement of spin locks used by Intel e1000 NIC driver. Two tools we used, one is VTune 3.0 and the other is Lockemeter. Linux kernel version is 2.6.12.
We found spin lock occupied almost 20% total clock ticks based on the VTune report. However Lockmeter gave more precise report, if spin lock hold time and wait time are both included, the spin lock activities almost used 40% of total time.
So I am just wondering if the clock ticks used by spin lock include the spin lock hold time or not?
VTune is a sampling-based tool and Lockmeter is a instrumentation-based tool. Does this make different when measuring the spin locks in Linux kernel?
Thanks,
L.Y.

Message Edited by mfcking@yahoo.com on 07-12-2005 04:30 PM

0 Kudos
2 Replies
jeffrey-gallagher
550 Views
Interesting report!
The sampling technology that VTune uses does not require instrumentation, exactly as you noted. Sampling's job is to locate hotspots in your code.
For our purposes, a hot spot is a location in your code where a CPU event occurs MORE than it occurs any place else. Default CPU events are clockticks and instructions retired, which are pretty gosh darn good general indicators of how your application is running.
But there are hundreds more for every CPU we sell, and you can sample for those events as well. Everything from L2 and L3 cache misses up to mispredicted conditionals and x87 ouput assists.
To see the available events you can sample for, you can conjureup a listthat's specific to the system you've installed vtl on by running this command:
$ vtl -help -c sampling | less
You can sample for any of those events, not just the defaults.
But to me, sounds like you should be comparing results with the callgraph functionality of VTune, which also instruments your code and runs its analysis on that instrumented version.
From the command line, you'd be up to something like this:
$ vtl activity -c callgraph -app "myapp" -moi "module_of_interest" run
Note that the -moi argument is required.
Then, view the results:
$ vtl view -gui
Your application will take longer to run, but, the reward for being patient is more of the time comparisons that you seek, apples to apples for what you're asking here.
Let us know what you find by reporting back here.
cheers
jdg

Message Edited by jdgallag on 07-12-2005 05:47 PM

Message Edited by jdgallag on 07-12-2005 05:50 PM

Message Edited by jdgallag on 07-12-2005 05:51 PM

0 Kudos
Boaz_T_Intel
Employee
550 Views

mfcking@yahoo.com wrote:
Hi,
VTune is a sampling-based tool and Lockmeter is a instrumentation-based tool. Does this make different when measuring the spin locks in Linux kernel?

Hi.

Of course it makes a difference. In general, Sampling profiling is much less intrusive, and more accurate, while instrumentation based profiling introduces an overhead, but can provide more context, e.g., spin count.

Regarding timing information, I would trustsampling than any other instrumentation based tool.

Boaz.

0 Kudos
Reply