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/map.h | |
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/map.h')
-rw-r--r-- | runtime/map.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/runtime/map.h b/runtime/map.h index 6cd6e119..6c1c855b 100644 --- a/runtime/map.h +++ b/runtime/map.h @@ -166,34 +166,34 @@ typedef struct pmap *PMAP; /** @cond DONT_INCLUDE */ /************* prototypes for map.c ****************/ -int int64_eq_p(int64_t key1, int64_t key2); +static int int64_eq_p(int64_t key1, int64_t key2); void int64_copy(void *dest, int64_t val); void int64_add(void *dest, int64_t val); int64_t int64_get(void *ptr); void stat_copy(void *dest, stat *src); void stat_add(void *dest, stat *src); stat *stat_get(void *ptr); -int64_t _stp_key_get_int64(struct map_node *mn, int n); -char * _stp_key_get_str(struct map_node *mn, int n); -unsigned int int64_hash(const int64_t v); +static int64_t _stp_key_get_int64(struct map_node *mn, int n); +static char * _stp_key_get_str(struct map_node *mn, int n); +static unsigned int int64_hash(const int64_t v); char * str_get(void *ptr); -void str_copy(char *dest, char *src); -void str_add(void *dest, char *val); -int str_eq_p(char *key1, char *key2); -int64_t _stp_get_int64(struct map_node *m); -char * _stp_get_str(struct map_node *m); -stat *_stp_get_stat(struct map_node *m); -unsigned int str_hash(const char *key1); +static void str_copy(char *dest, char *src); +static void str_add(void *dest, char *val); +static int str_eq_p(char *key1, char *key2); +static int64_t _stp_get_int64(struct map_node *m); +static char * _stp_get_str(struct map_node *m); +static stat *_stp_get_stat(struct map_node *m); +static unsigned int str_hash(const char *key1); static MAP _stp_map_new(unsigned max_entries, int type, int key_size, int data_size); static PMAP _stp_pmap_new(unsigned max_entries, int type, int key_size, int data_size); static int msb64(int64_t x); static MAP _stp_map_new_hstat_log(unsigned max_entries, int key_size); static MAP _stp_map_new_hstat_linear(unsigned max_entries, int ksize, int start, int stop, int interval); static void _stp_map_print_histogram(MAP map, stat *s); -struct map_node * _stp_map_start(MAP map); -struct map_node * _stp_map_iter(MAP map, struct map_node *m); -void _stp_map_del(MAP map); -void _stp_map_clear(MAP map); +static struct map_node * _stp_map_start(MAP map); +static struct map_node * _stp_map_iter(MAP map, struct map_node *m); +static void _stp_map_del(MAP map); +static void _stp_map_clear(MAP map); void _stp_map_print(MAP map, const char *fmt); static struct map_node *_new_map_create (MAP map, struct hlist_head *head); |