blob: 28ee69f9cd46d73159c362729ceb1e50c0d3cd10 [file] [log] [blame]
Eduard - Gabriel Munteanub9ce08c2008-08-10 20:14:03 +03001/*
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 Munteanuca2b84cb2009-03-23 15:12:24 +020012#include <linux/tracepoint.h>
Eduard - Gabriel Munteanub9ce08c2008-08-10 20:14:03 +030013#include <linux/types.h>
Eduard - Gabriel Munteanub9ce08c2008-08-10 20:14:03 +030014
15#ifdef CONFIG_KMEMTRACE
Eduard - Gabriel Munteanub9ce08c2008-08-10 20:14:03 +030016extern void kmemtrace_init(void);
Eduard - Gabriel Munteanuca2b84cb2009-03-23 15:12:24 +020017#else
Eduard - Gabriel Munteanub9ce08c2008-08-10 20:14:03 +030018static inline void kmemtrace_init(void)
19{
20}
Eduard - Gabriel Munteanuca2b84cb2009-03-23 15:12:24 +020021#endif
Eduard - Gabriel Munteanub9ce08c2008-08-10 20:14:03 +030022
Eduard - Gabriel Munteanuca2b84cb2009-03-23 15:12:24 +020023DECLARE_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));
30DECLARE_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));
37DECLARE_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));
45DECLARE_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));
53DECLARE_TRACE(kfree,
54 TP_PROTO(unsigned long call_site, const void *ptr),
55 TP_ARGS(call_site, ptr));
56DECLARE_TRACE(kmem_cache_free,
57 TP_PROTO(unsigned long call_site, const void *ptr),
58 TP_ARGS(call_site, ptr));
Eduard - Gabriel Munteanub9ce08c2008-08-10 20:14:03 +030059
60#endif /* __KERNEL__ */
61
62#endif /* _LINUX_KMEMTRACE_H */
63