Skip to content

Commit 73b8fae

Browse files
Refactor documentation for integrating and profiling in-tree kernel drivers, enhancing clarity in titles, overviews, and step instructions.
1 parent 6fddae6 commit 73b8fae

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

content/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/5_intree_kernel_driver.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Build the in-tree kernel driver
2+
title: Integrate a custom character device driver into the Linux kernel
33
weight: 6
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
## Build an in-tree Linux kernel driver
9+
## Overview
1010

1111
Now that you have learned how to build and profile an out-of-tree kernel module, you'll move on to building a driver statically into the Linux kernel. You will then profile it by adding the kernel’s `vmlinux` file as an image in Streamline’s capture settings, rather than the kernel object itself. This allows you to view function calls and call paths as before, and also inspect specific sections of the kernel code that might be contributing to performance issues.
1212

@@ -16,7 +16,7 @@ Use the same example character driver you used earlier `mychardrv`. This time, y
1616

1717
Go to your kernel source directory, in our case, it's located in Buildroot's output directory in `$(BUILDROOT_HOME)/output/build/linux-custom`.
1818

19-
Copy the `mychardrv.c` file created earlier to `drivers/char` directory.
19+
Copy the `mychardrv.c` file created earlier to `drivers/char` directory:
2020

2121
```bash
2222
cd drivers/char

content/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/6_sl_profile_intree.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ layout: learningpathall
1010

1111
Profiling in-tree drivers follows almost the same process as profiling an out-of-tree kernel module. The steps include:
1212

13-
1. Transferring `gator` to the target device using scp.
13+
- Transferring `gator` to the target device using scp
1414

15-
2. Launching Streamline, selecting TCP view, and entering the target’s IP or hostname.
15+
- Launching Streamline, selecting TCP view, and entering the target’s IP or hostname
1616

17-
3. Setting up counters and enabling Event-Based Sampling (EBS).
17+
- Setting up counters and enabling Event-Based Sampling (EBS)
1818

1919
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.
2020

21-
![Streamline Capture settings dialog showing vmlinux selected as the capture image. The dialog displays fields for selecting the capture image, with vmlinux highlighted, and options for configuring counters and event-based sampling. The interface uses a neutral, technical design typical of profiling tools. The wider environment includes other Streamline configuration tabs and settings. Visible text includes Capture settings, Capture image, and vmlinux. alt-text#center](./images/img11_vmlinux_capture_settings.png)
21+
![Streamline Capture settings dialog showing vmlinux selected as the capture image. The dialog displays fields for selecting the capture image, with vmlinux highlighted, and options for configuring counters and event-based sampling. The interface uses a neutral, technical design typical of profiling tools. The wider environment includes other Streamline configuration tabs and settings. Visible text includes Capture settings, Capture image, and vmlinux. alt-text #center](./images/img11_vmlinux_capture_settings.png)
2222

2323
After clicking Save in Capture settings dialog, you can start the capture and analyze it as you did before.
24-
![Streamline function tab displaying profiling data for vmlinux. The main area shows a list of kernel functions with columns for metrics such as sample count and percentage of total samples. The function names are clearly listed, and the selected function is highlighted. The interface uses a neutral, technical design typical of performance profiling tools. Visible text includes Function, Sample Count, and Percentage. The wider environment includes other Streamline tabs and configuration options, reinforcing a focused, analytical workflow. ](./images/img12_vmlinux_function_tab.png)
24+
![Streamline function tab displaying profiling data for vmlinux. The main area shows a list of kernel functions with columns for metrics such as sample count and percentage of total samples. The function names are clearly listed, and the selected function is highlighted. The interface uses a neutral, technical design typical of performance profiling tools. Visible text includes Function, Sample Count, and Percentage. The wider environment includes other Streamline tabs and configuration options, reinforcing a focused, analytical workflow. alt-text #center] (./images/img12_vmlinux_function_tab.png)
2525

2626
Since you used `vmlinux` image, you can view the driver functions as well as all other kernel functions that were sampled during the capture.
2727

content/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/8_summary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ layout: learningpathall
77
---
88
## Summary
99

10-
In this Learning Path, you learned how to build and profile Linux kernel modules one step at a time. You started with an out-of-tree character driver that had a cache performance issue. Using Arm Streamline, you found where the problem was. Then, you applied the same profiling approach to an in-tree driver and saw how it works with the full kernel. While the example was simple, you can use these methods for more complex, real-world drivers and situations.
10+
In this Learning path, you learned how to build and profile Linux kernel modules step-by-step. You started with an out-of-tree character driver that had a cache performance issue and then used Arm Streamline to spot where the problem was. Later, you tried the same idea with an in-tree driver and saw how profiling works with the full kernel. Although the example problem was simple, the same methods apply to complex, real-world drivers and scenarios.
1111

1212
The key takeaway is that profiling isn’t just about making code faster.It’s about understanding how your code talks to the hardware. Streamline provides a clear picture of what’s happening inside the CPU so that you can write better, more efficient drivers. By learning to identify bottlenecks, you'll be more confident in fixing them and avoiding common mistakes in kernel programming.

0 commit comments

Comments
 (0)