diff options
Diffstat (limited to 'runtime/probes/where_func')
-rw-r--r-- | runtime/probes/where_func/README | 29 | ||||
-rwxr-xr-x | runtime/probes/where_func/build | 2 | ||||
-rw-r--r-- | runtime/probes/where_func/kprobe_where_funct.c | 62 | ||||
-rw-r--r-- | runtime/probes/where_func/targets | 1 |
4 files changed, 0 insertions, 94 deletions
diff --git a/runtime/probes/where_func/README b/runtime/probes/where_func/README deleted file mode 100644 index 78009566..00000000 --- a/runtime/probes/where_func/README +++ /dev/null @@ -1,29 +0,0 @@ -/** @dir where_func -This is a silly little instrumentation routine to instrument functions -entry by name. It makes use of the SystemTap runtime libraries to break -down the number of times the function by caller. - -It demonstrates kprobes, passing a module parameter, using the print buffer, -and using _stp_print_symbol() to map the addresses back to locations -in functions. - -By default it instruments schedule(). - -The instrumentation module is built by having the kernel that is going -to be instrumented currently on the machine and doing -\code -./build -\endcode -The instrumentation is inserted as root with: -\code -/sbin/insmod kprobe_funct_where.ko funct_name=function_name -\endcode -The instrumentation is removed as root with: -\code -/sbin/rmmod kprobe_funct_where -\endcode --Will Cohen - -Note that this module is broken now because we don't pass the module parameter -tp staprun. FIXME -*/ diff --git a/runtime/probes/where_func/build b/runtime/probes/where_func/build deleted file mode 100755 index f3e83244..00000000 --- a/runtime/probes/where_func/build +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -../build_probe $* diff --git a/runtime/probes/where_func/kprobe_where_funct.c b/runtime/probes/where_func/kprobe_where_funct.c deleted file mode 100644 index 680dabd8..00000000 --- a/runtime/probes/where_func/kprobe_where_funct.c +++ /dev/null @@ -1,62 +0,0 @@ -/* kprobe_where_funct.c - this is a simple module to get information about calls to a function - that is passed as a module option - Will Cohen -*/ - -#define STP_NUM_STRINGS 1 - -#include "runtime.h" - -#define VALUE_TYPE INT64 -#define KEY1_TYPE INT64 -#include "map-gen.c" - -#include "map.c" -#include "probes.c" -#include "sym.c" -#include "current.c" - -MODULE_DESCRIPTION("SystemTap probe: where_func"); -MODULE_AUTHOR("Will Cohen and Martin Hunt"); - -static char default_name[] = "schedule"; -static char *funct_name = default_name; -module_param(funct_name, charp, 0); -MODULE_PARM_DESC(funct_name, "function entry name.\n"); - -MAP funct_locations; - -static int inst_funct(struct kprobe *p, struct pt_regs *regs) -{ - long ret_addr = _stp_ret_addr(regs); - _stp_map_add_ii(funct_locations, ret_addr, 1); - return 0; -} - -/*For each probe you need to allocate a kprobe structure*/ -static struct kprobe kp[] = { - { - .addr = default_name, - .pre_handler = inst_funct, - } -}; -#define MAX_KPROBES (sizeof(kp)/sizeof(struct kprobe)) - -int probe_start(void) -{ - funct_locations = _stp_map_new_ii (1000); - - if (funct_name) - kp[0].addr = funct_name; - - return _stp_register_kprobes (kp, MAX_KPROBES); -} - -void probe_exit (void) -{ - _stp_unregister_kprobes (kp, MAX_KPROBES); - - _stp_map_print (funct_locations, "Count: %d\tCaller: %1P"); - _stp_map_del(funct_locations); -} diff --git a/runtime/probes/where_func/targets b/runtime/probes/where_func/targets deleted file mode 100644 index 7e8e4cf1..00000000 --- a/runtime/probes/where_func/targets +++ /dev/null @@ -1 +0,0 @@ -kprobe_where_funct |