Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions | Variables
file.c File Reference
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/seq_file.h>
#include <linux/pagemap.h>
#include <linux/namei.h>
#include <linux/debugfs.h>
#include <linux/io.h>
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  array_data
 

Functions

 DEFINE_SIMPLE_ATTRIBUTE (fops_u8, debugfs_u8_get, debugfs_u8_set,"%llu\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_u8_ro, debugfs_u8_get, NULL,"%llu\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_u8_wo, NULL, debugfs_u8_set,"%llu\n")
 

Variables

struct file_operations debugfs_file_operations
 
struct inode_operations debugfs_link_operations
 

: a pointer to a string containing the name of the file to create.

debugfs_create_u32_array - create a debugfs file that is used to read u32 array.

: the permission that the file should have. : a pointer to the parent dentry for this file. This should be a directory dentry if set. If this parameter is NULL, then the file will be created in the root of the debugfs filesystem. : u32 array that provides data. : total number of elements in the array.

This function creates a file in debugfs with the given name that exports as data. If the variable is so set it can be read from. Writing is not supported. Seek within the file is also not supported. Once array is created its size can not be changed.

The function returns a pointer to dentry on success. If debugfs is not enabled in the kernel, the value -ENODEV will be returned.

struct dentrydebugfs_create_u8 (const char *name, umode_t mode, struct dentry *parent, u8 *value)
 
 EXPORT_SYMBOL_GPL (debugfs_create_u8)
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_u16, debugfs_u16_get, debugfs_u16_set,"%llu\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_u16_ro, debugfs_u16_get, NULL,"%llu\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_u16_wo, NULL, debugfs_u16_set,"%llu\n")
 
struct dentrydebugfs_create_u16 (const char *name, umode_t mode, struct dentry *parent, u16 *value)
 
 EXPORT_SYMBOL_GPL (debugfs_create_u16)
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_u32, debugfs_u32_get, debugfs_u32_set,"%llu\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_u32_ro, debugfs_u32_get, NULL,"%llu\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_u32_wo, NULL, debugfs_u32_set,"%llu\n")
 
struct dentrydebugfs_create_u32 (const char *name, umode_t mode, struct dentry *parent, u32 *value)
 
 EXPORT_SYMBOL_GPL (debugfs_create_u32)
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_u64, debugfs_u64_get, debugfs_u64_set,"%llu\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_u64_ro, debugfs_u64_get, NULL,"%llu\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_u64_wo, NULL, debugfs_u64_set,"%llu\n")
 
struct dentrydebugfs_create_u64 (const char *name, umode_t mode, struct dentry *parent, u64 *value)
 
 EXPORT_SYMBOL_GPL (debugfs_create_u64)
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_x8, debugfs_u8_get, debugfs_u8_set,"0x%02llx\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_x8_ro, debugfs_u8_get, NULL,"0x%02llx\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_x8_wo, NULL, debugfs_u8_set,"0x%02llx\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_x16, debugfs_u16_get, debugfs_u16_set,"0x%04llx\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_x16_ro, debugfs_u16_get, NULL,"0x%04llx\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_x16_wo, NULL, debugfs_u16_set,"0x%04llx\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_x32, debugfs_u32_get, debugfs_u32_set,"0x%08llx\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_x32_ro, debugfs_u32_get, NULL,"0x%08llx\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_x32_wo, NULL, debugfs_u32_set,"0x%08llx\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_x64, debugfs_u64_get, debugfs_u64_set,"0x%016llx\n")
 
struct dentrydebugfs_create_x8 (const char *name, umode_t mode, struct dentry *parent, u8 *value)
 
 EXPORT_SYMBOL_GPL (debugfs_create_x8)
 
struct dentrydebugfs_create_x16 (const char *name, umode_t mode, struct dentry *parent, u16 *value)
 
 EXPORT_SYMBOL_GPL (debugfs_create_x16)
 
struct dentrydebugfs_create_x32 (const char *name, umode_t mode, struct dentry *parent, u32 *value)
 
 EXPORT_SYMBOL_GPL (debugfs_create_x32)
 
struct dentrydebugfs_create_x64 (const char *name, umode_t mode, struct dentry *parent, u64 *value)
 
 EXPORT_SYMBOL_GPL (debugfs_create_x64)
 
 DEFINE_SIMPLE_ATTRIBUTE (fops_size_t, debugfs_size_t_get, debugfs_size_t_set,"%llu\n")
 
struct dentrydebugfs_create_size_t (const char *name, umode_t mode, struct dentry *parent, size_t *value)
 
 EXPORT_SYMBOL_GPL (debugfs_create_size_t)
 
struct dentrydebugfs_create_bool (const char *name, umode_t mode, struct dentry *parent, u32 *value)
 
 EXPORT_SYMBOL_GPL (debugfs_create_bool)
 
struct dentrydebugfs_create_blob (const char *name, umode_t mode, struct dentry *parent, struct debugfs_blob_wrapper *blob)
 
 EXPORT_SYMBOL_GPL (debugfs_create_blob)
 
struct dentrydebugfs_create_u32_array (const char *name, umode_t mode, struct dentry *parent, u32 *array, u32 elements)
 
 EXPORT_SYMBOL_GPL (debugfs_create_u32_array)
 

Function Documentation

struct dentry* debugfs_create_blob ( const char name,
umode_t  mode,
struct dentry parent,
struct debugfs_blob_wrapper blob 
)
read

Definition at line 516 of file file.c.

