diff options
author | Chris Kelly <ckelly@ozmodevices.com> | 2012-02-20 21:12:35 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-24 09:26:52 -0800 |
commit | 066b2229410f2f58fa91baedd22b4dcf048e28dd (patch) | |
tree | f2ce1ae3878d72254c6eec9b9e04f38859e09a65 /drivers/staging/ozwpan/ozalloc.h | |
parent | 56ff32fe1cf24d624ca4a68a409753fb3fd593f6 (diff) |
staging: ozwpan: Added debug support
Added tracing facilities and also memory allocation and URB tracking.
This is for debugging purposes and is all optional and can be switched
out at compile time.
Signed-off-by: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ozwpan/ozalloc.h')
-rw-r--r-- | drivers/staging/ozwpan/ozalloc.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/staging/ozwpan/ozalloc.h b/drivers/staging/ozwpan/ozalloc.h new file mode 100644 index 00000000000..11a7a164288 --- /dev/null +++ b/drivers/staging/ozwpan/ozalloc.h @@ -0,0 +1,28 @@ +/* ----------------------------------------------------------------------------- + * Copyright (c) 2011 Ozmo Inc + * Released under the GNU General Public License Version 2 (GPLv2). + * ----------------------------------------------------------------------------- + */ +#ifndef _OZALLOC_H +#define _OZALLOC_H + +#include <linux/slab.h> + +#ifdef WANT_DEBUG_KMALLOC + +void *oz_alloc_debug(size_t size, gfp_t flags, int line); +void oz_free_debug(void *p); +void oz_trace_leaks(void); +#define oz_alloc(__s, __f) oz_alloc_debug(__s, __f, __LINE__) +#define oz_free oz_free_debug + +#else + + +#define oz_alloc kmalloc +#define oz_free kfree +#define oz_trace_leaks() + +#endif /* #ifdef WANT_DEBUG_KMALLOC */ + +#endif /* _OZALLOC_H */ |