You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/5_intree_kernel_driver.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
-
title: Build the in-tree kernel driver
2
+
title: Integrate a custom character device driver into the Linux kernel
3
3
weight: 6
4
4
5
5
### FIXED, DO NOT MODIFY
6
6
layout: learningpathall
7
7
---
8
8
9
-
## Build an in-tree Linux kernel driver
9
+
## Overview
10
10
11
11
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.
12
12
@@ -16,7 +16,7 @@ Use the same example character driver you used earlier `mychardrv`. This time, y
16
16
17
17
Go to your kernel source directory, in our case, it's located in Buildroot's output directory in `$(BUILDROOT_HOME)/output/build/linux-custom`.
18
18
19
-
Copy the `mychardrv.c` file created earlier to `drivers/char` directory.
19
+
Copy the `mychardrv.c` file created earlier to `drivers/char` directory:
Copy file name to clipboardExpand all lines: content/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/6_sl_profile_intree.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,18 +10,18 @@ layout: learningpathall
10
10
11
11
Profiling in-tree drivers follows almost the same process as profiling an out-of-tree kernel module. The steps include:
12
12
13
-
1. Transferring `gator` to the target device using scp.
13
+
- Transferring `gator` to the target device using scp
14
14
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
16
16
17
-
3. Setting up counters and enabling Event-Based Sampling (EBS).
17
+
- Setting up counters and enabling Event-Based Sampling (EBS)
18
18
19
19
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.
20
20
21
-

21
+

22
22
23
23
After clicking Save in Capture settings dialog, you can start the capture and analyze it as you did before.
24
-

24
+

25
25
26
26
Since you used `vmlinux` image, you can view the driver functions as well as all other kernel functions that were sampled during the capture.
Copy file name to clipboardExpand all lines: content/learning-paths/embedded-and-microcontrollers/streamline-kernel-module/8_summary.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,6 @@ layout: learningpathall
7
7
---
8
8
## Summary
9
9
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.
11
11
12
12
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