Sponsored Content
Top Forums Programming Debugging Linux Kernel Modules Post 302597800 by rupeshkp728 on Sunday 12th of February 2012 08:34:48 AM
Old 02-12-2012
Debugging Linux Kernel Modules

I am aware of debugging linux applications using gdb and ddd.
Now I have written a simple kernel module having init_module, exit _module and some functions for tasklets and workqueues.
I want to debug these kernel modules like I used to debug applications setting breakpoints etc.
How can I debug linux kernel modules?
How to attach gdb to the modules and how to set breakpoints in them?
 

9 More Discussions You Might Find Interesting

1. SuSE

How do I load kernel modules so BestCrypt will work

I'm using SuSE 9.2 Pro and trying to use a program call BestCrypt. I get it installed and type bctool and it says "Kernel modules not loaded". If you need to know anymore about it you can find it at http://www.jetico.com/linux/bcrypt-help/index.htm linux:/home/chris/Desktop/Xtheater-0.9.2 #... (6 Replies)
Discussion started by: CTroxtell21
6 Replies

2. HP-UX

Information about kernel modules

Hi all, what do kernel modules libaudit, klog and strlog do? Specifically I want to determine if it was possible for us to determine if kernel level auditing is enabled at all? regards (0 Replies)
Discussion started by: slash_blog
0 Replies

3. UNIX for Advanced & Expert Users

Kernel Modules Not geting built

I installed in VM the Mandriva Linux with 2.6.27 kernel. But presently when I fire make the modules .ko does not get built. I get the following output on firing command in the kernel module folder. $ make Building first_driver.c ... make: Entering directory... (1 Reply)
Discussion started by: rupeshkp728
1 Replies

4. Emergency UNIX and Linux Support

Linux: passing parameters to kernel modules

Hi, I need to set qlogic qla2xxx parameters in /etc/modprobe.conf (Oracle Linux Server release 5.7, almost equal to RedHat 5.7) two questions: how can I pass this parameters to the module while it is loaded (fibre channel luns are in use), if possible at all and how can I check the... (3 Replies)
Discussion started by: funksen
3 Replies

5. UNIX for Dummies Questions & Answers

Linux kernel modules makefiles doubts

This query is regarding the makefiles of linux kernel modules. I saw at some sites on net it is suggesting to include the following path: KERNEL_SOURCE := /usr/src/linux... while at some places it is askibg to include /lib/modules path: KERNEL_SOURCE := /lib/modules/2.6.27-7-generic/build... (0 Replies)
Discussion started by: rupeshkp728
0 Replies

6. UNIX for Advanced & Expert Users

Kernel Module Debugging

Question may seem illogical but I still need clarification. Can we debug kernel modules loaded on my target system using kdb / kgdb without using any other system or remote debugging? In other words my question is can we use kdb/kgdb to debug kernel modules running on same system? (2 Replies)
Discussion started by: rupeshkp728
2 Replies

7. Hardware

Linux Kernel Modules

Hey everyone. I have a question, doing an lsmod gives me a list of all the loaded modules for my system. But how did they know to load? my /etc/modules files is empty, so how did these modules know to load themselves on boot time? If I were to take this hard drive to another computer with a... (6 Replies)
Discussion started by: Lost in Cyberia
6 Replies

8. Linux

Disable loading kernel modules

Hi, I am running CentOS 6.5 and I want to remove auto loading 8021q and garp modules, but there are no configure files in /etc/modprobe.d define bot modules. I even added both module names to /etc/modprobe.d/blacklist.conf, both of them are still loaded after the reboot. How can I disable... (2 Replies)
Discussion started by: hce
2 Replies

9. UNIX for Beginners Questions & Answers

Missing Modules After Compiling Kernel

I'm a little embarrassed after all these years I've never really successfully compiled my own kernel. I used this guide to make the following files: linux-headers-5.1.9_5.1.9-1_amd64.deb linux-image-5.1.9_5.1.9-1_amd64.deb linux-libc-dev_5.1.9-1_amd64.deb When I first booted into this... (4 Replies)
Discussion started by: Azrael
4 Replies
STAP(7) 						 Miscellaneous Information Manual						   STAP(7)

