From 4c2732a1dad1de295c9219ee3afac007b2d7ba05 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 28 Jan 2009 14:36:08 -0800 Subject: 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. --- runtime/sym.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/sym.c') diff --git a/runtime/sym.c b/runtime/sym.c index 06ac14a5..62c9f3ce 100644 --- a/runtime/sym.c +++ b/runtime/sym.c @@ -21,7 +21,7 @@ */ /* XXX: this needs to be address-space-specific. */ -unsigned long _stp_module_relocate(const char *module, const char *section, unsigned long offset) +static unsigned long _stp_module_relocate(const char *module, const char *section, unsigned long offset) { static struct _stp_module *last = NULL; static struct _stp_section *last_sec; @@ -236,7 +236,7 @@ static int _stp_module_check(void) * a probe because it is too time-consuming. Use at module exit time. */ -void _stp_symbol_print(unsigned long address) +static void _stp_symbol_print(unsigned long address) { const char *modname; const char *name; @@ -255,7 +255,7 @@ void _stp_symbol_print(unsigned long address) } /* Like _stp_symbol_print, except only print if the address is a valid function address */ -int _stp_func_print(unsigned long address, int verbose, int exact) +static int _stp_func_print(unsigned long address, int verbose, int exact) { const char *modname; const char *name; @@ -283,7 +283,7 @@ int _stp_func_print(unsigned long address, int verbose, int exact) return 0; } -void _stp_symbol_snprint(char *str, size_t len, unsigned long address) +static void _stp_symbol_snprint(char *str, size_t len, unsigned long address) { const char *modname; const char *name; -- cgit