summaryrefslogtreecommitdiffstats
path: root/runtime/probes/tasklet
diff options
context:
space:
mode:
authorhunt <hunt>2005-03-21 21:11:13 +0000
committerhunt <hunt>2005-03-21 21:11:13 +0000
commit854d896bebf48714b6e14b73d4eab6d9c856aa52 (patch)
tree1d524e16590c348de6f8ca27884f4f74ea34eadf /runtime/probes/tasklet
parente10ae0b0a445c70eafed2e6a7e8991191f023445 (diff)
downloadsystemtap-steved-854d896bebf48714b6e14b73d4eab6d9c856aa52.tar.gz
systemtap-steved-854d896bebf48714b6e14b73d4eab6d9c856aa52.tar.xz
systemtap-steved-854d896bebf48714b6e14b73d4eab6d9c856aa52.zip
*** empty log message ***
Diffstat (limited to 'runtime/probes/tasklet')
-rw-r--r--runtime/probes/tasklet/Makefile11
-rw-r--r--runtime/probes/tasklet/README6
-rwxr-xr-xruntime/probes/tasklet/build16
-rw-r--r--runtime/probes/tasklet/stp_tasklet.c48
4 files changed, 81 insertions, 0 deletions
diff --git a/runtime/probes/tasklet/Makefile b/runtime/probes/tasklet/Makefile
new file mode 100644
index 00000000..369929c4
--- /dev/null
+++ b/runtime/probes/tasklet/Makefile
@@ -0,0 +1,11 @@
+# Makefile
+#
+#
+# make -C path/to/kernel/src M=`pwd` modules STP_RUNTIME=path_to_systemtap_rt
+
+CFLAGS += -I $(STP_RUNTIME) -D KALLSYMS_LOOKUP_NAME=$(KALLSYMS_LOOKUP_NAME)\
+ -D KALLSYMS_LOOKUP=$(KALLSYMS_LOOKUP)
+obj-m := stp_tasklet.o
+
+clean:
+ /bin/rm -rf *.o *.ko *~ *.mod.c .*.cmd .tmp_versions
diff --git a/runtime/probes/tasklet/README b/runtime/probes/tasklet/README
new file mode 100644
index 00000000..12efdc46
--- /dev/null
+++ b/runtime/probes/tasklet/README
@@ -0,0 +1,6 @@
+Sample probe. Useful for interrupt context testing.
+
+> ./build
+> insmod stp_tasklet.ko
+> rmmod stp_tasklet.ko
+
diff --git a/runtime/probes/tasklet/build b/runtime/probes/tasklet/build
new file mode 100755
index 00000000..3713f08a
--- /dev/null
+++ b/runtime/probes/tasklet/build
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+KVERSION=`uname -r`
+echo $KVERSION
+KALLSYMS_LOOKUP_NAME=`grep " kallsyms_lookup_name" /boot/System.map-$KVERSION |awk '{print $1}'`
+KALLSYMS_LOOKUP=`grep " kallsyms_lookup$" /boot/System.map-$KVERSION |awk '{print $1}'`
+
+make V=1 -C /lib/modules/`uname -r`/build M=`pwd` modules \
+ KALLSYMS_LOOKUP_NAME=0x$KALLSYMS_LOOKUP_NAME \
+ KALLSYMS_LOOKUP=0x$KALLSYMS_LOOKUP \
+ STP_RUNTIME=`pwd`/../..
+
+
+
+
+
diff --git a/runtime/probes/tasklet/stp_tasklet.c b/runtime/probes/tasklet/stp_tasklet.c
new file mode 100644
index 00000000..aadb0c4c
--- /dev/null
+++ b/runtime/probes/tasklet/stp_tasklet.c
@@ -0,0 +1,48 @@
+/* Framework for putting a jprobe in a tasklet. */
+/* Useful for testing probes in interrupt context. */
+/* Doesn't do anything useful as is. Put test code in the inst func */
+
+#define HASH_TABLE_BITS 8
+#define HASH_TABLE_SIZE (1<<HASH_TABLE_BITS)
+#define BUCKETS 16 /* largest histogram width */
+
+#include "runtime.h"
+#include "io.c"
+#include "probes.c"
+
+MODULE_DESCRIPTION("test jprobes of tasklets");
+MODULE_AUTHOR("Martin Hunt <hunt@redhat.com>");
+
+void inst__rcu_process_callbacks(struct rcu_ctrlblk *rcp,
+ struct rcu_state *rsp, struct rcu_data *rdp)
+{
+ dlog ("interrupt=%d\n", in_interrupt());
+ jprobe_return();
+}
+
+static struct jprobe stp_probes[] = {
+ {
+ .kp.addr = (kprobe_opcode_t *)"__rcu_process_callbacks",
+ .entry = (kprobe_opcode_t *) inst__rcu_process_callbacks
+ },
+};
+#define MAX_STP_PROBES (sizeof(stp_probes)/sizeof(struct jprobe))
+
+
+static int init_stp(void)
+{
+ int ret = _stp_register_jprobes (stp_probes, MAX_STP_PROBES);
+ dlog("instrumentation is enabled...\n");
+ return ret;
+}
+
+static void cleanup_stp(void)
+{
+ _stp_unregister_jprobes (stp_probes, MAX_STP_PROBES);
+ dlog ("EXIT\n");
+}
+
+module_init(init_stp);
+module_exit(cleanup_stp);
+MODULE_LICENSE("GPL");
+