Also, Linux performs a safety check called “version matching” when it loads a finished kernel module. The headers provide vital definitions that are needed in order to compile the source code for the module. In order to build a kernel module, we need the kernel headers (or kernel source) that match the binary image. Raspbian Wheezy is distributed as a prebuilt binary image. In other words, the source for the kernel module is somewhere in our home directory structure, not the kernel source directory like the standard device drivers that come with Linux. ![]() (The internal design of the module is discussed elsewhere.) We are doing an “out-of-tree” build. ![]() This page describes the process of building, loading and unloading the aprofile.ko kernel module. Our first approach to Raspberry Pi (ARM11) performance measurement uses a loadable kernel module named “aprofile.ko” to set up access to the hardware performance counters. Unlike PERF, which uses a system call (SYSCALL) for user/kernel communication, oprofile used a kernel module to access the performance counters and a user-space daemon process to collect performance event data in the form of samples. Oprofile uses the performance counters to profile kernel- and user-space software. Before there was Performance Events for Linux (PERF), there was the profiling infrastructure called “Oprofile”. Pretty much any functionality can be captured in a loadable kernel module, not just software that communicates with devices like the keyboard, mouse, SD card, etc. A kernel module is a collection of C language routines which implement the device driver functionality while adhering to the Linux conventions and interface for driver software. Linux device drivers reside in loadable kernel modules.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |