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

TOMOYO Linux Cross Reference
Linux/include/linux/fault-inject.h

Version: ~ [ linux-5.12-rc5 ] ~ [ linux-5.11.11 ] ~ [ linux-5.10.27 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.109 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.184 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.228 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.264 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.264 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef _LINUX_FAULT_INJECT_H
  2 #define _LINUX_FAULT_INJECT_H
  3 
  4 #ifdef CONFIG_FAULT_INJECTION
  5 
  6 #include <linux/types.h>
  7 #include <linux/debugfs.h>
  8 #include <linux/atomic.h>
  9 
 10 /*
 11  * For explanation of the elements of this struct, see
 12  * Documentation/fault-injection/fault-injection.txt
 13  */
 14 struct fault_attr {
 15         unsigned long probability;
 16         unsigned long interval;
 17         atomic_t times;
 18         atomic_t space;
 19         unsigned long verbose;
 20         u32 task_filter;
 21         unsigned long stacktrace_depth;
 22         unsigned long require_start;
 23         unsigned long require_end;
 24         unsigned long reject_start;
 25         unsigned long reject_end;
 26 
 27         unsigned long count;
 28 };
 29 
 30 #define FAULT_ATTR_INITIALIZER {                                \
 31                 .interval = 1,                                  \
 32                 .times = ATOMIC_INIT(1),                        \
 33                 .require_end = ULONG_MAX,                       \
 34                 .stacktrace_depth = 32,                         \
 35                 .verbose = 2,                                   \
 36         }
 37 
 38 #define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER
 39 int setup_fault_attr(struct fault_attr *attr, char *str);
 40 bool should_fail(struct fault_attr *attr, ssize_t size);
 41 
 42 #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
 43 
 44 struct dentry *fault_create_debugfs_attr(const char *name,
 45                         struct dentry *parent, struct fault_attr *attr);
 46 
 47 #else /* CONFIG_FAULT_INJECTION_DEBUG_FS */
 48 
 49 static inline struct dentry *fault_create_debugfs_attr(const char *name,
 50                         struct dentry *parent, struct fault_attr *attr)
 51 {
 52         return ERR_PTR(-ENODEV);
 53 }
 54 
 55 #endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */
 56 
 57 #endif /* CONFIG_FAULT_INJECTION */
 58 
 59 #ifdef CONFIG_FAILSLAB
 60 extern bool should_failslab(size_t size, gfp_t gfpflags, unsigned long flags);
 61 #else
 62 static inline bool should_failslab(size_t size, gfp_t gfpflags,
 63                                 unsigned long flags)
 64 {
 65         return false;
 66 }
 67 #endif /* CONFIG_FAILSLAB */
 68 
 69 #endif /* _LINUX_FAULT_INJECT_H */
 70 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp