This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Generating Kernel module for Other Computers


Hi,

I am trying to automate the creation of the driver from one host for
multiple computers.
The purpose is:
1. compile the driver with the latest STAP version
2. automate it for multiple kernels at once
3. distribute the driver to each machine

My approach was to use stap "-r" flag. So for example I would use my
Arch Linux to download and extract all relevant source for Centos 6
and compile my module for it.

Centos 6.9:
---------------
get the following packages:
kernel-2.6.32-696.el6.x86_64.rpm
kernel-debuginfo-2.6.32-696.3.2.el6.x86_64.rpm
kernel-debuginfo-common-x86_64-2.6.32-696.3.2.el6.x86_64.rpm
kernel-devel-2.6.32-696.el6.x86_64.rpm

extract them to some location.

then:
---
export SYSTEMTAP_DEBUGINFO_PATH=/home/danield/Downloads/centos-2.6.32/usr/lib/debug/lib/modules

soft link vmlinux for STAP
ln -s ~/Downloads/centos-2.6.32/usr/lib/debug/lib/modules/2.6.32-696.3.2.el6.x86_64/vmlinux
~/Downloads/centos-2.6.32/usr/src/kernels/2.6.32-696.el6.x86_64/vmlinux

sudo stap -vv -r
/home/danield/Downloads/centos-2.6.32/usr/src/kernels/2.6.32-696.el6.x86_64
-e 'probe vfs.read {exit()}' -m simple


the error I get:
include/linux/compiler-gcc.h:94:1: fatal error: linux/compiler-gcc7.h:
No such file or directory
 #include gcc_header(__GNUC__)

made me realize this is not good because STAP relies on the gcc
version I use to get the header in the kernel. Of course I am using
gcc 7 which doesn't exist for Centos 6.9 kernel' (latest version is
4.4.7)

I could:
1. download the relevant gcc version and maybe pass CC=/usr/bin/gcc4
stap -r ....
2. other suggestion?


Thanks.
Daniel.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]