struct dentry* debugfs_create_bool ( const char name,
umode_t  mode,
struct dentry parent,
u32 value 
)
read

Definition at line 471 of file file.c.

struct dentry* debugfs_create_size_t ( const char name,
umode_t  mode,
struct dentry parent,
size_t value 
)
read

Definition at line 399 of file file.c.

struct dentry* debugfs_create_u16 ( const char name,
umode_t  mode,
struct dentry parent,
u16 value 
)
read

Definition at line 145 of file file.c.

struct dentry* debugfs_create_u32 ( const char name,
umode_t  mode,
struct dentry parent,
u32 value 
)
read

Definition at line 197 of file file.c.

struct dentry* debugfs_create_u32_array ( const char name,
umode_t  mode,
struct dentry parent,
u32 array,
u32  elements 
)
read

Definition at line 613 of file file.c.

struct dentry* debugfs_create_u64 ( const char name,
umode_t  mode,
struct dentry parent,
u64 value 
)
read

Definition at line 250 of file file.c.

struct dentry* debugfs_create_u8 ( const char name,
umode_t  mode,
struct dentry parent,
u8 value 
)
read

Definition at line 93 of file file.c.

struct dentry* debugfs_create_x16 ( const char name,
umode_t  mode,
struct dentry parent,
u16 value 
)
read

Definition at line 320 of file file.c.

struct dentry* debugfs_create_x32 ( const char name,
umode_t  mode,
struct dentry parent,
u32 value 
)
read

Definition at line 344 of file file.c.

struct dentry* debugfs_create_x64 ( const char name,
umode_t  mode,
struct dentry parent,
u64 value 
)
read

Definition at line 368 of file file.c.

struct dentry* debugfs_create_x8 ( const char name,
umode_t  mode,
struct dentry parent,
u8 value 
)
read

Definition at line 296 of file file.c.

DEFINE_SIMPLE_ATTRIBUTE ( fops_u8  ,
debugfs_u8_get  ,
debugfs_u8_set  ,
"%llu\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_u8_ro  ,
debugfs_u8_get  ,
NULL  ,
"%llu\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_u8_wo  ,
NULL  ,
debugfs_u8_set  ,
"%llu\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_u16  ,
debugfs_u16_get  ,
debugfs_u16_set  ,
"%llu\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_u16_ro  ,
debugfs_u16_get  ,
NULL  ,
"%llu\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_u16_wo  ,
NULL  ,
debugfs_u16_set  ,
"%llu\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_u32  ,
debugfs_u32_get  ,
debugfs_u32_set  ,
"%llu\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_u32_ro  ,
debugfs_u32_get  ,
NULL  ,
"%llu\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_u32_wo  ,
NULL  ,
debugfs_u32_set  ,
"%llu\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_u64  ,
debugfs_u64_get  ,
debugfs_u64_set  ,
"%llu\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_u64_ro  ,
debugfs_u64_get  ,
NULL  ,
"%llu\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_u64_wo  ,
NULL  ,
debugfs_u64_set  ,
"%llu\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_x8  ,
debugfs_u8_get  ,
debugfs_u8_set  ,
"0x%02llx\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_x8_ro  ,
debugfs_u8_get  ,
NULL  ,
"0x%02llx\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_x8_wo  ,
NULL  ,
debugfs_u8_set  ,
"0x%02llx\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_x16  ,
debugfs_u16_get  ,
debugfs_u16_set  ,
"0x%04llx\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_x16_ro  ,
debugfs_u16_get  ,
NULL  ,
"0x%04llx\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_x16_wo  ,
NULL  ,
debugfs_u16_set  ,
"0x%04llx\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_x32  ,
debugfs_u32_get  ,
debugfs_u32_set  ,
"0x%08llx\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_x32_ro  ,
debugfs_u32_get  ,
NULL  ,
"0x%08llx\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_x32_wo  ,
NULL  ,
debugfs_u32_set  ,
"0x%08llx\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_x64  ,
debugfs_u64_get  ,
debugfs_u64_set  ,
"0x%016llx\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( fops_size_t  ,
debugfs_size_t_get  ,
debugfs_size_t_set  ,
"%llu\n"   
)
EXPORT_SYMBOL_GPL ( debugfs_create_u8  )
EXPORT_SYMBOL_GPL ( debugfs_create_u16  )
EXPORT_SYMBOL_GPL ( debugfs_create_u32  )
EXPORT_SYMBOL_GPL ( debugfs_create_u64  )
EXPORT_SYMBOL_GPL ( debugfs_create_x8  )
EXPORT_SYMBOL_GPL ( debugfs_create_x16  )
EXPORT_SYMBOL_GPL ( debugfs_create_x32  )
EXPORT_SYMBOL_GPL ( debugfs_create_x64  )
EXPORT_SYMBOL_GPL ( debugfs_create_size_t  )
EXPORT_SYMBOL_GPL ( debugfs_create_bool  )
EXPORT_SYMBOL_GPL ( debugfs_create_blob  )
EXPORT_SYMBOL_GPL ( debugfs_create_u32_array  )

Variable Documentation

struct file_operations debugfs_file_operations
Initial value:
= {
.read = default_read_file,
.write = default_write_file,
.open = simple_open,
.llseek = noop_llseek,
}

Definition at line 37 of file file.c.

struct inode_operations debugfs_link_operations
Initial value:
= {
.readlink = generic_readlink,
.follow_link = debugfs_follow_link,
}

Definition at line 50 of file file.c.