summaryrefslogtreecommitdiffstats
path: root/runtime/docs/examples
diff options
context:
space:
mode:
authorhunt <hunt>2005-07-08 20:54:30 +0000
committerhunt <hunt>2005-07-08 20:54:30 +0000
commit71a14c5320f8ac771dc400c053a9c738fbf3c0a2 (patch)
tree7c6a433a04f49755f36b9dda5f3e52e653d1c332 /runtime/docs/examples
parent388451654e4651d9abf99cc97d927f3b97fc31d3 (diff)
downloadsystemtap-steved-71a14c5320f8ac771dc400c053a9c738fbf3c0a2.tar.gz
systemtap-steved-71a14c5320f8ac771dc400c053a9c738fbf3c0a2.tar.xz
systemtap-steved-71a14c5320f8ac771dc400c053a9c738fbf3c0a2.zip
Update.
Diffstat (limited to 'runtime/docs/examples')
-rw-r--r--runtime/docs/examples/template.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/runtime/docs/examples/template.c b/runtime/docs/examples/template.c
index 68d821fe..73cbc06e 100644
--- a/runtime/docs/examples/template.c
+++ b/runtime/docs/examples/template.c
@@ -95,18 +95,19 @@ static struct kprobe kp[] = {
#define NUM_KPROBES (sizeof(kp)/sizeof(struct kprobe))
/* called when the module loads. */
-int init_module(void)
+int probe_start(void)
{
- int ret;
+ /* initialize any data or variables */
- TRANSPORT_OPEN;
/* register any jprobes */
- ret = _stp_register_jprobes (jp, NUM_JPROBES);
+ int ret = _stp_register_jprobes (jp, NUM_JPROBES);
- /* register any kprobes */
+ /* Register any kprobes and jprobes. */
+ /* You probably only have one type */
if (ret >= 0)
- ret = _stp_register_kprobes (kp, NUM_KPROBES);
+ if ((ret = _stp_register_kprobes (kp, NUM_KPROBES)) < 0)
+ _stp_unregister_jprobes (jp, NUM_JPROBES);
return ret;
}
@@ -122,11 +123,3 @@ static void probe_exit (void)
_stp_printf ("whatever I want to say\n");
_stp_print_flush();
}
-
-/* required */
-void cleanup_module(void)
-{
- _stp_transport_close();
-}
-
-MODULE_LICENSE("GPL");