diff options
Diffstat (limited to 'include/linux/profile.h')
-rw-r--r-- | include/linux/profile.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/linux/profile.h b/include/linux/profile.h index acce53fd38b..eec48f5f934 100644 --- a/include/linux/profile.h +++ b/include/linux/profile.h | |||
@@ -6,10 +6,16 @@ | |||
6 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
7 | #include <linux/init.h> | 7 | #include <linux/init.h> |
8 | #include <linux/cpumask.h> | 8 | #include <linux/cpumask.h> |
9 | #include <linux/cache.h> | ||
10 | |||
9 | #include <asm/errno.h> | 11 | #include <asm/errno.h> |
10 | 12 | ||
13 | extern int prof_on __read_mostly; | ||
14 | |||
11 | #define CPU_PROFILING 1 | 15 | #define CPU_PROFILING 1 |
12 | #define SCHED_PROFILING 2 | 16 | #define SCHED_PROFILING 2 |
17 | #define SLEEP_PROFILING 3 | ||
18 | #define KVM_PROFILING 4 | ||
13 | 19 | ||
14 | struct proc_dir_entry; | 20 | struct proc_dir_entry; |
15 | struct pt_regs; | 21 | struct pt_regs; |
@@ -18,7 +24,24 @@ struct notifier_block; | |||
18 | /* init basic kernel profiler */ | 24 | /* init basic kernel profiler */ |
19 | void __init profile_init(void); | 25 | void __init profile_init(void); |
20 | void profile_tick(int); | 26 | void profile_tick(int); |
21 | void profile_hit(int, void *); | 27 | |
28 | /* | ||
29 | * Add multiple profiler hits to a given address: | ||
30 | */ | ||
31 | void profile_hits(int, void *ip, unsigned int nr_hits); | ||
32 | |||
33 | /* | ||
34 | * Single profiler hit: | ||
35 | */ | ||
36 | static inline void profile_hit(int type, void *ip) | ||
37 | { | ||
38 | /* | ||
39 | * Speedup for the common (no profiling enabled) case: | ||
40 | */ | ||
41 | if (unlikely(prof_on == type)) | ||
42 | profile_hits(type, ip, 1); | ||
43 | } | ||
44 | |||
22 | #ifdef CONFIG_PROC_FS | 45 | #ifdef CONFIG_PROC_FS |
23 | void create_prof_cpu_mask(struct proc_dir_entry *); | 46 | void create_prof_cpu_mask(struct proc_dir_entry *); |
24 | #else | 47 | #else |