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/time.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/time.c')
-rw-r--r-- | runtime/time.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/time.c b/runtime/time.c index 15e205dd..ad7cef9d 100644 --- a/runtime/time.c +++ b/runtime/time.c @@ -54,10 +54,10 @@ typedef struct __stp_time_t { struct timer_list timer; } stp_time_t; -void *stp_time = NULL; +static void *stp_time = NULL; /* Flag to tell the timer callback whether to reregister */ -int stp_timer_reregister = 0; +static int stp_timer_reregister = 0; /* Try to estimate the number of CPU cycles in a millisecond - i.e. kHz. This * relies heavily on the accuracy of udelay. By calling udelay twice, we @@ -185,7 +185,7 @@ __stp_time_cpufreq_callback(struct notifier_block *self, return NOTIFY_OK; } -struct notifier_block __stp_time_notifier = { +static struct notifier_block __stp_time_notifier = { .notifier_call = __stp_time_cpufreq_callback, }; @@ -205,7 +205,7 @@ __stp_constant_freq(void) #endif /* CONFIG_CPU_FREQ */ /* This function is called during module unloading. */ -void +static void _stp_kill_time(void) { if (stp_time) { @@ -227,7 +227,7 @@ _stp_kill_time(void) } /* This function is called during module loading. */ -int +static int _stp_init_time(void) { int ret = 0; @@ -268,7 +268,7 @@ _stp_init_time(void) return ret; } -int64_t +static int64_t _stp_gettimeofday_ns(void) { int64_t base; |