summaryrefslogtreecommitdiffstats
path: root/runtime/alloc.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/alloc.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/alloc.c')
-rw-r--r--runtime/alloc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/runtime/alloc.c b/runtime/alloc.c
index cfdb97bd..89d16612 100644
--- a/runtime/alloc.c
+++ b/runtime/alloc.c
@@ -63,7 +63,7 @@ struct _stp_mem_entry {
static LIST_HEAD(_stp_mem_list);
-void _stp_check_mem_fence (char *addr, int size)
+static void _stp_check_mem_fence (char *addr, int size)
{
char *ptr;
int i;
@@ -88,7 +88,7 @@ void _stp_check_mem_fence (char *addr, int size)
}
}
-void *_stp_mem_debug_setup(void *addr, size_t size, enum _stp_memtype type)
+static void *_stp_mem_debug_setup(void *addr, size_t size, enum _stp_memtype type)
{
struct list_head *p;
struct _stp_mem_entry *m;
@@ -108,7 +108,7 @@ void *_stp_mem_debug_setup(void *addr, size_t size, enum _stp_memtype type)
}
/* Percpu allocations don't have the fence. Implementing it is problematic. */
-void _stp_mem_debug_percpu(struct _stp_mem_entry *m, void *addr, size_t size)
+static void _stp_mem_debug_percpu(struct _stp_mem_entry *m, void *addr, size_t size)
{
struct list_head *p = (struct list_head *)m;
m->magic = MEM_MAGIC;
@@ -120,7 +120,7 @@ void _stp_mem_debug_percpu(struct _stp_mem_entry *m, void *addr, size_t size)
spin_unlock(&_stp_mem_lock);
}
-void _stp_mem_debug_free(void *addr, enum _stp_memtype type)
+static void _stp_mem_debug_free(void *addr, enum _stp_memtype type)
{
int found = 0;
struct list_head *p, *tmp;
@@ -291,7 +291,7 @@ static void *_stp_kmalloc_node(size_t size, int node)
}
#endif /* LINUX_VERSION_CODE */
-void _stp_kfree(void *addr)
+static void _stp_kfree(void *addr)
{
#ifdef DEBUG_MEM
_stp_mem_debug_free(addr, MEM_KMALLOC);
@@ -300,7 +300,7 @@ void _stp_kfree(void *addr)
#endif
}
-void _stp_vfree(void *addr)
+static void _stp_vfree(void *addr)
{
#ifdef DEBUG_MEM
_stp_mem_debug_free(addr, MEM_VMALLOC);
@@ -309,7 +309,7 @@ void _stp_vfree(void *addr)
#endif
}
-void _stp_free_percpu(void *addr)
+static void _stp_free_percpu(void *addr)
{
#ifdef DEBUG_MEM
_stp_mem_debug_free(addr, MEM_PERCPU);
@@ -318,7 +318,7 @@ void _stp_free_percpu(void *addr)
#endif
}
-void _stp_mem_debug_done(void)
+static void _stp_mem_debug_done(void)
{
#ifdef DEBUG_MEM
struct list_head *p, *tmp;