summaryrefslogtreecommitdiffstats
path: root/runtime/probes/where_func
diff options
context:
space:
mode:
authortrz <trz>2005-05-06 19:17:35 +0000
committertrz <trz>2005-05-06 19:17:35 +0000
commitb05e5810e0a5a918619acaaa316215023d50705b (patch)
treea09d7fbada9b2bf3ceb1827a5af23918fb9eb1a6 /runtime/probes/where_func
parent7aa969cf00075426d30cbce164ccaeb8a1b0a2aa (diff)
downloadsystemtap-steved-b05e5810e0a5a918619acaaa316215023d50705b.tar.gz
systemtap-steved-b05e5810e0a5a918619acaaa316215023d50705b.tar.xz
systemtap-steved-b05e5810e0a5a918619acaaa316215023d50705b.zip
updated to use new transport
Diffstat (limited to 'runtime/probes/where_func')
-rw-r--r--runtime/probes/where_func/kprobe_where_funct.c33
-rwxr-xr-xruntime/probes/where_func/stp13
2 files changed, 41 insertions, 5 deletions
diff --git a/runtime/probes/where_func/kprobe_where_funct.c b/runtime/probes/where_func/kprobe_where_funct.c
index 027a40de..960f2290 100644
--- a/runtime/probes/where_func/kprobe_where_funct.c
+++ b/runtime/probes/where_func/kprobe_where_funct.c
@@ -45,12 +45,31 @@ static struct kprobe kp[] = {
};
#define MAX_KPROBES (sizeof(kp)/sizeof(struct kprobe))
+static unsigned n_subbufs = 4;
+module_param(n_subbufs, uint, 0);
+MODULE_PARM_DESC(n_subbufs, "number of sub-buffers per per-cpu buffer");
+
+static unsigned subbuf_size = 65536;
+module_param(subbuf_size, uint, 0);
+MODULE_PARM_DESC(subbuf_size, "size of each per-cpu sub-buffers");
+
+static int pid;
+module_param(pid, int, 0);
+MODULE_PARM_DESC(pid, "daemon pid");
+
int init_module(void)
{
int ret;
-
- if (_stp_netlink_open() < 0)
+
+ if (!pid) {
+ printk("init_dtr: Can't start without daemon pid\n");
return -1;
+ }
+
+ if (_stp_transport_open(n_subbufs, subbuf_size, pid) < 0) {
+ printk("init_dtr: Couldn't open transport\n");
+ return -1;
+ }
funct_locations = _stp_map_new(1000, INT64);
@@ -62,10 +81,15 @@ int init_module(void)
return ret;
}
+static int exited; /* FIXME: this is a stopgap - if we don't do this
+ * and are manually removed, bad things happen */
+
static void probe_exit (void)
{
struct map_node_int64 *ptr;
+ exited = 1;
+
_stp_unregister_kprobes (kp, MAX_KPROBES);
_stp_printf("%s() called %d times.\n", funct_name, count_funct);
@@ -83,7 +107,10 @@ static void probe_exit (void)
void cleanup_module(void)
{
- _stp_netlink_close();
+ if (!exited)
+ probe_exit();
+
+ _stp_transport_close();
}
MODULE_LICENSE("GPL");
diff --git a/runtime/probes/where_func/stp b/runtime/probes/where_func/stp
index d10fcaab..ca0cb63c 100755
--- a/runtime/probes/where_func/stp
+++ b/runtime/probes/where_func/stp
@@ -24,13 +24,22 @@ then
mount -t relayfs relayfs /mnt/relay
fi
-/sbin/insmod $modulename
+STP_CONTROL=`lsmod | grep stp_control |awk '{print $1}'`
+if [ "$STP_CONTROL" != "stp_control" ]
+then
+ /sbin/insmod ../../transport/stp-control.ko
+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
+../../stpd/stpd -b 8192 -n 4 $modulename
+
+# 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