kmemtrace: use tracepoints
[linux-2.6.git] / include / trace / kmemtrace.h
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
12 #include <linux/tracepoint.h>
13 #include <linux/types.h>
14
15 #ifdef CONFIG_KMEMTRACE
16 extern void kmemtrace_init(void);
17 #else
18 static inline void kmemtrace_init(void)
19 {
20 }
21 #endif
22
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));
59
60 #endif /* __KERNEL__ */
61
62 #endif /* _LINUX_KMEMTRACE_H */
63