1 #ifndef _LINUX_PROFILE_H
2 #define _LINUX_PROFILE_H
6 #include <linux/kernel.h>
7 #include <linux/config.h>
8 #include <linux/init.h>
11 /* parse command line */
12 int __init
profile_setup(char * str
);
14 /* init basic kernel profiler */
15 void __init
profile_init(void);
17 extern unsigned int * prof_buffer
;
18 extern unsigned long prof_len
;
19 extern unsigned long prof_shift
;
29 #ifdef CONFIG_PROFILING
31 struct notifier_block
;
35 /* task is in do_exit() */
36 void profile_exit_task(struct task_struct
* task
);
38 /* change of vma mappings */
39 void profile_exec_unmap(struct mm_struct
* mm
);
41 /* exit of all vmas for a task */
42 void profile_exit_mmap(struct mm_struct
* mm
);
44 int profile_event_register(enum profile_type
, struct notifier_block
* n
);
46 int profile_event_unregister(enum profile_type
, struct notifier_block
* n
);
48 int register_profile_notifier(struct notifier_block
* nb
);
49 int unregister_profile_notifier(struct notifier_block
* nb
);
53 /* profiling hook activated on each timer interrupt */
54 void profile_hook(struct pt_regs
* regs
);
58 static inline int profile_event_register(enum profile_type t
, struct notifier_block
* n
)
63 static inline int profile_event_unregister(enum profile_type t
, struct notifier_block
* n
)
68 #define profile_exit_task(a) do { } while (0)
69 #define profile_exec_unmap(a) do { } while (0)
70 #define profile_exit_mmap(a) do { } while (0)
72 static inline int register_profile_notifier(struct notifier_block
* nb
)
77 static inline int unregister_profile_notifier(struct notifier_block
* nb
)
82 #define profile_hook(regs) do { } while (0)
84 #endif /* CONFIG_PROFILING */
86 #endif /* __KERNEL__ */
88 #endif /* _LINUX_PROFILE_H */