summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohn Levon <levon@movementarian.org>2002-10-15 04:30:26 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-10-15 04:30:26 -0700
commit19bb2ab92d37ae85fc6d4cb6ae1fea6a8de027b1 (patch)
tree5ad54f2904c7c1debc965c1b201d5005d1436733 /include
parentdec3735ebf58a4691a0fb2df38a7f1a7c63fdb7d (diff)
[PATCH] oprofile - hooks
This implements the simple hooks we need to catch unmappings, and to make sure no stale task_struct*'s are ever used by the main oprofile core mechanism. If disabled, it compiles to nothing.
Diffstat (limited to 'include')
-rw-r--r--include/linux/profile.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/include/linux/profile.h b/include/linux/profile.h
new file mode 100644
index 000000000000..15c1e91198b0
--- /dev/null
+++ b/include/linux/profile.h
@@ -0,0 +1,56 @@
+#ifndef _LINUX_PROFILE_H
+#define _LINUX_PROFILE_H
+
+#ifdef __KERNEL__
+
+#include <linux/kernel.h>
+#include <linux/config.h>
+#include <linux/init.h>
+#include <asm/errno.h>
+
+enum profile_type {
+ EXIT_TASK,
+ EXIT_MMAP,
+ EXEC_UNMAP
+};
+
+#ifdef CONFIG_PROFILING
+
+struct notifier_block;
+struct task_struct;
+struct mm_struct;
+
+/* task is in do_exit() */
+void profile_exit_task(struct task_struct * task);
+
+/* change of vma mappings */
+void profile_exec_unmap(struct mm_struct * mm);
+
+/* exit of all vmas for a task */
+void profile_exit_mmap(struct mm_struct * mm);
+
+int profile_event_register(enum profile_type, struct notifier_block * n);
+
+int profile_event_unregister(enum profile_type, struct notifier_block * n);
+
+#else
+
+static inline int profile_event_register(enum profile_type t, struct notifier_block * n)
+{
+ return -ENOSYS;
+}
+
+static inline int profile_event_unregister(enum profile_type t, struct notifier_block * n)
+{
+ return -ENOSYS;
+}
+
+#define profile_exit_task(a) do { } while (0)
+#define profile_exec_unmap(a) do { } while (0)
+#define profile_exit_mmap(a) do { } while (0)
+
+#endif /* CONFIG_PROFILING */
+
+#endif /* __KERNEL__ */
+
+#endif /* _LINUX_PROFILE_H */