Re: [DynInst_API:] Profiling OS/kernel code using DynInst


Date: Fri, 13 Feb 2015 10:15:48 -0800
From: Josh Stone <jistone@xxxxxxxxxx>
Subject: Re: [DynInst_API:] Profiling OS/kernel code using DynInst
On 02/13/2015 09:02 AM, Bill Williams wrote:
> On 02/13/2015 10:54 AM, Rakesh Kumar wrote:
>> Hi,
>>
>> I wanted to know if DynInst can be used to profile/instrument OS/kernel
>> code in additional to the user level code. What I want to do is get some
>> statistics, say hottest basic blocks, for an application but not only
>> for user level code but also for OS/kernel code included.
>>
>> I know PIN can instrument only user level code. But I was curious if
>> DynInst can instrument OS/Kernel code or not. If it cannot can somebody
>> suggest any other tool that can.
>>
>> Thanks,
>> Rakesh
>>
>> PS: I tried searching the answer in archives unsuccessfully.
>>
> Dyninst is purely user-level. We had a tool, KernInst, that worked at 
> the kernel level but work on that has been idle for years. SystemTap 
> provides an integrated kernel-space/user-space instrumentation 
> interface, using Dyninst for its user-space needs, but it may operate at 
> a coarser granularity than you want.

Yeah, SystemTap mostly works on source-level constructs, like function
names or file:line locations.  You can also specify raw addresses, if
you did block analysis yourself.  But it would be very slow to have
kprobes on so much of the kernel.

If you're ok with sampling, SystemTap also has perf event probes.  But
as a canned tool, the 'perf' command will probably be easiest and
fastest.  That will give you instruction-level hotspots, but you could
probably write something for perf-script to group them into blocks.
[← Prev in Thread] Current Thread [Next in Thread→]