summaryrefslogtreecommitdiffstats
path: root/runtime/probes/bench/bench_io3.c
diff options
context:
space:
mode:
authorhunt <hunt>2005-08-22 22:19:57 +0000
committerhunt <hunt>2005-08-22 22:19:57 +0000
commitb5e93a155bcaf04e3b2795a70489a8800eb60e97 (patch)
treef39b8053692ae3fe02f507f0a3ea9bb363701c2d /runtime/probes/bench/bench_io3.c
parentdf8fadee215f81b07f809f4d3ebb016e390f2c9b (diff)
downloadsystemtap-steved-b5e93a155bcaf04e3b2795a70489a8800eb60e97.tar.gz
systemtap-steved-b5e93a155bcaf04e3b2795a70489a8800eb60e97.tar.xz
systemtap-steved-b5e93a155bcaf04e3b2795a70489a8800eb60e97.zip
New benchmark: trans_bench.
Diffstat (limited to 'runtime/probes/bench/bench_io3.c')
-rw-r--r--runtime/probes/bench/bench_io3.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/runtime/probes/bench/bench_io3.c b/runtime/probes/bench/bench_io3.c
new file mode 100644
index 00000000..a491edd9
--- /dev/null
+++ b/runtime/probes/bench/bench_io3.c
@@ -0,0 +1,44 @@
+#define STP_NUM_STRINGS 1
+
+#include "runtime.h"
+#include "probes.c"
+
+MODULE_DESCRIPTION("SystemTap probe: bench_io3");
+MODULE_AUTHOR("Martin Hunt");
+
+static int inst_sys_getuid (struct kprobe *p, struct pt_regs *regs)
+{
+ /* print 1000 chars */
+ _stp_printf ("123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\n");
+ _stp_printf ("123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\n");
+ _stp_printf ("123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\n");
+ _stp_printf ("123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\n");
+ _stp_printf ("123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\n");
+ _stp_printf ("123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\n");
+ _stp_printf ("123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\n");
+ _stp_printf ("123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\n");
+ _stp_printf ("123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\n");
+ _stp_printf ("123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\n");
+ _stp_print_flush();
+ return 0;
+}
+
+
+static struct kprobe kp[] = {
+ {
+ .addr = "sys_getuid",
+ .pre_handler = inst_sys_getuid
+ },
+};
+
+#define NUM_KPROBES (sizeof(kp)/sizeof(struct kprobe))
+
+int probe_start(void)
+{
+ return _stp_register_kprobes (kp, NUM_KPROBES);
+}
+
+void probe_exit (void)
+{
+ _stp_unregister_kprobes (kp, NUM_KPROBES);
+}