[lttng-dev] loading modules with modprobe

Kienan Stewart kstewart at efficios.com
Wed Jul 17 10:55:20 EDT 2024


Hi François,

On 7/16/24 4:34 PM, François Belias wrote:
> Hello Kienan,
> 
> When I proceed with the following steps:
> 
> ```
> # Warning: this removes all untracked content from the lttng-modules 
> directory
> cd /path/to/lttng-modules-source
> git clean -dxf
> 
> make
> sudo make modules_install
> sudo depmod -a
> ```
> 
> I encounter a warning in 
> `/home/philippe/lttng-modules/src/probes/Kbuild:79` stating "File 
> ./arch/x86/kvm/lapic.h not found. Probe 'kvm' x86-specific is disabled. 
> Use full kernel source tree to enable it." Although everything compiles 
> fine and I'm able to load modules, when I execute `sudo lttng list -k`, 
> I don't see the tracepoints `kvm_entry` and `kvm_exit`, which I believe 
> should be available. Could this be due to not using my full kernel tree 
> during compilation?


Exactly. Those probes depend on having the full kernel source as they 
require private headers which aren't shipped as part of the 
`linux-headers` package.

> 
> Here are the answers to your questions:
> 
> - *Where did `/usr/src/linux-source-6.5.0` come from?*
>    I initially attempted `sudo apt-get update && sudo apt-get install 
> linux-source`, but it gave me this answer */linux-source is already the 
> newest version (5.15.0.116.116)/*`, which doesn't match my current 
> kernel version. So, I downloaded it directly from kernel.org 
> <http://kernel.org> using this command: `wget 
> https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.5.tar.xz` 
> <https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.5.tar.xz`>.
> 

Right. Which kernel are you actually running at this time? You can check 
using: `uname -a`

In any case, Linux upstream 6.5 is not the same as Ubuntus's 6.5.

> - *Which Linux distribution and version are you using?* 
>    Running `lsb_release -a` gives me:
>    ```
>    No LSB modules are available.
>    Distributor ID: Ubuntu
>    Description:    Ubuntu 22.04.4 LTS
>    Release:        22.04
>    Codename:       jammy
>    ```
> 
> - *Assuming your distribution has kernel packages, which do you have 
> installed, and do you have the corresponding kernel headers package 
> installed?*
> 
>    Running `dpkg -l | grep linux-image` shows these installed packages:
>    ```
>    ii  linux-image-5.15.0-116-generic           5.15.0-116.126     
>   amd64   Signed kernel image generic
>    ii  linux-image-6.5.0-28-generic             6.5.0-28.29~22.04.1 
>   amd64   Signed kernel image generic
>    ii  linux-image-6.5.0-41-generic             6.5.0-41.41~22.04.2 
>   amd64   Signed kernel image generic
>    ii  linux-image-6.5.0-44-generic             6.5.0-44.44~22.04.1 
>   amd64   Signed kernel image generic
>    ii  linux-image-generic                      5.15.0.116.116     
>   amd64   Generic Linux kernel image
>    ii  linux-image-generic-hwe-22.04            6.5.0.44.44~22.04.1 
>   amd64   Generic Linux kernel image
>    ```
> 
>    And `dpkg -l | grep linux-headers` shows these installed header packages:
>    ```
>    ii  linux-headers-5.15.0-116                 5.15.0-116.126      all 
>      Header files related to Linux kernel version 5.15.0
>    ii  linux-headers-5.15.0-116-generic         5.15.0-116.126     
>   amd64   Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
>    ii  linux-headers-6.5.0-28-generic           6.5.0-28.29~22.04.1 
>   amd64   Linux kernel headers for version 6.5.0 on 64 bit x86 SMP
>    ii  linux-headers-6.5.0-41-generic           6.5.0-41.41~22.04.2 
>   amd64   Linux kernel headers for version 6.5.0 on 64 bit x86 SMP
>    ii  linux-headers-6.5.0-44-generic           6.5.0-44.44~22.04.1 
>   amd64   Linux kernel headers for version 6.5.0 on 64 bit x86 SMP
>    ii  linux-headers-generic                    5.15.0.116.116     
>   amd64   Generic Linux kernel headers
>    ii  linux-headers-generic-hwe-22.04          6.5.0.44.44~22.04.1 
>   amd64   Generic Linux kernel headers
>    ```
> 

Since you've got a few different images and headers installed, it is 
possible to check that same info the linux-source package: `dpkg -l | 
grep linux-source`.

Maybe one thing tripping this process up is that you don't have an apt 
source that provides linux-source that matches the kernel you are using. 
Could you run either `apt-cache policy` or `apt policy` and `apt-mark 
showhold` in order to know which sources you have configured.

There are also alternative sources for the full source tree:

- You could download the specific package from packages.ubuntu.com. See 
https://packages.ubuntu.com and use `apt install ./downloaded_package.deb`

- You could clone the kernel source for Ubuntu and checkout the 
appropriate tag. See 
https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy/refs/tags

thanks,
kienan


More information about the lttng-dev mailing list