summaryrefslogtreecommitdiffstats
path: root/runtime/probes/test4
diff options
context:
space:
mode:
authorhunt <hunt>2005-07-08 20:49:58 +0000
committerhunt <hunt>2005-07-08 20:49:58 +0000
commit14e686e8fbd7b16171f7fc643dd99c3479673752 (patch)
treeecd203c2d76882bdb210968be6f844d13fec2232 /runtime/probes/test4
parentb6fe3ed55d5a00ac2749ae27fff67abe8e72c21b (diff)
downloadsystemtap-steved-14e686e8fbd7b16171f7fc643dd99c3479673752.tar.gz
systemtap-steved-14e686e8fbd7b16171f7fc643dd99c3479673752.tar.xz
systemtap-steved-14e686e8fbd7b16171f7fc643dd99c3479673752.zip
2005-07-08 Martin Hunt <hunt@redhat.com>
* ALL: Use new runtime.h. Change init_module() to probe_start() and don't do transport calls. Remove MODULE_LICENSE and cleanup_module().
Diffstat (limited to 'runtime/probes/test4')
-rw-r--r--runtime/probes/test4/test4.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/runtime/probes/test4/test4.c b/runtime/probes/test4/test4.c
index 313228e9..3f9c8325 100644
--- a/runtime/probes/test4/test4.c
+++ b/runtime/probes/test4/test4.c
@@ -59,20 +59,12 @@ static struct jprobe stp_probes[] = {
#define MAX_STP_ROUTINE (sizeof(stp_probes)/sizeof(struct jprobe))
-int init_module(void)
+int probe_start(void)
{
- int ret;
-
- TRANSPORT_OPEN;
-
- /* 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);
-
- ret = _stp_register_jprobes (stp_probes, MAX_STP_ROUTINE);
-
- return ret;
+ return _stp_register_jprobes (stp_probes, MAX_STP_ROUTINE);
}
static void probe_exit (void)
@@ -82,16 +74,9 @@ static void probe_exit (void)
_stp_map_print (opens,"%d opens by process \"%1s\"");
_stp_map_print (reads,"reads by process \"%1s\": %C. Total bytes=%S. Average: %A\n%H");
_stp_map_print (writes,"writes by process \"%1s\": %C. Total bytes=%S. Average: %A\n%H");
-
+ _stp_printf("\nDropped %d packets\n", atomic_read(&_stp_transport_failures));
+ _stp_print_flush();
_stp_map_del (opens);
_stp_map_del (reads);
_stp_map_del (writes);
}
-
-void cleanup_module(void)
-{
- _stp_transport_close();
-}
-
-MODULE_LICENSE("GPL");
-