58#define DEFINE_DEBUGFS_ATTRIBUTE_XSIGNED(__fops, __get, __set, __fmt, __is_signed) \
59static int __fops ## _open(struct inode *inode, struct file *file) \
61 __simple_attr_check_format(__fmt, 0ull); \
62 return simple_attr_open(inode, file, __get, __set, __fmt); \
64static const struct file_operations __fops = { \
65 .owner = THIS_MODULE, \
66 .open = __fops ## _open, \
67 .release = simple_attr_release, \
68 .read = debugfs_attr_read, \
69 .write = (__is_signed) ? debugfs_attr_write_signed : debugfs_attr_write, \
72#define DEFINE_DEBUGFS_ATTRIBUTE(__fops, __get, __set, __fmt) \
73 DEFINE_DEBUGFS_ATTRIBUTE_XSIGNED(__fops, __get, __set, __fmt, false)
75#define DEFINE_DEBUGFS_ATTRIBUTE_SIGNED(__fops, __get, __set, __fmt) \
76 DEFINE_DEBUGFS_ATTRIBUTE_XSIGNED(__fops, __get, __set, __fmt, true)
78typedef struct vfsmount *(*debugfs_automount_t)(
struct dentry *,
void *);
86#if defined(CONFIG_DEBUG_FS)
88struct dentry *debugfs_lookup(
const char *
name,
struct dentry *
parent);
135#define debugfs_create_file(name, mode, parent, data, fops) \
137 const struct file_operations *: debugfs_create_file_full, \
138 const struct debugfs_short_fops *: debugfs_create_file_short, \
139 struct file_operations *: debugfs_create_file_full, \
140 struct debugfs_short_fops *: debugfs_create_file_short) \
141 (name, mode, parent, data, NULL, fops)
143#define debugfs_create_file_aux(name, mode, parent, data, aux, fops) \
145 const struct file_operations *: debugfs_create_file_full, \
146 const struct debugfs_short_fops *: debugfs_create_file_short, \
147 struct file_operations *: debugfs_create_file_full, \
148 struct debugfs_short_fops *: debugfs_create_file_short) \
149 (name, mode, parent, data, aux, fops)
151struct dentry *debugfs_create_file_unsafe(
const char *
name,
umode_t mode,
160struct dentry *debugfs_create_dir(
const char *
name,
struct dentry *
parent);
162struct dentry *debugfs_create_symlink(
const char *
name,
struct dentry *
parent,
165struct dentry *debugfs_create_automount(
const char *
name,
170void debugfs_remove(
struct dentry *dentry);
171#define debugfs_remove_recursive debugfs_remove
173void debugfs_lookup_and_remove(
const char *
name,
struct dentry *
parent);
177int debugfs_file_get(
struct dentry *dentry);
178void debugfs_file_put(
struct dentry *dentry);
187int debugfs_change_name(
struct dentry *dentry,
const char *
fmt, ...)
__printf(2, 3);
198 unsigned long *value);
208 struct dentry *
parent,
size_t *value);
214 struct dentry *
parent,
char **value);
231void debugfs_create_devm_seqfile(struct
device *
dev, const
char *
name,
235bool debugfs_initialized(
void);
238 size_t count,
loff_t *ppos);
241 size_t count,
loff_t *ppos);
244 size_t count,
loff_t *ppos);
254 void (*cancel)(
struct dentry *,
void *);
258void debugfs_enter_cancellation(
struct file *
file,
259 struct debugfs_cancellation *cancellation)
__acquires(cancellation);
260void debugfs_leave_cancellation(
struct file *
file,
261 struct debugfs_cancellation *cancellation)
__releases(cancellation);
273static inline struct dentry *debugfs_lookup(
const char *
name,
279static inline struct dentry *debugfs_create_file_aux(
const char *
name,
281 void *
data,
void *aux,
287static inline struct dentry *debugfs_create_file(
const char *
name,
umode_t mode,
294static inline struct dentry *debugfs_create_file_unsafe(
const char *
name,
302static inline void debugfs_create_file_size(
const char *
name,
umode_t mode,
308static inline struct dentry *debugfs_create_dir(
const char *
name,
314static inline struct dentry *debugfs_create_symlink(
const char *
name,
321static inline struct dentry *debugfs_create_automount(
const char *
name,
329static inline void debugfs_remove(
struct dentry *dentry)
332static inline void debugfs_remove_recursive(
struct dentry *dentry)
335static inline void debugfs_lookup_and_remove(
const char *
name,
341static inline int debugfs_file_get(
struct dentry *dentry)
346static inline void debugfs_file_put(
struct dentry *dentry)
369static inline int __printf(2, 3) debugfs_change_name(struct dentry *dentry,
376 struct dentry *
parent,
u8 *value) { }
389 unsigned long *value) { }
392 struct dentry *
parent,
u8 *value) { }
403static inline void debugfs_create_size_t(
const char *
name,
umode_t mode,
404 struct dentry *
parent,
size_t *value)
407static inline void debugfs_create_atomic_t(
const char *
name,
umode_t mode,
413 struct dentry *
parent,
bool *value) { }
420static inline struct dentry *debugfs_create_blob(
const char *
name,
umode_t mode,
427static inline void debugfs_create_regset32(
const char *
name,
umode_t mode,
438static inline bool debugfs_initialized(
void)
443static inline void debugfs_create_u32_array(
const char *
name,
umode_t mode,
449static inline void debugfs_create_devm_seqfile(
struct device *
dev,
459 size_t count,
loff_t *ppos)
465 const char __user *user_buf,
466 size_t count,
loff_t *ppos)
473 size_t count,
loff_t *ppos)
480#define debugfs_create_file_aux_num(name, mode, parent, data, n, fops) \
481 debugfs_create_file_aux(name, mode, parent, data, \
482 (void *)(unsigned long)n, fops)
483#define debugfs_get_aux_num(f) (unsigned long)debugfs_get_aux(f)
498 unsigned long *value)
500 if (
sizeof(*value) ==
sizeof(
u32))
int64_t ssize_t
Definition stddef.h:38
uint64_t size_t
Definition stdint.h:104
XEProcessList * list
Definition main.cpp:27
#define ENODEV
Definition acclib.h:197
#define __iomem
Definition aclinux.h:312
#define __acquires(...)
Definition compiler-context-analysis.h:299
#define context_lock_struct(name,...)
Definition compiler-context-analysis.h:188
#define __releases(...)
Definition compiler-context-analysis.h:335
#define __printf(fmt_idx, arg_idx)
Definition compiler.h:144
#define __user
Definition compiler.h:63
struct vfsmount *(* debugfs_automount_t)(struct dentry *, void *)
Definition debugfs.h:78
struct dentry * arch_debugfs_dir
static int const char * fmt
Definition debugfs.h:370
void * debugfs_get_aux(const struct file *file)
struct drm_crtc struct drm_plane struct drm_plane const struct drm_crtc_funcs const char * name
Definition drm_crtc.h:1242
const struct device * dev
Definition drm_print.h:519
const char * f
Definition drm_print.h:205
#define ERR_PTR(err)
Definition err.h:51
struct i915_user_extension base
Definition i915_drm.h:0
size_t len
Definition initial.c:23
struct kobject * parent
Definition kobject.h:91
void * data
Definition kthread.h:30
uint64_t u64
Definition kernel.h:17
uint64_t loff_t
Definition kernel.h:49
uint8_t u8
Definition kernel.h:14
uint16_t u16
Definition kernel.h:15
unsigned int umode_t
Definition kernel.h:58
uint32_t u32
Definition kernel.h:16
void * data
Definition debugfs.h:35
unsigned long size
Definition debugfs.h:36
unsigned long offset
Definition debugfs.h:41
char * name
Definition debugfs.h:40
const struct debugfs_reg32 * regs
Definition debugfs.h:45
struct device * dev
Definition debugfs.h:48
int nregs
Definition debugfs.h:46
void __iomem * base
Definition debugfs.h:47
ssize_t(* read)(struct file *, char __user *, size_t, loff_t *)
Definition debugfs.h:81
loff_t(* llseek)(struct file *, loff_t, int)
Definition debugfs.h:83
ssize_t(* write)(struct file *, const char __user *, size_t, loff_t *)
Definition debugfs.h:82
u32 n_elements
Definition debugfs.h:53
u32 * array
Definition debugfs.h:52