summaryrefslogtreecommitdiffstats
path: root/runtime/uprobes
diff options
context:
space:
mode:
authorJim Keniston <jkenisto@us.ibm.com>2008-11-03 14:47:12 -0800
committerJim Keniston <jkenisto@us.ibm.com>2008-11-03 14:47:12 -0800
commit904b272c43bf358300719d01836bcd10c04aa356 (patch)
treec6fdb97c5643780ad37001a421080ff30ec76a5b /runtime/uprobes
parentb8aa3fa820c059f0f8abb4025f464d90d1f9cb9e (diff)
downloadsystemtap-steved-904b272c43bf358300719d01836bcd10c04aa356.tar.gz
systemtap-steved-904b272c43bf358300719d01836bcd10c04aa356.tar.xz
systemtap-steved-904b272c43bf358300719d01836bcd10c04aa356.zip
Add a version of uprobes that works with the 2.6.27 version of utrace.
Diffstat (limited to 'runtime/uprobes')
-rw-r--r--runtime/uprobes/Makefile6
-rw-r--r--runtime/uprobes/uprobes.c13
-rw-r--r--runtime/uprobes/uprobes.h14
3 files changed, 31 insertions, 2 deletions
diff --git a/runtime/uprobes/Makefile b/runtime/uprobes/Makefile
index 40af7aa2..a9630e5a 100644
--- a/runtime/uprobes/Makefile
+++ b/runtime/uprobes/Makefile
@@ -1,8 +1,9 @@
obj-m := uprobes.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
-DEPENDENCIES := $(shell echo uprobes_arch.[ch] uprobes.[ch] uprobes_*.[ch])
-DEPENDENCIES += Makefile $(KDIR)/Module.symvers
+DEPENDENCIES := $(shell echo uprobes.[ch] uprobes_*.[ch])
+DEPENDENCIES += $(shell echo ../uprobes2/uprobes.[ch] ../uprobes2/uprobes_*.[ch])
+DEPENDENCIES += Makefile
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
@@ -13,4 +14,5 @@ uprobes.ko: $(DEPENDENCIES)
clean:
rm -f *.mod.c *.ko *.o .*.cmd *~
+ rm -f Module.markers modules.order Module.symvers
rm -rf .tmp_versions
diff --git a/runtime/uprobes/uprobes.c b/runtime/uprobes/uprobes.c
index 8c187bd1..22d62ecc 100644
--- a/runtime/uprobes/uprobes.c
+++ b/runtime/uprobes/uprobes.c
@@ -1,3 +1,14 @@
+#include <linux/utrace.h>
+#ifndef UTRACE_ACTION_RESUME
+
+/*
+ * Assume the kernel is running the 2008 version of utrace.
+ * Skip the code in this file and instead use uprobes 2.
+ */
+#include "../uprobes2/uprobes.c"
+
+#else /* uprobes 1 (based on original utrace) */
+
/*
* Userspace Probes (UProbes)
* kernel/uprobes_core.c
@@ -2575,3 +2586,5 @@ static int __access_process_vm(struct task_struct *tsk, unsigned long addr, void
#endif
#include "uprobes_arch.c"
MODULE_LICENSE("GPL");
+
+#endif /* uprobes 1 (based on original utrace) */
diff --git a/runtime/uprobes/uprobes.h b/runtime/uprobes/uprobes.h
index dc970bbf..0266cb7d 100644
--- a/runtime/uprobes/uprobes.h
+++ b/runtime/uprobes/uprobes.h
@@ -1,4 +1,16 @@
#ifndef _LINUX_UPROBES_H
+
+#include <linux/utrace.h>
+#ifndef UTRACE_ACTION_RESUME
+
+/*
+ * Assume the kernel is running the 2008 version of utrace.
+ * Skip the code in this file and instead use uprobes 2.
+ */
+#include "../uprobes2/uprobes.h"
+
+#else /* uprobes 1 (based on original utrace) */
+
#define _LINUX_UPROBES_H
/*
* Userspace Probes (UProbes)
@@ -400,4 +412,6 @@ static void uprobe_post_ssout(struct uprobe_task*, struct uprobe_probept*,
#endif /* UPROBES_IMPLEMENTATION */
+#endif /* uprobes 1 (based on original utrace) */
+
#endif /* _LINUX_UPROBES_H */