summaryrefslogtreecommitdiffstats
path: root/runtime/alloc.c
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2009-03-17 16:58:35 +0100
committerMark Wielaard <mjw@redhat.com>2009-03-17 16:58:35 +0100
commitbf33ee46c8fff4d181b7f28521f12175bd32ec77 (patch)
tree5e0a9e1047af60389eee36da54182b52d3d53ee7 /runtime/alloc.c
parent524c6f82b0a3c010d0fd6a67b1afcfbf55b789a6 (diff)
parent30cb532a560ed152b86506b80490e99195970271 (diff)
downloadsystemtap-steved-bf33ee46c8fff4d181b7f28521f12175bd32ec77.tar.gz
systemtap-steved-bf33ee46c8fff4d181b7f28521f12175bd32ec77.tar.xz
systemtap-steved-bf33ee46c8fff4d181b7f28521f12175bd32ec77.zip
Merge branch 'master' into pr6866
Resolved conflicts: runtime/task_finder.c: name vs path.
Diffstat (limited to 'runtime/alloc.c')
-rw-r--r--runtime/alloc.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/runtime/alloc.c b/runtime/alloc.c
index 89d16612..439e8a7e 100644
--- a/runtime/alloc.c
+++ b/runtime/alloc.c
@@ -233,30 +233,14 @@ static void *_stp_vmalloc(unsigned long size)
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
static void *_stp_alloc_percpu(size_t size)
{
-#ifdef DEBUG_MEM
+#ifdef STAPCONF_ALLOC_PERCPU_ALIGN
void *ret = __alloc_percpu(size, 8);
- if (likely(ret)) {
- struct _stp_mem_entry *m = kmalloc(sizeof(struct _stp_mem_entry), STP_ALLOC_FLAGS);
- if (unlikely(m == NULL)) {
- free_percpu(ret);
- return NULL;
- }
- _stp_mem_debug_percpu(m, ret, size);
- _stp_allocated_memory += size * num_online_cpus();
- }
- return ret;
#else
- return __alloc_percpu(size, 8);
+ void *ret = __alloc_percpu(size);
#endif
-}
-#else
-static void *_stp_alloc_percpu(size_t size)
-{
#ifdef DEBUG_MEM
- void *ret = __alloc_percpu(size);
if (likely(ret)) {
struct _stp_mem_entry *m = kmalloc(sizeof(struct _stp_mem_entry), STP_ALLOC_FLAGS);
if (unlikely(m == NULL)) {
@@ -266,12 +250,9 @@ static void *_stp_alloc_percpu(size_t size)
_stp_mem_debug_percpu(m, ret, size);
_stp_allocated_memory += size * num_online_cpus();
}
- return ret;
-#else
- return __alloc_percpu(size);
#endif
+ return ret;
}
-#endif /* LINUX_VERSION_CODE */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)
#define _stp_kmalloc_node(size,node) _stp_kmalloc(size)