Eduard - Gabriel Munteanu | b9ce08c | 2008-08-10 20:14:03 +0300 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 Eduard - Gabriel Munteanu |
| 3 | * |
| 4 | * This file is released under GPL version 2. |
| 5 | */ |
| 6 | |
| 7 | #ifndef _LINUX_KMEMTRACE_H |
| 8 | #define _LINUX_KMEMTRACE_H |
| 9 | |
| 10 | #ifdef __KERNEL__ |
| 11 | |
Eduard - Gabriel Munteanu | ca2b84cb | 2009-03-23 15:12:24 +0200 | [diff] [blame] | 12 | #include <linux/tracepoint.h> |
Eduard - Gabriel Munteanu | b9ce08c | 2008-08-10 20:14:03 +0300 | [diff] [blame] | 13 | #include <linux/types.h> |
Eduard - Gabriel Munteanu | b9ce08c | 2008-08-10 20:14:03 +0300 | [diff] [blame] | 14 | |
| 15 | #ifdef CONFIG_KMEMTRACE |
Eduard - Gabriel Munteanu | b9ce08c | 2008-08-10 20:14:03 +0300 | [diff] [blame] | 16 | extern void kmemtrace_init(void); |
Eduard - Gabriel Munteanu | ca2b84cb | 2009-03-23 15:12:24 +0200 | [diff] [blame] | 17 | #else |
Eduard - Gabriel Munteanu | b9ce08c | 2008-08-10 20:14:03 +0300 | [diff] [blame] | 18 | static inline void kmemtrace_init(void) |
| 19 | { |
| 20 | } |
Eduard - Gabriel Munteanu | ca2b84cb | 2009-03-23 15:12:24 +0200 | [diff] [blame] | 21 | #endif |
Eduard - Gabriel Munteanu | b9ce08c | 2008-08-10 20:14:03 +0300 | [diff] [blame] | 22 | |
Eduard - Gabriel Munteanu | ca2b84cb | 2009-03-23 15:12:24 +0200 | [diff] [blame] | 23 | DECLARE_TRACE(kmalloc, |
| 24 | TP_PROTO(unsigned long call_site, |
| 25 | const void *ptr, |
| 26 | size_t bytes_req, |
| 27 | size_t bytes_alloc, |
| 28 | gfp_t gfp_flags), |
| 29 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags)); |
| 30 | DECLARE_TRACE(kmem_cache_alloc, |
| 31 | TP_PROTO(unsigned long call_site, |
| 32 | const void *ptr, |
| 33 | size_t bytes_req, |
| 34 | size_t bytes_alloc, |
| 35 | gfp_t gfp_flags), |
| 36 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags)); |
| 37 | DECLARE_TRACE(kmalloc_node, |
| 38 | TP_PROTO(unsigned long call_site, |
| 39 | const void *ptr, |
| 40 | size_t bytes_req, |
| 41 | size_t bytes_alloc, |
| 42 | gfp_t gfp_flags, |
| 43 | int node), |
| 44 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node)); |
| 45 | DECLARE_TRACE(kmem_cache_alloc_node, |
| 46 | TP_PROTO(unsigned long call_site, |
| 47 | const void *ptr, |
| 48 | size_t bytes_req, |
| 49 | size_t bytes_alloc, |
| 50 | gfp_t gfp_flags, |
| 51 | int node), |
| 52 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node)); |
| 53 | DECLARE_TRACE(kfree, |
| 54 | TP_PROTO(unsigned long call_site, const void *ptr), |
| 55 | TP_ARGS(call_site, ptr)); |
| 56 | DECLARE_TRACE(kmem_cache_free, |
| 57 | TP_PROTO(unsigned long call_site, const void *ptr), |
| 58 | TP_ARGS(call_site, ptr)); |
Eduard - Gabriel Munteanu | b9ce08c | 2008-08-10 20:14:03 +0300 | [diff] [blame] | 59 | |
| 60 | #endif /* __KERNEL__ */ |
| 61 | |
| 62 | #endif /* _LINUX_KMEMTRACE_H */ |
| 63 | |