lkml.org 
[lkml]   [2008]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RESEND PATCH] kmemtrace: SLAB hooks.
From
Date
Hi Eduard-Gabriel,

On Mon, 2008-07-14 at 20:42 +0300, Eduard - Gabriel Munteanu wrote:
> This adds hooks for the SLAB allocator, to allow tracing with
> kmemtrace.
>
> Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
> @@ -28,8 +29,20 @@ extern struct cache_sizes malloc_sizes[];
> void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
> void *__kmalloc(size_t size, gfp_t flags);
>
> +#ifdef CONFIG_KMEMTRACE
> +extern void *__kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags);
> +#else
> +static inline void *__kmem_cache_alloc(struct kmem_cache *cachep,
> + gfp_t flags)
> +{
> + return kmem_cache_alloc(cachep, flags);
> +}
> +#endif
> +

I'm okay with this approach but then you need to do
s/__kmem_cache_alloc/kmem_cache_alloc_trace/ or similar. In the kernel,
it's always the *upper* level function that doesn't have the
underscores.



\
 
 \ /
  Last update: 2008-07-14 20:23    [W:0.157 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site