Intel® System Debugger User Guide
ID | Date | Version | Classification |
---|---|---|---|
648476 | 10/17/2024 | Confidential |
Break at the Initialization of a Linux* Kernel Module
Follow the steps below to break at the initialization of an out-of-tree (separately compiled) Linux* kernel module.
Prerequisites:
Target connection is successfully established.
Halt the target.
Load Linux* kernel symbols. Follow the instructions above.
Set a function breakpoint on the kernel initialization function:
In the Breakoints view, click View Menu and select Add Function Breakpoint.
In the opened dialog box, select the Regular breakpoint type and specify do_init_module as the function name.
Click Apply and Close to save changes.
On the target system, launch the shell and execute the following command to insert an out-of-tree module:
sudo insmod <module>
where
Return to the Intel(R) System Debugger running on the host system, resume the target, and wait for the breakpoint to get hit.
Once the target is halted, inspect the mod parameter of the function in any of the following ways:
In the Variables view, expand the mod node, locate the init row, and copy its address from the Value column.
In the Expressions view, add the following expression:
mod->init
Set a breakpoint at the address obtained in the previous step:
In the Breakpoints view, click Add Breakpoint.
In the opened dialog box, select the Instruction Breakpoint type and insert the address.
Click OK.
Resume the target.
Once the breakpoint is hit at the module initialization step, you can load the module’s symbols using the Load Linux Kernel Modules from folder button (see instructions in the previous topic).
You can automate the described process using the sample script.