diff --git a/include/haproxy/pool.h b/include/haproxy/pool.h index 8c480d3f6..6ae5b60ef 100644 --- a/include/haproxy/pool.h +++ b/include/haproxy/pool.h @@ -106,7 +106,7 @@ void trim_all_pools(void); void *pool_get_from_os_noinc(struct pool_head *pool); void pool_put_to_os_nodec(struct pool_head *pool, void *ptr); -void *pool_alloc_nocache(struct pool_head *pool); +void *pool_alloc_nocache(struct pool_head *pool, const void *caller); void pool_free_nocache(struct pool_head *pool, void *ptr); void dump_pools(void); int pool_parse_debugging(const char *str, char **err); diff --git a/src/dynbuf.c b/src/dynbuf.c index 0b12c7505..1ae09f481 100644 --- a/src/dynbuf.c +++ b/src/dynbuf.c @@ -49,7 +49,7 @@ int init_buffer() pool_head_buffer->limit = global.tune.buf_limit; for (done = 0; done < pool_head_buffer->minavail - 1; done++) { - buffer = pool_alloc_nocache(pool_head_buffer); + buffer = pool_alloc_nocache(pool_head_buffer, init_buffer); if (!buffer) return 0; pool_free(pool_head_buffer, buffer); diff --git a/src/pool.c b/src/pool.c index 83ebe255c..fc04c40d2 100644 --- a/src/pool.c +++ b/src/pool.c @@ -420,7 +420,7 @@ void pool_put_to_os_nodec(struct pool_head *pool, void *ptr) * and directly returns it. The pool's counters are updated but the object is * never cached, so this is usable with and without local or shared caches. */ -void *pool_alloc_nocache(struct pool_head *pool) +void *pool_alloc_nocache(struct pool_head *pool, const void *caller) { void *ptr = NULL; uint bucket; @@ -436,7 +436,7 @@ void *pool_alloc_nocache(struct pool_head *pool) /* keep track of where the element was allocated from */ POOL_DEBUG_SET_MARK(pool, ptr); - POOL_DEBUG_TRACE_CALLER(pool, (struct pool_cache_item *)ptr, NULL); + POOL_DEBUG_TRACE_CALLER(pool, (struct pool_cache_item *)ptr, caller); return ptr; } @@ -839,7 +839,7 @@ void *__pool_alloc(struct pool_head *pool, unsigned int flags) p = pool_get_from_cache(pool, caller); if (unlikely(!p)) - p = pool_alloc_nocache(pool); + p = pool_alloc_nocache(pool, caller); if (likely(p)) { #ifdef USE_MEMORY_PROFILING