From 854d896bebf48714b6e14b73d4eab6d9c856aa52 Mon Sep 17 00:00:00 2001 From: hunt Date: Mon, 21 Mar 2005 21:11:13 +0000 Subject: *** empty log message *** --- runtime/probes/tasklet/stp_tasklet.c | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 runtime/probes/tasklet/stp_tasklet.c (limited to 'runtime/probes/tasklet/stp_tasklet.c') 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<"); + +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"); + -- cgit