Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Tim_Broberg
Beginner
60 Views

Using VTune on Linux Kernal modules?

Is it possible to use VTune on Linux Kernal modules?

When I try to use Vtune Amplifier XE 2011 for Linux to profile an application that calls my linux module, the Bottom-up tab shows a line with statistics for the driver as if it were a module, but in brackets - [my_module]. ...but when I double-click on this instead if seeing the source code I get a tab titled "Unknown" with the text "Failed to show source and assembly code."

I'm running this under Fedora 13. The module and source are built in the same directory as the applications, and I tried manually adding this directory (and all subdirectories) to the search path, even though vtune is finding the application source just fine. I also added rw permission to all the files in this directory in case that was tripping vtune up.

I thoughtI had recalled doing stuff like this in Vtune for Windows a few years back, but perhaps I misremember or this is only supported under Windows.

I don't see anything in the documentation specifically describing whether kernel profiling is supported or not and if so, how.

Is assembly / source-level profile of the kernel just out of scope for VTune for Linux, or am I missing something?

Thanks,
- Tim.
0 Kudos
7 Replies
Vladimir_T_Intel
Moderator
60 Views

Hi Tim,

The Hotspots, Concurrency, and Locks and Waits types of analysis are the user-mode analysis types (see the 'About Performance Analysis with VTune Amplifier XE' and specifically the 'User-Mode Sampling and Tracing Collection' chapters in the VTune Amplifier XE Help system). So, with that types of analysis you can't profile system level modules.

However, you can use the Lightweight Hotspots analysis for profiling the whole system including your system modules (see the 'Lightweight Hotspots Analysis' chapter).

Tim_Broberg
Beginner
60 Views

Ok, thanks.

Any hints on debugging "Failed to show source and assembly code?"
Vladimir_T_Intel
Moderator
60 Views

The"Failed to show source and assembly code" seems to be a normal behaviour of theHotspots, Concurrency, and Locks and Waits collectors on a driver module. Use the lighweight hotspots collection instead. In order to make possible the drilling down to a source code, make sure the driver is compiled with a -g option.
Tim_Broberg
Beginner
60 Views

When I do runin lightweight hotspotsI still see the same behavior.

The drivers are compiled with source, and an objdump on the .ko's shows source and assembly.

They are installed with modprobe in the correct path:
[bash][root@san-panther panther]# modprobe -l | grep extra
extra/rrprofile/rrprofile.ko
extra/rrnotify/rrnotify.ko
extra/dre_drv/dre_drv.ko
extra/dre_drv/demo.ko
[root@san-panther panther]# ls /lib/modules/`uname -r`/extra/dre_drv -l
total 0
lrwxrwxrwx 1 root root 30 Feb 4 19:20 demo.ko -> /home/tbroberg/panther/demo.ko
lrwxrwxrwx 1 root root 33 Feb 3 18:29 dre_drv.ko -> /home/tbroberg/panther/dre_drv.ko
[/bash]

Any further tips on debugging this?

Thanks again,
- Tim.
David_A_Intel1
Employee
60 Views

Try setting up the search directories in the Project Properties.
Eduardo_Mendi
Beginner
60 Views

Hi Tim,

Have you got to use Vtune on Linux Kernel modules?

I am trying in meego, Lightweight Hotspots Analysis, medfield processor and I have the same error:
"Failed to show source and assembly code."

Thanks,

Edu

Tim_Broberg
Beginner
60 Views

Thanks, Mr. A. I'm coming back to this again after getting a new license file. This makes sense, but it still isn't working for me.

I have my search directories set to /usr/src/debug/kernel-2.6.34.fc13/linux-2.6.34.x86_64 where I can see plenty of source.

Zoom seems to find the source fine.

Any suggestions for how to debug this. Mr A?

Eduardo, no, I haven't had any luck with this yet.

Thanks,
- Tim.
Reply