diff options
Diffstat (limited to 'include/linux/profile.h')
| -rw-r--r-- | include/linux/profile.h | 58 |
1 files changed, 41 insertions, 17 deletions
diff --git a/include/linux/profile.h b/include/linux/profile.h index 05c1cc736937..7e7087239af5 100644 --- a/include/linux/profile.h +++ b/include/linux/profile.h | |||
| @@ -8,8 +8,6 @@ | |||
| 8 | 8 | ||
| 9 | #include <asm/errno.h> | 9 | #include <asm/errno.h> |
| 10 | 10 | ||
| 11 | extern int prof_on __read_mostly; | ||
| 12 | |||
| 13 | #define CPU_PROFILING 1 | 11 | #define CPU_PROFILING 1 |
| 14 | #define SCHED_PROFILING 2 | 12 | #define SCHED_PROFILING 2 |
| 15 | #define SLEEP_PROFILING 3 | 13 | #define SLEEP_PROFILING 3 |
| @@ -19,14 +17,31 @@ struct proc_dir_entry; | |||
| 19 | struct pt_regs; | 17 | struct pt_regs; |
| 20 | struct notifier_block; | 18 | struct notifier_block; |
| 21 | 19 | ||
| 20 | #if defined(CONFIG_PROFILING) && defined(CONFIG_PROC_FS) | ||
| 21 | void create_prof_cpu_mask(struct proc_dir_entry *de); | ||
| 22 | #else | ||
| 23 | static inline void create_prof_cpu_mask(struct proc_dir_entry *de) | ||
| 24 | { | ||
| 25 | } | ||
| 26 | #endif | ||
| 27 | |||
| 28 | enum profile_type { | ||
| 29 | PROFILE_TASK_EXIT, | ||
| 30 | PROFILE_MUNMAP | ||
| 31 | }; | ||
| 32 | |||
| 33 | #ifdef CONFIG_PROFILING | ||
| 34 | |||
| 35 | extern int prof_on __read_mostly; | ||
| 36 | |||
| 22 | /* init basic kernel profiler */ | 37 | /* init basic kernel profiler */ |
| 23 | void __init profile_init(void); | 38 | void __init profile_init(void); |
| 24 | void profile_tick(int); | 39 | void profile_tick(int type); |
| 25 | 40 | ||
| 26 | /* | 41 | /* |
| 27 | * Add multiple profiler hits to a given address: | 42 | * Add multiple profiler hits to a given address: |
| 28 | */ | 43 | */ |
| 29 | void profile_hits(int, void *ip, unsigned int nr_hits); | 44 | void profile_hits(int type, void *ip, unsigned int nr_hits); |
| 30 | 45 | ||
| 31 | /* | 46 | /* |
| 32 | * Single profiler hit: | 47 | * Single profiler hit: |
| @@ -40,19 +55,6 @@ static inline void profile_hit(int type, void *ip) | |||
| 40 | profile_hits(type, ip, 1); | 55 | profile_hits(type, ip, 1); |
| 41 | } | 56 | } |
| 42 | 57 | ||
| 43 | #ifdef CONFIG_PROC_FS | ||
| 44 | void create_prof_cpu_mask(struct proc_dir_entry *); | ||
| 45 | #else | ||
| 46 | #define create_prof_cpu_mask(x) do { (void)(x); } while (0) | ||
| 47 | #endif | ||
| 48 | |||
| 49 | enum profile_type { | ||
| 50 | PROFILE_TASK_EXIT, | ||
| 51 | PROFILE_MUNMAP | ||
| 52 | }; | ||
| 53 | |||
| 54 | #ifdef CONFIG_PROFILING | ||
| 55 | |||
| 56 | struct task_struct; | 58 | struct task_struct; |
| 57 | struct mm_struct; | 59 | struct mm_struct; |
| 58 | 60 | ||
| @@ -80,6 +82,28 @@ struct pt_regs; | |||
| 80 | 82 | ||
| 81 | #else | 83 | #else |
| 82 | 84 | ||
| 85 | #define prof_on 0 | ||
| 86 | |||
| 87 | static inline void profile_init(void) | ||
| 88 | { | ||
| 89 | return; | ||
| 90 | } | ||
| 91 | |||
| 92 | static inline void profile_tick(int type) | ||
| 93 | { | ||
| 94 | return; | ||
| 95 | } | ||
| 96 | |||
| 97 | static inline void profile_hits(int type, void *ip, unsigned int nr_hits) | ||
| 98 | { | ||
| 99 | return; | ||
| 100 | } | ||
| 101 | |||
| 102 | static inline void profile_hit(int type, void *ip) | ||
| 103 | { | ||
| 104 | return; | ||
| 105 | } | ||
| 106 | |||
| 83 | static inline int task_handoff_register(struct notifier_block * n) | 107 | static inline int task_handoff_register(struct notifier_block * n) |
| 84 | { | 108 | { |
| 85 | return -ENOSYS; | 109 | return -ENOSYS; |
