# Profile the in-tree kernel driver

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/)
- [Profile Linux kernel modules with Arm Streamline](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/1_overview/)
- [Set up your environment](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/2_build_kernel_image/)
- [Build the out-of-tree kernel module](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/3_oot_module/)
- [Profile the out-of-tree kernel module](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/4_sl_profile_oot/)
- [Integrate a custom character device driver into the Linux kernel](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/5_intree_kernel_driver/)
- [Profile the in-tree kernel driver](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/6_sl_profile_intree/)
- [Use Streamline with the Statistical Profiling Extension](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/7_sl_spe/)
- [Summary](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/8_summary/)
- [Next Steps](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/_next-steps/)

## Use Streamline to profile an in-tree kernel driver
Profiling in-tree drivers follows almost the same process as profiling an out-of-tree kernel module. The steps include:

- Transferring `gator` to the target device using `scp`
- Launching Streamline, selecting TCP view, and entering the target’s IP or hostname
- Setting up counters and enabling Event-Based Sampling (EBS)

The main difference is that, instead of adding the kernel module’s object file as the capture image in Capture settings, you use the Linux ELF file (vmlinux) generated by Buildroot.

![Streamline Capture settings dialog showing vmlinux selected as the capture image](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/images/img11_vmlinux_capture_settings.png)
_Streamline Capture settings dialog showing vmlinux selected as the capture image_

After you select **vmlinux** as the capture image in the **Capture settings** dialog, select **Save** to apply your changes.

Now, start the capture session. Streamline collects profiling data from the in-tree kernel driver and the rest of the kernel. When the capture completes, analyze the results using the same workflow as before.

You can review function-level metrics, explore call paths, and identify performance hotspots within both your driver and the kernel.

![Streamline function tab displaying profiling data for vmlinux](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/images/img12_vmlinux_function_tab.png)
_Streamline function tab displaying profiling data for vmlinux_

Because you selected the `vmlinux` image, Streamline displays both your driver functions and all other kernel functions sampled during profiling. This lets you see how your driver interacts with the rest of the kernel.

You can also explore the complete call path for any sampled function. This helps you understand how execution flows through your driver and the kernel, making it easier to identify performance bottlenecks or unexpected behavior.

![Streamline call paths tab displaying hierarchical call stack data for vmlinux](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/images/img13_vmlinux_callpaths_tab.png)
_Streamline call paths tab displaying hierarchical call stack data for vmlinux_
