diff options
author | hunt <hunt> | 2005-07-08 20:49:58 +0000 |
---|---|---|
committer | hunt <hunt> | 2005-07-08 20:49:58 +0000 |
commit | 14e686e8fbd7b16171f7fc643dd99c3479673752 (patch) | |
tree | ecd203c2d76882bdb210968be6f844d13fec2232 /runtime | |
parent | b6fe3ed55d5a00ac2749ae27fff67abe8e72c21b (diff) | |
download | systemtap-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')
-rw-r--r-- | runtime/probes/ChangeLog | 6 | ||||
-rw-r--r-- | runtime/probes/agg/count1.c | 17 | ||||
-rw-r--r-- | runtime/probes/agg/count2.c | 18 | ||||
-rw-r--r-- | runtime/probes/agg/stat1.c | 17 | ||||
-rw-r--r-- | runtime/probes/bench/bench.c | 16 | ||||
-rw-r--r-- | runtime/probes/bench/bench_io1.c | 16 | ||||
-rw-r--r-- | runtime/probes/bench/bench_io2.c | 16 | ||||
-rw-r--r-- | runtime/probes/bench/bench_multi.c | 16 | ||||
-rw-r--r-- | runtime/probes/bench/bench_ret.c | 20 | ||||
-rw-r--r-- | runtime/probes/scf/scf.c | 16 | ||||
-rw-r--r-- | runtime/probes/shellsnoop/shellsnoop.c | 15 | ||||
-rw-r--r-- | runtime/probes/tasklet/stp_tasklet.c | 15 | ||||
-rw-r--r-- | runtime/probes/test4/test4.c | 23 | ||||
-rw-r--r-- | runtime/probes/where_func/kprobe_where_funct.c | 17 |
14 files changed, 39 insertions, 189 deletions
diff --git a/runtime/probes/ChangeLog b/runtime/probes/ChangeLog index fe634c16..64c5d34e 100644 --- a/runtime/probes/ChangeLog +++ b/runtime/probes/ChangeLog @@ -1,3 +1,9 @@ +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(). + 2005-07-01 Martin Hunt <hunt@redhat.com> * Makefile.template (debug): New target. diff --git a/runtime/probes/agg/count1.c b/runtime/probes/agg/count1.c index 4b0ba1bf..6bf2c39e 100644 --- a/runtime/probes/agg/count1.c +++ b/runtime/probes/agg/count1.c @@ -70,21 +70,15 @@ static struct kprobe stp_probes[] = { #define MAX_STP_ROUTINE (sizeof(stp_probes)/sizeof(struct kprobe)) -int init_module(void) +int probe_start(void) { - int ret; - - TRANSPORT_OPEN; - opens = _stp_counter_init(); reads = _stp_counter_init(); writes = _stp_counter_init(); sched = _stp_counter_init(); idle = _stp_counter_init(); - ret = _stp_register_kprobes (stp_probes, MAX_STP_ROUTINE); - - return ret; + return _stp_register_kprobes (stp_probes, MAX_STP_ROUTINE); } static void probe_exit (void) @@ -106,10 +100,3 @@ static void probe_exit (void) _stp_print_flush(); } -void cleanup_module(void) -{ - _stp_transport_close(); -} - -MODULE_LICENSE("GPL"); - diff --git a/runtime/probes/agg/count2.c b/runtime/probes/agg/count2.c index ea75f4bd..f53a0906 100644 --- a/runtime/probes/agg/count2.c +++ b/runtime/probes/agg/count2.c @@ -54,21 +54,15 @@ 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; - opens = _stp_counter_init(); reads = _stp_counter_init(); writes = _stp_counter_init(); read_bytes = _stp_counter_init(); write_bytes = _stp_counter_init(); - 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) @@ -85,11 +79,3 @@ static void probe_exit (void) _stp_print_flush(); } - -void cleanup_module(void) -{ - _stp_transport_close(); -} - -MODULE_LICENSE("GPL"); - diff --git a/runtime/probes/agg/stat1.c b/runtime/probes/agg/stat1.c index 54e22db5..ad6781e8 100644 --- a/runtime/probes/agg/stat1.c +++ b/runtime/probes/agg/stat1.c @@ -51,18 +51,13 @@ 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; - opens = _stp_counter_init(); reads = _stp_stat_init(HIST_LOG,24); writes = _stp_stat_init(HIST_LINEAR,0,1000,50); - 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) @@ -75,11 +70,3 @@ static void probe_exit (void) _stp_print_flush(); } - -void cleanup_module(void) -{ - _stp_transport_close(); -} - -MODULE_LICENSE("GPL"); - diff --git a/runtime/probes/bench/bench.c b/runtime/probes/bench/bench.c index 9192d3f2..adbe01d4 100644 --- a/runtime/probes/bench/bench.c +++ b/runtime/probes/bench/bench.c @@ -35,16 +35,13 @@ static struct kprobe kp[] = { #define NUM_JPROBES (sizeof(jp)/sizeof(struct jprobe)) #define NUM_KPROBES (sizeof(kp)/sizeof(struct kprobe)) -int init_module(void) +int probe_start(void) { int ret; - - TRANSPORT_OPEN; - ret = _stp_register_jprobes (jp, NUM_JPROBES); 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; } @@ -53,10 +50,3 @@ static void probe_exit (void) _stp_unregister_jprobes (jp, NUM_JPROBES); _stp_unregister_kprobes (kp, NUM_KPROBES); } - -void cleanup_module(void) -{ - _stp_transport_close(); -} - -MODULE_LICENSE("GPL"); diff --git a/runtime/probes/bench/bench_io1.c b/runtime/probes/bench/bench_io1.c index 4cc890df..a0a44d34 100644 --- a/runtime/probes/bench/bench_io1.c +++ b/runtime/probes/bench/bench_io1.c @@ -36,14 +36,9 @@ static struct kprobe kp[] = { #define NUM_KPROBES (sizeof(kp)/sizeof(struct kprobe)) -int init_module(void) +int probe_start(void) { - int ret; - - TRANSPORT_OPEN; - - ret = _stp_register_kprobes (kp, NUM_KPROBES); - return ret; + return _stp_register_kprobes (kp, NUM_KPROBES); } static void probe_exit (void) @@ -52,10 +47,3 @@ static void probe_exit (void) _stp_printf("dropped %d packets\n", atomic_read(&_stp_transport_failures)); _stp_print_flush(); } - -void cleanup_module(void) -{ - _stp_transport_close(); -} - -MODULE_LICENSE("GPL"); diff --git a/runtime/probes/bench/bench_io2.c b/runtime/probes/bench/bench_io2.c index d606fa64..14ef747b 100644 --- a/runtime/probes/bench/bench_io2.c +++ b/runtime/probes/bench/bench_io2.c @@ -36,14 +36,9 @@ static struct kprobe kp[] = { #define NUM_KPROBES (sizeof(kp)/sizeof(struct kprobe)) -int init_module(void) +int probe_start(void) { - int ret; - - TRANSPORT_OPEN; - - ret = _stp_register_kprobes (kp, NUM_KPROBES); - return ret; + return _stp_register_kprobes (kp, NUM_KPROBES); } static void probe_exit (void) @@ -51,10 +46,3 @@ static void probe_exit (void) _stp_unregister_kprobes (kp, NUM_KPROBES); _stp_print_flush(); } - -void cleanup_module(void) -{ - _stp_transport_close(); -} - -MODULE_LICENSE("GPL"); diff --git a/runtime/probes/bench/bench_multi.c b/runtime/probes/bench/bench_multi.c index 566e8520..eab75878 100644 --- a/runtime/probes/bench/bench_multi.c +++ b/runtime/probes/bench/bench_multi.c @@ -62,24 +62,12 @@ static struct kprobe kp[] = { #define NUM_KPROBES (sizeof(kp)/sizeof(struct kprobe)) -int init_module(void) +int probe_start(void) { - int ret; - - TRANSPORT_OPEN; - - ret = _stp_register_kprobes (kp, NUM_KPROBES); - return ret; + return _stp_register_kprobes (kp, NUM_KPROBES); } static void probe_exit (void) { _stp_unregister_kprobes (kp, NUM_KPROBES); } - -void cleanup_module(void) -{ - _stp_transport_close(); -} - -MODULE_LICENSE("GPL"); diff --git a/runtime/probes/bench/bench_ret.c b/runtime/probes/bench/bench_ret.c index f759691d..d70f0ee1 100644 --- a/runtime/probes/bench/bench_ret.c +++ b/runtime/probes/bench/bench_ret.c @@ -44,14 +44,13 @@ static struct kprobe kp[] = { #define NUM_KPROBES (sizeof(kpr)/sizeof(struct kretprobe)) -int init_module(void) +int probe_start(void) { - int ret; - - TRANSPORT_OPEN; - - ret = _stp_register_kretprobes (kpr, NUM_KPROBES); - ret = _stp_register_kprobes (kp, 1); + int ret = _stp_register_kretprobes (kpr, NUM_KPROBES); + if (ret >= 0) { + if ((ret = _stp_register_kprobes (kp, 1)) < 0) + _stp_unregister_kretprobes (kpr, NUM_KPROBES); + } return ret; } @@ -60,10 +59,3 @@ static void probe_exit (void) _stp_unregister_kretprobes (kpr, NUM_KPROBES); _stp_unregister_kprobes (kp, 1); } - -void cleanup_module(void) -{ - _stp_transport_close(); -} - -MODULE_LICENSE("GPL"); diff --git a/runtime/probes/scf/scf.c b/runtime/probes/scf/scf.c index 74900152..c4308ab1 100644 --- a/runtime/probes/scf/scf.c +++ b/runtime/probes/scf/scf.c @@ -36,15 +36,10 @@ static struct kprobe stp_probes[] = { #define MAX_STP_ROUTINE (sizeof(stp_probes)/sizeof(struct kprobe)) -int init_module(void) +int probe_start(void) { - int ret; - - TRANSPORT_OPEN; - map1 = _stp_map_new_str (100, INT64); - ret = _stp_register_kprobes (stp_probes, MAX_STP_ROUTINE); - return ret; + return _stp_register_kprobes (stp_probes, MAX_STP_ROUTINE); } static void probe_exit (void) @@ -54,10 +49,3 @@ static void probe_exit (void) _stp_map_del (map1); } -void cleanup_module(void) -{ - _stp_transport_close(); -} - -MODULE_LICENSE("GPL"); - diff --git a/runtime/probes/shellsnoop/shellsnoop.c b/runtime/probes/shellsnoop/shellsnoop.c index 87db9dcb..db635d23 100644 --- a/runtime/probes/shellsnoop/shellsnoop.c +++ b/runtime/probes/shellsnoop/shellsnoop.c @@ -107,13 +107,10 @@ 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; - /* First open connection. This exits on failure. */ - TRANSPORT_OPEN; - /* now initialize any data or variables */ pids = _stp_map_new_int64 (10000, INT64); arglist = _stp_list_new (10, STRING); @@ -124,7 +121,6 @@ int init_module(void) if (ret < 0) { _stp_map_del (pids); _stp_map_del (arglist); - _stp_transport_close(); return ret; } @@ -134,7 +130,7 @@ int init_module(void) } -static void probe_exit (void) +void probe_exit (void) { _stp_unregister_jprobes (stp_probes, MAX_STP_ROUTINE); _stp_map_del (pids); @@ -143,11 +139,4 @@ static void probe_exit (void) _stp_print_flush(); } -void cleanup_module(void) -{ - _stp_transport_cleanup(); - _stp_transport_close(); -} - -MODULE_LICENSE("GPL"); diff --git a/runtime/probes/tasklet/stp_tasklet.c b/runtime/probes/tasklet/stp_tasklet.c index 46dacf03..2367d4d6 100644 --- a/runtime/probes/tasklet/stp_tasklet.c +++ b/runtime/probes/tasklet/stp_tasklet.c @@ -28,13 +28,9 @@ static struct jprobe stp_probes[] = { }; #define MAX_STP_PROBES (sizeof(stp_probes)/sizeof(struct jprobe)) -int init_module(void) +int probe_start(void) { - int ret; - - TRANSPORT_OPEN; - ret = _stp_register_jprobes (stp_probes, MAX_STP_PROBES); - return ret; + return _stp_register_jprobes (stp_probes, MAX_STP_PROBES); } static void probe_exit (void) @@ -42,10 +38,3 @@ static void probe_exit (void) _stp_unregister_jprobes (stp_probes, MAX_STP_PROBES); } -void cleanup_module(void) -{ - _stp_transport_close(); -} - -MODULE_LICENSE("GPL"); - 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"); - diff --git a/runtime/probes/where_func/kprobe_where_funct.c b/runtime/probes/where_func/kprobe_where_funct.c index cf80bb94..6d3eee45 100644 --- a/runtime/probes/where_func/kprobe_where_funct.c +++ b/runtime/probes/where_func/kprobe_where_funct.c @@ -46,20 +46,14 @@ static struct kprobe kp[] = { }; #define MAX_KPROBES (sizeof(kp)/sizeof(struct kprobe)) -int init_module(void) +int probe_start(void) { - int ret; - - TRANSPORT_OPEN; - funct_locations = _stp_map_new_int64 (1000, INT64); if (funct_name) kp[0].addr = funct_name; - ret = _stp_register_kprobes (kp, MAX_KPROBES); - - return ret; + return _stp_register_kprobes (kp, MAX_KPROBES); } static void probe_exit (void) @@ -69,10 +63,3 @@ static void probe_exit (void) _stp_map_print (funct_locations, "Count: %d\tCaller: %1P"); _stp_map_del(funct_locations); } - -void cleanup_module(void) -{ - _stp_transport_close(); -} - -MODULE_LICENSE("GPL"); |