kmemtrace.h 1.6 KB

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