diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/profile.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'include/linux/profile.h')
-rw-r--r-- | include/linux/profile.h | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/include/linux/profile.h b/include/linux/profile.h new file mode 100644 index 000000000000..026969a5595c --- /dev/null +++ b/include/linux/profile.h | |||
@@ -0,0 +1,104 @@ | |||
1 | #ifndef _LINUX_PROFILE_H | ||
2 | #define _LINUX_PROFILE_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #include <linux/kernel.h> | ||
7 | #include <linux/config.h> | ||
8 | #include <linux/init.h> | ||
9 | #include <linux/cpumask.h> | ||
10 | #include <asm/errno.h> | ||
11 | |||
12 | #define CPU_PROFILING 1 | ||
13 | #define SCHED_PROFILING 2 | ||
14 | |||
15 | struct proc_dir_entry; | ||
16 | struct pt_regs; | ||
17 | |||
18 | /* init basic kernel profiler */ | ||
19 | void __init profile_init(void); | ||
20 | void profile_tick(int, struct pt_regs *); | ||
21 | void profile_hit(int, void *); | ||
22 | #ifdef CONFIG_PROC_FS | ||
23 | void create_prof_cpu_mask(struct proc_dir_entry *); | ||
24 | #else | ||
25 | #define create_prof_cpu_mask(x) do { (void)(x); } while (0) | ||
26 | #endif | ||
27 | |||
28 | enum profile_type { | ||
29 | PROFILE_TASK_EXIT, | ||
30 | PROFILE_MUNMAP | ||
31 | }; | ||
32 | |||
33 | #ifdef CONFIG_PROFILING | ||
34 | |||
35 | struct notifier_block; | ||
36 | struct task_struct; | ||
37 | struct mm_struct; | ||
38 | |||
39 | /* task is in do_exit() */ | ||
40 | void profile_task_exit(struct task_struct * task); | ||
41 | |||
42 | /* task is dead, free task struct ? Returns 1 if | ||
43 | * the task was taken, 0 if the task should be freed. | ||
44 | */ | ||
45 | int profile_handoff_task(struct task_struct * task); | ||
46 | |||
47 | /* sys_munmap */ | ||
48 | void profile_munmap(unsigned long addr); | ||
49 | |||
50 | int task_handoff_register(struct notifier_block * n); | ||
51 | int task_handoff_unregister(struct notifier_block * n); | ||
52 | |||
53 | int profile_event_register(enum profile_type, struct notifier_block * n); | ||
54 | int profile_event_unregister(enum profile_type, struct notifier_block * n); | ||
55 | |||
56 | int register_timer_hook(int (*hook)(struct pt_regs *)); | ||
57 | void unregister_timer_hook(int (*hook)(struct pt_regs *)); | ||
58 | |||
59 | /* Timer based profiling hook */ | ||
60 | extern int (*timer_hook)(struct pt_regs *); | ||
61 | |||
62 | struct pt_regs; | ||
63 | |||
64 | #else | ||
65 | |||
66 | static inline int task_handoff_register(struct notifier_block * n) | ||
67 | { | ||
68 | return -ENOSYS; | ||
69 | } | ||
70 | |||
71 | static inline int task_handoff_unregister(struct notifier_block * n) | ||
72 | { | ||
73 | return -ENOSYS; | ||
74 | } | ||
75 | |||
76 | static inline int profile_event_register(enum profile_type t, struct notifier_block * n) | ||
77 | { | ||
78 | return -ENOSYS; | ||
79 | } | ||
80 | |||
81 | static inline int profile_event_unregister(enum profile_type t, struct notifier_block * n) | ||
82 | { | ||
83 | return -ENOSYS; | ||
84 | } | ||
85 | |||
86 | #define profile_task_exit(a) do { } while (0) | ||
87 | #define profile_handoff_task(a) (0) | ||
88 | #define profile_munmap(a) do { } while (0) | ||
89 | |||
90 | static inline int register_timer_hook(int (*hook)(struct pt_regs *)) | ||
91 | { | ||
92 | return -ENOSYS; | ||
93 | } | ||
94 | |||
95 | static inline void unregister_timer_hook(int (*hook)(struct pt_regs *)) | ||
96 | { | ||
97 | return; | ||
98 | } | ||
99 | |||
100 | #endif /* CONFIG_PROFILING */ | ||
101 | |||
102 | #endif /* __KERNEL__ */ | ||
103 | |||
104 | #endif /* _LINUX_PROFILE_H */ | ||