summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2003-02-18 05:28:55 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2003-02-18 05:28:55 -0800
commit489d95995850301e3ae622327cd322f4b9077bbd (patch)
treeea1c167714611a50adfcb82b572359ad767b0280 /include/linux
parenta7308dbbc52c9ac0e8b534e3b3e086b32a754fc6 (diff)
[PATCH] consolidate and cleanup profiling code.
Patch from Nikita Danilov <Nikita@Namesys.COM> this moves functions from identical per-architecture arch/*/kernel/profile.c into generic kernel/profile.c. Also, identical {x86,parisc,ppc64,sparc64}_profile_hook()'s are all replaced by the single kernel/profile.c:profile_hook(), which is #defined to noop in include/linux/profile.h if CONFIG_PROFILING is not set.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/profile.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/include/linux/profile.h b/include/linux/profile.h
index 7ee46d4bb3cc..54c9b8b422af 100644
--- a/include/linux/profile.h
+++ b/include/linux/profile.h
@@ -45,6 +45,12 @@ int profile_event_register(enum profile_type, struct notifier_block * n);
int profile_event_unregister(enum profile_type, struct notifier_block * n);
+int register_profile_notifier(struct notifier_block * nb);
+int unregister_profile_notifier(struct notifier_block * nb);
+
+/* profiling hook activated on each timer interrupt */
+void profile_hook(struct pt_regs * regs);
+
#else
static inline int profile_event_register(enum profile_type t, struct notifier_block * n)
@@ -60,7 +66,19 @@ static inline int profile_event_unregister(enum profile_type t, struct notifier_
#define profile_exit_task(a) do { } while (0)
#define profile_exec_unmap(a) do { } while (0)
#define profile_exit_mmap(a) do { } while (0)
-
+
+static inline int register_profile_notifier(struct notifier_block * nb)
+{
+ return -ENOSYS;
+}
+
+static inline int unregister_profile_notifier(struct notifier_block * nb)
+{
+ return -ENOSYS;
+}
+
+#define profile_hook(regs) do { } while (0)
+
#endif /* CONFIG_PROFILING */
#endif /* __KERNEL__ */