diff options
Diffstat (limited to 'fs/xfs/kmem.c')
-rw-r--r-- | fs/xfs/kmem.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/xfs/kmem.c b/fs/xfs/kmem.c index 7cd315ad937e..9f32af534ce4 100644 --- a/fs/xfs/kmem.c +++ b/fs/xfs/kmem.c @@ -3,10 +3,10 @@ * Copyright (c) 2000-2005 Silicon Graphics, Inc. * All Rights Reserved. */ -#include <linux/sched/mm.h> +#include "xfs.h" #include <linux/backing-dev.h> -#include "kmem.h" #include "xfs_message.h" +#include "xfs_trace.h" void * kmem_alloc(size_t size, xfs_km_flags_t flags) @@ -15,6 +15,8 @@ kmem_alloc(size_t size, xfs_km_flags_t flags) gfp_t lflags = kmem_flags_convert(flags); void *ptr; + trace_kmem_alloc(size, flags, _RET_IP_); + do { ptr = kmalloc(size, lflags); if (ptr || (flags & KM_MAYFAIL)) @@ -35,6 +37,8 @@ kmem_alloc_large(size_t size, xfs_km_flags_t flags) void *ptr; gfp_t lflags; + trace_kmem_alloc_large(size, flags, _RET_IP_); + ptr = kmem_alloc(size, flags | KM_MAYFAIL); if (ptr) return ptr; @@ -65,6 +69,8 @@ kmem_realloc(const void *old, size_t newsize, xfs_km_flags_t flags) gfp_t lflags = kmem_flags_convert(flags); void *ptr; + trace_kmem_realloc(newsize, flags, _RET_IP_); + do { ptr = krealloc(old, newsize, lflags); if (ptr || (flags & KM_MAYFAIL)) @@ -85,6 +91,7 @@ kmem_zone_alloc(kmem_zone_t *zone, xfs_km_flags_t flags) gfp_t lflags = kmem_flags_convert(flags); void *ptr; + trace_kmem_zone_alloc(kmem_cache_size(zone), flags, _RET_IP_); do { ptr = kmem_cache_alloc(zone, lflags); if (ptr || (flags & KM_MAYFAIL)) |