From 7083cb11235393dfb0d2adf824ef26828053a1d2 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 28 Sep 2011 12:15:22 +0200 Subject: [PATCH] runtime/alloc.c: Remove unused _stp_vmalloc() and _stp_vfree() functions. --- runtime/alloc.c | 47 +---------------------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/runtime/alloc.c b/runtime/alloc.c index 74ec72853..58c40ad8a 100644 --- a/runtime/alloc.c +++ b/runtime/alloc.c @@ -45,7 +45,7 @@ static DEFINE_SPINLOCK(_stp_mem_lock); #define MEM_MAGIC 0xc11cf77f #define MEM_FENCE_SIZE 32 -enum _stp_memtype { MEM_KMALLOC, MEM_VMALLOC, MEM_PERCPU }; +enum _stp_memtype { MEM_KMALLOC, MEM_PERCPU }; typedef struct { char *alloc; @@ -54,7 +54,6 @@ typedef struct { static const _stp_malloc_type const _stp_malloc_types[] = { {"kmalloc", "kfree"}, - {"vmalloc", "vfree"}, {"alloc_percpu", "free_percpu"} }; @@ -167,10 +166,6 @@ static void _stp_mem_debug_free(void *addr, enum _stp_memtype type) free_percpu(addr); kfree(p); break; - case MEM_VMALLOC: - _stp_check_mem_fence(addr, m->len); - vfree(addr - MEM_FENCE_SIZE); - break; default: printk("SYSTEMTAP ERROR: Attempted to free memory at addr %p len=%d with unknown allocation type.\n", addr, (int)m->len); } @@ -210,9 +205,6 @@ static void _stp_mem_debug_validate(void *addr) case MEM_PERCPU: /* do nothing */ break; - case MEM_VMALLOC: - _stp_check_mem_fence(addr, m->len); - break; default: printk("SYSTEMTAP ERROR: Attempted to validate memory at addr %p len=%d with unknown allocation type.\n", addr, (int)m->len); } @@ -329,30 +321,6 @@ static void *_stp_kzalloc(size_t size) } #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) */ -static void *_stp_vmalloc(unsigned long size) -{ - void *ret; -#ifdef STP_MAXMEMORY - if ((_STP_MODULE_CORE_SIZE + _stp_allocated_memory + size) - > (STP_MAXMEMORY * 1024)) { - return NULL; - } -#endif -#ifdef DEBUG_MEM - ret = __vmalloc(size + MEM_DEBUG_SIZE, STP_ALLOC_FLAGS, PAGE_KERNEL); - if (likely(ret)) { - _stp_allocated_memory += size; - ret = _stp_mem_debug_setup(ret, size, MEM_VMALLOC); - } -#else - ret = __vmalloc(size, STP_ALLOC_FLAGS, PAGE_KERNEL); - if (likely(ret)) { - _stp_allocated_memory += size; - } -#endif - return ret; -} - #ifdef PCPU_MIN_UNIT_SIZE #define _STP_MAX_PERCPU_SIZE PCPU_MIN_UNIT_SIZE #else @@ -434,15 +402,6 @@ static void _stp_kfree(void *addr) #endif } -static void _stp_vfree(void *addr) -{ -#ifdef DEBUG_MEM - _stp_mem_debug_free(addr, MEM_VMALLOC); -#else - vfree(addr); -#endif -} - static void _stp_free_percpu(void *addr) { #ifdef DEBUG_MEM @@ -481,10 +440,6 @@ static void _stp_mem_debug_done(void) free_percpu(m->addr); kfree(p); break; - case MEM_VMALLOC: - _stp_check_mem_fence(m->addr, m->len); - vfree(m->addr - MEM_FENCE_SIZE); - break; default: printk("SYSTEMTAP ERROR: Attempted to free memory at addr %p len=%d with unknown allocation type.\n", m->addr, (int)m->len); } -- 2.43.5