• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * @file daemon/liblegacy/opd_kernel.h
3  * Dealing with the kernel and kernel module samples
4  *
5  * @remark Copyright 2002 OProfile authors
6  * @remark Read the file COPYING
7  *
8  * @author John Levon
9  * @author Philippe Elie
10  */
11 
12 #ifndef OPD_KERNEL_H
13 #define OPD_KERNEL_H
14 
15 #include "op_types.h"
16 
17 struct opd_proc;
18 
19 /**
20  * opd_init_kernel_image - initialise the kernel image
21  */
22 void opd_init_kernel_image(void);
23 
24 /**
25  * opd_parse_kernel_range - parse the kernel range values
26  */
27 void opd_parse_kernel_range(char const * arg);
28 
29 /**
30  * opd_clear_module_info - clear kernel module information
31  *
32  * Clear and free all kernel module information and reset
33  * values.
34  */
35 void opd_clear_module_info(void);
36 
37 /**
38  * opd_handle_kernel_sample - process a kernel sample
39  * @param eip  EIP value of sample
40  * @param counter  counter number
41  *
42  * Handle a sample in kernel address space or in a module. The sample is
43  * output to the relevant image file.
44  */
45 void opd_handle_kernel_sample(unsigned long eip, u32 counter);
46 
47 /**
48  * opd_eip_is_kernel - is the sample from kernel/module space
49  * @param eip  EIP value
50  *
51  * Returns %1 if eip is in the address space starting at
52  * kernel_start, %0 otherwise.
53  */
54 int opd_eip_is_kernel(unsigned long eip);
55 
56 /**
57  * opd_add_kernel_map - add a module or kernel maps to a proc struct
58  *
59  * @param proc owning proc of the new mapping
60  * @param eip eip inside the new mapping
61  *
62  * We assume than eip >= kernel_start
63  *
64  */
65 void opd_add_kernel_map(struct opd_proc * proc, unsigned long eip);
66 
67 #endif /* OPD_KERNEL_H */
68