summaryrefslogtreecommitdiffstats
path: root/runtime/probes/test4
diff options
context:
space:
mode:
authorhunt <hunt>2005-06-18 07:06:38 +0000
committerhunt <hunt>2005-06-18 07:06:38 +0000
commit22ccaa9985211ad13e8486bf2845114f409df55d (patch)
treedc4c286990a692ef0b5991b81405bb7b10292392 /runtime/probes/test4
parentb55bc428b7e03ce7bcf6ec1eb502f5f443fbd0b8 (diff)
downloadsystemtap-steved-22ccaa9985211ad13e8486bf2845114f409df55d.tar.gz
systemtap-steved-22ccaa9985211ad13e8486bf2845114f409df55d.tar.xz
systemtap-steved-22ccaa9985211ad13e8486bf2845114f409df55d.zip
2005-06-18 Martin Hunt <hunt@redhat.com>
* build: Modified to use build_probe. * build_probe: New file. This does the work of building a single probe or set of probes in a directory. * Makefile.template: New file. Template used by build_probe to create Makefiles. * agg: New set of probes to test/demonstrate Counter and Stat aggregations. * all probes modified for latest changes and new build process.
Diffstat (limited to 'runtime/probes/test4')
-rw-r--r--runtime/probes/test4/Makefile21
-rwxr-xr-xruntime/probes/test4/build2
-rw-r--r--runtime/probes/test4/targets1
-rw-r--r--runtime/probes/test4/test4.c16
4 files changed, 10 insertions, 30 deletions
diff --git a/runtime/probes/test4/Makefile b/runtime/probes/test4/Makefile
deleted file mode 100644
index 60afe8ab..00000000
--- a/runtime/probes/test4/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-# Makefile
-
-PWD := $(shell pwd)
-RT := $(PWD)/../..
-KVERSION := $(shell uname -r)
-KDIR := /lib/modules/$(KVERSION)/build include
-
-KALLSYMS_LOOKUP_NAME := 0x$(firstword $(shell grep " kallsyms_lookup_name" /boot/System.map-$(KVERSION)))
-KALLSYMS_LOOKUP := 0x$(firstword $(shell grep " kallsyms_lookup$$" /boot/System.map-$(KVERSION)))
-KTA := 0x$(firstword $(shell grep "__kernel_text_address" /boot/System.map-$(KVERSION)))
-
-EXTRA_CFLAGS := -I $(RT) -I $(RT)/relayfs -D KALLSYMS_LOOKUP_NAME=$(KALLSYMS_LOOKUP_NAME) -D KALLSYMS_LOOKUP=$(KALLSYMS_LOOKUP) -DKTA=$(KTA)
-
-obj-m := test4.o
-
-
-default:
- $(MAKE) V=1 -C $(KDIR) M=$(PWD) RT=$(RT) modules
-
-clean:
- /bin/rm -rf *.o *.ko *~ *.mod.c .*.cmd .tmp_versions
diff --git a/runtime/probes/test4/build b/runtime/probes/test4/build
new file mode 100755
index 00000000..f3e83244
--- /dev/null
+++ b/runtime/probes/test4/build
@@ -0,0 +1,2 @@
+#!/bin/bash
+../build_probe $*
diff --git a/runtime/probes/test4/targets b/runtime/probes/test4/targets
new file mode 100644
index 00000000..d234c5e0
--- /dev/null
+++ b/runtime/probes/test4/targets
@@ -0,0 +1 @@
+test4
diff --git a/runtime/probes/test4/test4.c b/runtime/probes/test4/test4.c
index f89cc6b9..9867d8ef 100644
--- a/runtime/probes/test4/test4.c
+++ b/runtime/probes/test4/test4.c
@@ -2,15 +2,12 @@
#define STP_NUM_STRINGS 1
#include "runtime.h"
+#define NEED_INT64_VALS
+#define NEED_STAT_VALS
+
#define KEY1_TYPE STRING
#include "map-keys.c"
-#define VALUE_TYPE INT64
-#include "map-values.c"
-
-#define VALUE_TYPE STAT
-#include "map-values.c"
-
#include "map.c"
#include "probes.c"
@@ -31,7 +28,7 @@ asmlinkage long inst_sys_open (const char __user * filename, int flags, int mode
asmlinkage ssize_t inst_sys_read (unsigned int fd, char __user * buf, size_t count)
{
_stp_map_key_str (reads, current->comm);
- _stp_map_add_int64_stat (reads, count);
+ _stp_map_add_int64 (reads, count);
jprobe_return();
return 0;
}
@@ -39,7 +36,7 @@ asmlinkage ssize_t inst_sys_read (unsigned int fd, char __user * buf, size_t cou
asmlinkage ssize_t inst_sys_write (unsigned int fd, const char __user * buf, size_t count)
{
_stp_map_key_str (writes, current->comm);
- _stp_map_add_int64_stat (writes, count);
+ _stp_map_add_int64 (writes, count);
jprobe_return();
return 0;
}
@@ -78,7 +75,8 @@ int init_module(void)
printk("init: Couldn't open transport\n");
return -1;
}
-
+
+ /* FIXME. Check return values */
opens = _stp_map_new_str (1000, INT64);
reads = _stp_map_new_str (1000, HSTAT_LOG, 8);
writes = _stp_map_new_str (1000, HSTAT_LOG, 8);