diff options
author | Josh Stone <jistone@redhat.com> | 2009-01-28 14:36:08 -0800 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-01-28 17:16:50 -0800 |
commit | 4c2732a1dad1de295c9219ee3afac007b2d7ba05 (patch) | |
tree | fb84977ad73f62ce57a147e9c3d6bf869376737c /runtime/counter.c | |
parent | 83e08fc5458e8196d5f0ed5790f9f7de77a80bb6 (diff) | |
download | systemtap-steved-4c2732a1dad1de295c9219ee3afac007b2d7ba05.tar.gz systemtap-steved-4c2732a1dad1de295c9219ee3afac007b2d7ba05.tar.xz systemtap-steved-4c2732a1dad1de295c9219ee3afac007b2d7ba05.zip |
Use 'static' as much as possible
This change just inserts 'static' on runtime, tapset, and generated C
functions and globals, so the compiler can do a better job of
optimizing.
My tests with small scripts show ~10% reduction in compile time and ~20%
reduction in module size. Larger scripts may show less benefit, but I
expect purely positive results.
Diffstat (limited to 'runtime/counter.c')
-rw-r--r-- | runtime/counter.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/counter.c b/runtime/counter.c index a3c3669b..40ea66a0 100644 --- a/runtime/counter.c +++ b/runtime/counter.c @@ -52,7 +52,7 @@ typedef struct _counter *Counter; * * @return a Counter. Will be NULL on error. */ -Counter _stp_counter_init (void) +static Counter _stp_counter_init (void) { Counter cnt = _stp_alloc_percpu (struct _counter); #if NEED_COUNTER_LOCKS == 1 @@ -73,7 +73,7 @@ Counter _stp_counter_init (void) * @param cnt Counter * @param val int64 value */ -void _stp_counter_add (Counter cnt, int64_t val) +static void _stp_counter_add (Counter cnt, int64_t val) { Counter c = per_cpu_ptr (cnt, get_cpu()); COUNTER_LOCK(c); @@ -90,7 +90,7 @@ void _stp_counter_add (Counter cnt, int64_t val) * @param clear Set this to have the value cleared after reading. * @return An int64 value. */ -int64_t _stp_counter_get_cpu (Counter cnt, int cpu, int clear) +static int64_t _stp_counter_get_cpu (Counter cnt, int cpu, int clear) { int64_t val; Counter c = per_cpu_ptr (cnt, cpu); @@ -114,7 +114,7 @@ int64_t _stp_counter_get_cpu (Counter cnt, int cpu, int clear) * @param clear Set this to have the value cleared after reading. * @return An int64 value. */ -int64_t _stp_counter_get (Counter cnt, int clear) +static int64_t _stp_counter_get (Counter cnt, int clear) { int i; int64_t sum = 0; @@ -133,7 +133,7 @@ int64_t _stp_counter_get (Counter cnt, int clear) /** Free a Counter. * @param cnt Counter */ -void _stp_counter_free (Counter cnt) +static void _stp_counter_free (Counter cnt) { _stp_free_percpu (cnt); } |