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

Building VTune 9.1 Sampling Driver on Ubuntu-9.10 (Kernel version 2.6.31-14)

vazexqi
Beginner
627 Views
I am trying to get the non-commercial version of VTune 9.1 to work on Ubuntu-9.10 (64 bit). I checked the requirements for VTune and I am aware that it only officially supports the 2.6.24-16-generic version on Ubuntu-8.04. But I was hoping that maybe someone here has gotten it to work and can share what they needed to do.

Here's what I have so far on building the sampling driver:

0) I am using the linux headers from /usr/src/linux-headers-2.6.31-14-generic (using sudo apt-get install linux-headers-2.6.31-14-generic )
1) By changing the kernel_includes in the configure file (see this thread) and also using gcc-4.3 (instead of gcc-4.4), I have gotten the driver to compile.

But during compilation it throws this warning:

...
LD /opt/intel/vtune/vdk/src/vtune_drv.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: "find_task_by_pid_ns" [/opt/intel/vtune/vdk/src/vtune_drv.ko] undefined!
CC /opt/intel/vtune/vdk/src/vtune_drv.mod.o
LD /opt/intel/vtune/vdk/src/vtune_drv.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-14-generic'
Renamed vtune_drv.ko to vtune_drv-x32_64-2.6.31-14-genericsmp.ko .

2) I ignored the warning and ran insmod-vtune. Here's the result:

/opt/intel/vtune/vdk/src$ sudo ./insmod-vtune
Executing: insmod ./vtune_drv-x32_64-2.6.31-14-genericsmp.ko
insmod: error inserting './vtune_drv-x32_64-2.6.31-14-genericsmp.ko': -1 Unknown symbol in module

3) And I check to see what the error actually is:

/opt/intel/vtune/vdk/src$ sudo dmesg
[15642.609120] vtune_drv: Unknown symbol find_task_by_pid_ns

I am stuck at this point since I am not sure why it can't find the find_task_by_pid_ns symbol. Earlier in the configure phase, it did find that symbol as evident from this message that it prints to the console:

...
checking if kernel percpu segment is used ... no
checking if on_each_cpu has retry parameter ... no
checking which apic vector to use ... first device vector
##
## Here is where it checks for find_task_by_pid_ns and FINDS it!
##
checking whether to use pid namespaces ... yes

Is there anything else that I need to do to help it locate that symbol?

Thanks.
0 Kudos
1 Solution
titanius_anglesmith
627 Views
I tried all vanilla kernels from 2.6.24 to 2.6.31 and i found Vtune working till 2.6.30-*. Seems some datastructure in 2.6.31 doesn't let it load.

View solution in original post

0 Kudos
8 Replies
ToTi
Beginner
627 Views

I have exactly same problem on my kubuntu 9.10 even though using gcc-4.3

I guess vtune 9.1 is not compatable with kernel 2.6.31


0 Kudos
Peter_W_Intel
Employee
627 Views
I supposethat kernel version 2.6.31-14has not been supported yet.

Please visit http://software.intel.com/en-us/articles/intel-software-products-system-requirements/and select "Intel VTune Analyzer for Linux*" - open a release notes document, see Linux* Distributions Supported list.

Regards, Peter
0 Kudos
titanius_anglesmith
628 Views
I tried all vanilla kernels from 2.6.24 to 2.6.31 and i found Vtune working till 2.6.30-*. Seems some datastructure in 2.6.31 doesn't let it load.
0 Kudos
Vladimir_T_Intel
Moderator
627 Views
I tried all vanilla kernels from 2.6.24 to 2.6.31 and i found Vtune working till 2.6.30-*. Seems some datastructure in 2.6.31 doesn't let it load.
I couldn't find in your post - what was the VTune build number you were trying?
0 Kudos
titanius_anglesmith
627 Views
I couldn't find in your post - what was the VTune build number you were trying?
I tried Vtune 9.1 for linux build 226 (non-commercial use) and had the same find_task_by_pid_ns error. Though getting it working for 2.6.30-* was good enough for me.
0 Kudos
Vladimir_T_Intel
Moderator
627 Views
I think we need to wait next public release of VTune which supports the kernels upper 2.6.30.
0 Kudos
vazexqi
Beginner
627 Views
I think we need to wait next public release of VTune which supports the kernels upper 2.6.30.

Thanks for all the information. I'll try waiting for the next release of VTune or just use an older kernel.
0 Kudos
joelkatz
Novice
627 Views
This is a somewhat rude fix, but it should work. Open os_dependent.h and change the VTSA_FIND_TASK_BY_PID block to look like this:

//#if defined(USE_PID_NAMESPACE)
//#define VTSA_FIND_TASK_BY_PID(pid) find_task_by_pid_ns(pid, &init_pid_ns)
//#else
//#define VTSA_FIND_TASK_BY_PID(pid) find_task_by_pid(pid)
//#endif
#define VTSA_FIND_TASK_BY_PID(pid)
pid_task(find_pid_ns(pid, &init_pid_ns), PIDTYPE_PID)

That is, comment out the five lines I commented out and add the two lines I added at the end.

The proper fix requires testing the kernel version in configure, passing a new flag to Makefile.in and testing that flag in os_dependent.h. Unfortunately, I don't know the exact kernel version to make the switch flip on and don't have time to research it. This should get you going, but with this patch, you won't be able to compile drivers for older kernels.
0 Kudos
Reply