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/pmap-gen.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/pmap-gen.c')
-rw-r--r-- | runtime/pmap-gen.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/runtime/pmap-gen.c b/runtime/pmap-gen.c index 7f7ddeb0..86c3dc42 100644 --- a/runtime/pmap-gen.c +++ b/runtime/pmap-gen.c @@ -400,7 +400,7 @@ static unsigned int KEYSYM(phash) (ALLKEYSD(key)) #if VALUE_TYPE == INT64 || VALUE_TYPE == STRING -PMAP KEYSYM(_stp_pmap_new) (unsigned max_entries) +static PMAP KEYSYM(_stp_pmap_new) (unsigned max_entries) { PMAP pmap = _stp_pmap_new (max_entries, VALUE_TYPE, sizeof(struct KEYSYM(pmap_node)), 0); if (pmap) { @@ -426,7 +426,7 @@ PMAP KEYSYM(_stp_pmap_new) (unsigned max_entries) /* _stp_pmap_new_key1_key2...val (num, HIST_LINEAR, start, end, interval) */ /* _stp_pmap_new_key1_key2...val (num, HIST_LOG) */ -PMAP KEYSYM(_stp_pmap_new) (unsigned max_entries, int htype, ...) +static PMAP KEYSYM(_stp_pmap_new) (unsigned max_entries, int htype, ...) { int start=0, stop=0, interval=0; PMAP pmap; @@ -477,7 +477,7 @@ PMAP KEYSYM(_stp_pmap_new) (unsigned max_entries, int htype, ...) } #endif /* VALUE_TYPE */ -int KEYSYM(__stp_pmap_set) (MAP map, ALLKEYSD(key), VSTYPE val, int add) +static int KEYSYM(__stp_pmap_set) (MAP map, ALLKEYSD(key), VSTYPE val, int add) { unsigned int hv; struct hlist_head *head; @@ -522,7 +522,7 @@ int KEYSYM(__stp_pmap_set) (MAP map, ALLKEYSD(key), VSTYPE val, int add) return MAP_SET_VAL(map,(struct map_node *)n, val, 0); } -int KEYSYM(_stp_pmap_set) (PMAP pmap, ALLKEYSD(key), VSTYPE val) +static int KEYSYM(_stp_pmap_set) (PMAP pmap, ALLKEYSD(key), VSTYPE val) { int res; MAP m = per_cpu_ptr (pmap->map, MAP_GET_CPU ()); @@ -538,7 +538,7 @@ int KEYSYM(_stp_pmap_set) (PMAP pmap, ALLKEYSD(key), VSTYPE val) return res; } -int KEYSYM(_stp_pmap_add) (PMAP pmap, ALLKEYSD(key), VSTYPE val) +static int KEYSYM(_stp_pmap_add) (PMAP pmap, ALLKEYSD(key), VSTYPE val) { int res; MAP m = per_cpu_ptr (pmap->map, MAP_GET_CPU()); @@ -555,7 +555,7 @@ int KEYSYM(_stp_pmap_add) (PMAP pmap, ALLKEYSD(key), VSTYPE val) } -VALTYPE KEYSYM(_stp_pmap_get_cpu) (PMAP pmap, ALLKEYSD(key)) +static VALTYPE KEYSYM(_stp_pmap_get_cpu) (PMAP pmap, ALLKEYSD(key)) { unsigned int hv; struct hlist_head *head; @@ -608,7 +608,7 @@ VALTYPE KEYSYM(_stp_pmap_get_cpu) (PMAP pmap, ALLKEYSD(key)) return NULLRET; } -VALTYPE KEYSYM(_stp_pmap_get) (PMAP pmap, ALLKEYSD(key)) +static VALTYPE KEYSYM(_stp_pmap_get) (PMAP pmap, ALLKEYSD(key)) { unsigned int hv; int cpu, clear_agg = 0; @@ -696,7 +696,7 @@ VALTYPE KEYSYM(_stp_pmap_get) (PMAP pmap, ALLKEYSD(key)) return NULLRET; } -int KEYSYM(__stp_pmap_del) (MAP map, ALLKEYSD(key)) +static int KEYSYM(__stp_pmap_del) (MAP map, ALLKEYSD(key)) { unsigned int hv; struct hlist_head *head; @@ -737,7 +737,7 @@ int KEYSYM(__stp_pmap_del) (MAP map, ALLKEYSD(key)) return 0; } -int KEYSYM(_stp_pmap_del) (PMAP pmap, ALLKEYSD(key)) +static int KEYSYM(_stp_pmap_del) (PMAP pmap, ALLKEYSD(key)) { int res; MAP m = per_cpu_ptr (pmap->map, MAP_GET_CPU ()); |