summaryrefslogtreecommitdiffstats
path: root/runtime/utrace_compatibility.h
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-08-21 13:26:56 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-08-21 13:26:56 -0400
commiteaf7e3121e673d7f5a7b383ab9563766f1e83ff0 (patch)
tree0c1e415b03cc4f11667f6b4d8cb1cf8104b82d5e /runtime/utrace_compatibility.h
parentc569c2e4973296701cd4caff35847e2fde32754a (diff)
parent46b3c6cd16e7aba1a5a26b310ee128bfdc7897fa (diff)
downloadsystemtap-steved-eaf7e3121e673d7f5a7b383ab9563766f1e83ff0.tar.gz
systemtap-steved-eaf7e3121e673d7f5a7b383ab9563766f1e83ff0.tar.xz
systemtap-steved-eaf7e3121e673d7f5a7b383ab9563766f1e83ff0.zip
Merge commit 'origin/master' into pr4225
* commit 'origin/master': Added task finder target parameter to vm_callback functions. Supports original and new utrace interfaces. Add ChangeLog entries stap client/server now pass 'make installcheck' Looks for both mmap and mmap2. PR 6841 fix. Add missing 'process' bindings.
Diffstat (limited to 'runtime/utrace_compatibility.h')
-rw-r--r--runtime/utrace_compatibility.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/runtime/utrace_compatibility.h b/runtime/utrace_compatibility.h
new file mode 100644
index 00000000..80037015
--- /dev/null
+++ b/runtime/utrace_compatibility.h
@@ -0,0 +1,57 @@
+/*
+ * utrace compatibility defines and inlines
+ * Copyright (C) 2008 Red Hat Inc.
+ *
+ * This file is part of systemtap, and is free software. You can
+ * redistribute it and/or modify it under the terms of the GNU General
+ * Public License (GPL); either version 2, or (at your option) any
+ * later version.
+ */
+
+#ifndef _UTRACE_COMPATIBILITY_H_
+#define _UTRACE_COMPATIBILITY_H_
+
+#include <linux/utrace.h>
+
+#ifdef UTRACE_ACTION_RESUME
+
+/*
+ * If UTRACE_ACTION_RESUME is defined after including utrace.h, we've
+ * got the original version of utrace. So that utrace clients can be
+ * written using the new interface (mostly), provide a (very thin)
+ * compatibility layer that hides the differences.
+ */
+
+#define UTRACE_ORIG_VERSION
+
+#define UTRACE_RESUME UTRACE_ACTION_RESUME
+#define UTRACE_DETACH UTRACE_ACTION_DETACH
+#define UTRACE_STOP UTRACE_ACTION_QUIESCE
+
+static inline struct utrace_attached_engine *
+utrace_attach_task(struct task_struct *target, int flags,
+ const struct utrace_engine_ops *ops, void *data)
+{
+ return utrace_attach(target, flags, ops, data);
+}
+
+static inline int __must_check
+utrace_control(struct task_struct *target,
+ struct utrace_attached_engine *engine,
+ unsigned long action)
+{
+ if (action == UTRACE_DETACH)
+ return utrace_detach(target, engine);
+ return -EINVAL;
+}
+
+static inline int __must_check
+utrace_set_events(struct task_struct *target,
+ struct utrace_attached_engine *engine,
+ unsigned long eventmask)
+{
+ return utrace_set_flags(target, engine, eventmask);
+}
+#endif
+
+#endif /* _UTRACE_COMPATIBILITY_H_ */