From 979f20e0ecb8d287af1aedf33ac0c3b50ac9003d Mon Sep 17 00:00:00 2001 From: hunt Date: Thu, 7 Apr 2005 15:12:19 +0000 Subject: Update to use relayfs, new I/O. --- runtime/probes/where_func/Makefile | 2 +- runtime/probes/where_func/kprobe_where_funct.c | 27 ++++++++++++------ runtime/probes/where_func/stp | 39 ++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 10 deletions(-) create mode 100755 runtime/probes/where_func/stp (limited to 'runtime/probes/where_func') diff --git a/runtime/probes/where_func/Makefile b/runtime/probes/where_func/Makefile index 1e6b9d2e..431ddc4f 100644 --- a/runtime/probes/where_func/Makefile +++ b/runtime/probes/where_func/Makefile @@ -3,7 +3,7 @@ # # 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) \ +CFLAGS += -I $(STP_RUNTIME) -I $(STP_RUNTIME)/relayfs -D KALLSYMS_LOOKUP_NAME=$(KALLSYMS_LOOKUP_NAME) \ -D KALLSYMS_LOOKUP=$(KALLSYMS_LOOKUP) obj-m := kprobe_where_funct.o diff --git a/runtime/probes/where_func/kprobe_where_funct.c b/runtime/probes/where_func/kprobe_where_funct.c index e527fa03..027a40de 100644 --- a/runtime/probes/where_func/kprobe_where_funct.c +++ b/runtime/probes/where_func/kprobe_where_funct.c @@ -6,9 +6,10 @@ #define HASH_TABLE_BITS 8 #define HASH_TABLE_SIZE (1<val, key1int(ptr), _stp_scbuf); + _stp_printf("%lld\t", ptr->val); + _stp_symbol_print (key1int(ptr)); + _stp_print_flush(); } - + _stp_map_del(funct_locations); } +void cleanup_module(void) +{ + _stp_netlink_close(); +} + MODULE_LICENSE("GPL"); diff --git a/runtime/probes/where_func/stp b/runtime/probes/where_func/stp new file mode 100755 index 00000000..d10fcaab --- /dev/null +++ b/runtime/probes/where_func/stp @@ -0,0 +1,39 @@ +#!/bin/bash +if [ -n "$1" ] +then + modulename=$1 +else + echo "Usage: stp modulename" + exit +fi + +RELAYFS=`lsmod | grep relayfs |awk '{print $1}'` +if [ "$RELAYFS" != "relayfs" ] +then + /sbin/insmod ../../relayfs/relayfs.ko +fi + +if [ ! -d "/mnt/relay" ] +then + mkdir /mnt/relay +fi + +MOUNT=`mount | grep relayfs |awk '{print $1}'` +if [ "$MOUNT" != "relayfs" ] +then + mount -t relayfs relayfs /mnt/relay +fi + +/sbin/insmod $modulename + +# print to screen only, 4 8K buffers +#../../stpd/stpd -p -b 8192 -n 4 + +# print to screen and log to files, 4 8K buffers +../../stpd/stpd -b 8192 -n 4 + +# no screen or log +#../../stpd/stpd -q -b 8192 -n 4 + +# stpd will remove module when it exits +#/sbin/rmmod $modulename -- cgit