~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/kmemleak.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * include/linux/kmemleak.h
  4  *
  5  * Copyright (C) 2008 ARM Limited
  6  * Written by Catalin Marinas <catalin.marinas@arm.com>
  7  */
  8 
  9 #ifndef __KMEMLEAK_H
 10 #define __KMEMLEAK_H
 11 
 12 #include <linux/slab.h>
 13 #include <linux/vmalloc.h>
 14 
 15 #ifdef CONFIG_DEBUG_KMEMLEAK
 16 
 17 extern void kmemleak_init(void) __init;
 18 extern void kmemleak_alloc(const void *ptr, size_t size, int min_count,
 19                            gfp_t gfp) __ref;
 20 extern void kmemleak_alloc_percpu(const void __percpu *ptr, size_t size,
 21                                   gfp_t gfp) __ref;
 22 extern void kmemleak_vmalloc(const struct vm_struct *area, size_t size,
 23                              gfp_t gfp) __ref;
 24 extern void kmemleak_free(const void *ptr) __ref;
 25 extern void kmemleak_free_part(const void *ptr, size_t size) __ref;
 26 extern void kmemleak_free_percpu(const void __percpu *ptr) __ref;
 27 extern void kmemleak_update_trace(const void *ptr) __ref;
 28 extern void kmemleak_not_leak(const void *ptr) __ref;
 29 extern void kmemleak_ignore(const void *ptr) __ref;
 30 extern void kmemleak_scan_area(const void *ptr, size_t size, gfp_t gfp) __ref;
 31 extern void kmemleak_no_scan(const void *ptr) __ref;
 32 extern void kmemleak_alloc_phys(phys_addr_t phys, size_t size,
 33                                 gfp_t gfp) __ref;
 34 extern void kmemleak_free_part_phys(phys_addr_t phys, size_t size) __ref;
 35 extern void kmemleak_ignore_phys(phys_addr_t phys) __ref;
 36 
 37 static inline void kmemleak_alloc_recursive(const void *ptr, size_t size,
 38                                             int min_count, slab_flags_t flags,
 39                                             gfp_t gfp)
 40 {
 41         if (!(flags & SLAB_NOLEAKTRACE))
 42                 kmemleak_alloc(ptr, size, min_count, gfp);
 43 }
 44 
 45 static inline void kmemleak_free_recursive(const void *ptr, slab_flags_t flags)
 46 {
 47         if (!(flags & SLAB_NOLEAKTRACE))
 48                 kmemleak_free(ptr);
 49 }
 50 
 51 static inline void kmemleak_erase(void **ptr)
 52 {
 53         *ptr = NULL;
 54 }
 55 
 56 #else
 57 
 58 static inline void kmemleak_init(void)
 59 {
 60 }
 61 static inline void kmemleak_alloc(const void *ptr, size_t size, int min_count,
 62                                   gfp_t gfp)
 63 {
 64 }
 65 static inline void kmemleak_alloc_recursive(const void *ptr, size_t size,
 66                                             int min_count, slab_flags_t flags,
 67                                             gfp_t gfp)
 68 {
 69 }
 70 static inline void kmemleak_alloc_percpu(const void __percpu *ptr, size_t size,
 71                                          gfp_t gfp)
 72 {
 73 }
 74 static inline void kmemleak_vmalloc(const struct vm_struct *area, size_t size,
 75                                     gfp_t gfp)
 76 {
 77 }
 78 static inline void kmemleak_free(const void *ptr)
 79 {
 80 }
 81 static inline void kmemleak_free_part(const void *ptr, size_t size)
 82 {
 83 }
 84 static inline void kmemleak_free_recursive(const void *ptr, slab_flags_t flags)
 85 {
 86 }
 87 static inline void kmemleak_free_percpu(const void __percpu *ptr)
 88 {
 89 }
 90 static inline void kmemleak_update_trace(const void *ptr)
 91 {
 92 }
 93 static inline void kmemleak_not_leak(const void *ptr)
 94 {
 95 }
 96 static inline void kmemleak_ignore(const void *ptr)
 97 {
 98 }
 99 static inline void kmemleak_scan_area(const void *ptr, size_t size, gfp_t gfp)
100 {
101 }
102 static inline void kmemleak_erase(void **ptr)
103 {
104 }
105 static inline void kmemleak_no_scan(const void *ptr)
106 {
107 }
108 static inline void kmemleak_alloc_phys(phys_addr_t phys, size_t size,
109                                        gfp_t gfp)
110 {
111 }
112 static inline void kmemleak_free_part_phys(phys_addr_t phys, size_t size)
113 {
114 }
115 static inline void kmemleak_ignore_phys(phys_addr_t phys)
116 {
117 }
118 
119 #endif  /* CONFIG_DEBUG_KMEMLEAK */
120 
121 #endif  /* __KMEMLEAK_H */
122 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php