NAME
stappaths - systemtap miscellaneous and paths DESCRIPTION
This manual page was generated on 2013-05-14 for systemtap 1.7. The following section will list the main paths in systemtap that are important to know and may be required to reference. Tapset Path: /usr/share/systemtap/tapset/ Systemtap data directory for cached systemtap files, unless overridden by the SYSTEMTAP_TAPSET environment variable or the XDG_DATA_DIRS environment variable. This directory stores a set of builtin functions and probe point aliases are provided by the scripts installed here. These are described in the stapfuncs(3stap) and stapprobes(3stap) manual pages. Runtime Path: /usr/share/systemtap/runtime/ The runtime sources, unless overridden by the SYSTEMTAP_RUNTIME environment variable. Staprun Path: /usr/bin/staprun The auxiliary program supervising module loading, interaction, and unloading. Stapio Path: /usr/lib/systemtap/stapio The Systemtap module input and output handler. sdt.h Path: /usr/include/sys/sdt.h Kernel debuginfo Path: /usr/lib/debug/lib/modules/$(uname -r)/ The location of kernel debugging information when packaged into the kernel-debuginfo RPM, unless overridden by the SYSTEMTAP_DEBUG- INFO_PATH environment variable. The default value for this variable is +:.debug:/usr/lib/debug:build and can be changed using $env SYSTEMTAP_DEBUGINFO_PATH=/path/to/vmlinux . Elfutils searches vmlinux in this path and it interprets the path as a base directory of which various subdirectories will be searched for finding modules. By default, systemtap will also look for vmlinux in these locations: /boot/vmlinux-`uname -r` /lib/modules/`uname -r`/vmlinux /lib/modules/`uname -r`/vmlinux.debug /lib/modules/`uname -r`/build/vmlinux /lib/modules/`uname -r`/.debug/vmlinux.debug /usr/lib/debug/lib/modules/`uname -r`/vmlinux.debug /var/cache/abrt-di/usr/debug/lib/modules/`uname -r`/ /var/cache/abrt-di/usr/lib/debug/lib/modules/`uname -r`/vmlinux.debug Debuginfo for user-space applications have source files located in /usr/src/debug/ Further file information on user-space applica- tions can be determined per-basis using rpm -ql <package>-debuginfo. For supported user-space applications information please visit the systemtap wiki. $HOME/.systemtap Systemtap data directory for cached systemtap files, unless overridden by the SYSTEMTAP_DIR environment variable. /tmp/stapXXXXXX Temporary directory for systemtap files, including translated C code and kernel object. /lib/modules/VERSION/build The location of kernel module building infrastructure. /usr/share/doc/systemtap*/examples Examples with greater detail, can be found here. Each example comes with a .txt or .meta file explaining what the example, sample or demo does and how it is ordinarily run. $SYSTEMTAP_DIR/ssl/server User's server-side SSL certificate database. If SYSTEMTAP_DIR is not set, the default is $HOME/.systemtap. $SYSTEMTAP_DIR/ssl/client User's private client-side SSL certificate database. If SYSTEMTAP_DIR is not set, the default is $HOME/.systemtap. /etc/systemtap/ssl/client Global client-side SSL certificate database. /etc/systemtap/staprun/ staprun's trusted signer certificate database. /etc/sysconfig/stap-server/ stap-server service global configuration file. /etc/stap-server/conf.d/*.conf stap-server service configuration files for default servers. /var/run/stap-server/ stap-server service default location of status files for running servers. /var/log/stap-server/log stap-server service default log file. FILES
/usr/share/systemtap/tapset SEE ALSO
stapprobes(3stap), stapfuncs(3stap), staprun(8), stapvars(3stap), stapex(3stap), stap-server(8), awk(1), gdb(1) BUGS
Use the Bugzilla link of the project web page or our mailing list. http://sourceware.org/systemtap/,<systemtap@sourceware.org>. Systemtap Team STAP(7)
All times are GMT -4. The time now is 05:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy