summaryrefslogtreecommitdiffstats
path: root/runtime/map-gen.c
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-01-28 14:36:08 -0800
committerJosh Stone <jistone@redhat.com>2009-01-28 17:16:50 -0800
commit4c2732a1dad1de295c9219ee3afac007b2d7ba05 (patch)
treefb84977ad73f62ce57a147e9c3d6bf869376737c /runtime/map-gen.c
parent83e08fc5458e8196d5f0ed5790f9f7de77a80bb6 (diff)
downloadsystemtap-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-gen.c')
-rw-r--r--runtime/map-gen.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/runtime/map-gen.c b/runtime/map-gen.c
index ce6e8742..c4bdf2c7 100644
--- a/runtime/map-gen.c
+++ b/runtime/map-gen.c
@@ -336,7 +336,7 @@ static unsigned int KEYSYM(hash) (ALLKEYSD(key))
#if VALUE_TYPE == INT64 || VALUE_TYPE == STRING
-MAP KEYSYM(_stp_map_new) (unsigned max_entries)
+static MAP KEYSYM(_stp_map_new) (unsigned max_entries)
{
MAP m = _stp_map_new (max_entries, VALUE_TYPE, sizeof(struct KEYSYM(map_node)), 0);
if (m)
@@ -347,7 +347,7 @@ MAP KEYSYM(_stp_map_new) (unsigned max_entries)
/* _stp_map_new_key1_key2...val (num, HIST_LINEAR, start, end, interval) */
/* _stp_map_new_key1_key2...val (num, HIST_LOG) */
-MAP KEYSYM(_stp_map_new) (unsigned max_entries, int htype, ...)
+static MAP KEYSYM(_stp_map_new) (unsigned max_entries, int htype, ...)
{
int start=0, stop=0, interval=0;
MAP m;
@@ -384,7 +384,7 @@ MAP KEYSYM(_stp_map_new) (unsigned max_entries, int htype, ...)
}
#endif /* VALUE_TYPE */
-int KEYSYM(__stp_map_set) (MAP map, ALLKEYSD(key), VSTYPE val, int add)
+static int KEYSYM(__stp_map_set) (MAP map, ALLKEYSD(key), VSTYPE val, int add)
{
unsigned int hv;
struct hlist_head *head;
@@ -427,18 +427,18 @@ int KEYSYM(__stp_map_set) (MAP map, ALLKEYSD(key), VSTYPE val, int add)
return MAP_SET_VAL(map,(struct map_node *)n, val, 0);
}
-int KEYSYM(_stp_map_set) (MAP map, ALLKEYSD(key), VSTYPE val)
+static int KEYSYM(_stp_map_set) (MAP map, ALLKEYSD(key), VSTYPE val)
{
return KEYSYM(__stp_map_set) (map, ALLKEYS(key), val, 0);
}
-int KEYSYM(_stp_map_add) (MAP map, ALLKEYSD(key), VSTYPE val)
+static int KEYSYM(_stp_map_add) (MAP map, ALLKEYSD(key), VSTYPE val)
{
return KEYSYM(__stp_map_set) (map, ALLKEYS(key), val, 1);
}
-VALTYPE KEYSYM(_stp_map_get) (MAP map, ALLKEYSD(key))
+static VALTYPE KEYSYM(_stp_map_get) (MAP map, ALLKEYSD(key))
{
unsigned int hv;
struct hlist_head *head;
@@ -474,7 +474,7 @@ VALTYPE KEYSYM(_stp_map_get) (MAP map, ALLKEYSD(key))
return NULLRET;
}
-int KEYSYM(_stp_map_del) (MAP map, ALLKEYSD(key))
+static int KEYSYM(_stp_map_del) (MAP map, ALLKEYSD(key))
{
unsigned int hv;
struct hlist_head *head;
@@ -511,7 +511,7 @@ int KEYSYM(_stp_map_del) (MAP map, ALLKEYSD(key))
return 0;
}
-int KEYSYM(_stp_map_exists) (MAP map, ALLKEYSD(key))
+static int KEYSYM(_stp_map_exists) (MAP map, ALLKEYSD(key))
{
unsigned int hv;
struct hlist_head *head;