summaryrefslogtreecommitdiffstats
path: root/runtime/probes/bench/bench_io4.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/probes/bench/bench_io4.c')
-rw-r--r--runtime/probes/bench/bench_io4.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/runtime/probes/bench/bench_io4.c b/runtime/probes/bench/bench_io4.c
new file mode 100644
index 00000000..a6b19ab5
--- /dev/null
+++ b/runtime/probes/bench/bench_io4.c
@@ -0,0 +1,45 @@
+#define STP_RELAYFS
+#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);
+}