Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
oprofilefs.c File Reference
#include <linux/init.h>
#include <linux/module.h>
#include <linux/oprofile.h>
#include <linux/fs.h>
#include <linux/pagemap.h>
#include <asm/uaccess.h>
#include "oprof.h"

Go to the source code of this file.

Macros

#define OPROFILEFS_MAGIC   0x6f70726f
 
#define TMPBUFSIZE   50
 

Functions

 DEFINE_RAW_SPINLOCK (oprofilefs_lock)
 
ssize_t oprofilefs_str_to_user (char const *str, char __user *buf, size_t count, loff_t *offset)
 
ssize_t oprofilefs_ulong_to_user (unsigned long val, char __user *buf, size_t count, loff_t *offset)
 
int oprofilefs_ulong_from_user (unsigned long *val, char const __user *buf, size_t count)
 
int oprofilefs_create_ulong (struct super_block *sb, struct dentry *root, char const *name, unsigned long *val)
 
int oprofilefs_create_ro_ulong (struct super_block *sb, struct dentry *root, char const *name, unsigned long *val)
 
int oprofilefs_create_ro_atomic (struct super_block *sb, struct dentry *root, char const *name, atomic_t *val)
 
int oprofilefs_create_file (struct super_block *sb, struct dentry *root, char const *name, const struct file_operations *fops)
 
int oprofilefs_create_file_perm (struct super_block *sb, struct dentry *root, char const *name, const struct file_operations *fops, int perm)
 
struct dentryoprofilefs_mkdir (struct super_block *sb, struct dentry *root, char const *name)
 
int __init oprofilefs_register (void)
 
void __exit oprofilefs_unregister (void)
 

Detailed Description

Remarks
Copyright 2002 OProfile authors
Read the file COPYING
Author
John Levon

A simple filesystem for configuration and access of oprofile.

Definition in file oprofilefs.c.

Macro Definition Documentation

#define OPROFILEFS_MAGIC   0x6f70726f

Definition at line 22 of file oprofilefs.c.

#define TMPBUFSIZE   50

Definition at line 51 of file oprofilefs.c.

Function Documentation

DEFINE_RAW_SPINLOCK ( oprofilefs_lock  )
int oprofilefs_create_file ( struct super_block sb,
struct dentry root,
char const name,
const struct file_operations fops 
)

Create a file of the given name as a child of the given root, with the specified file operations.

Definition at line 195 of file oprofilefs.c.

int oprofilefs_create_file_perm ( struct super_block sb,
struct dentry root,
char const name,
const struct file_operations fops,
int  perm 
)

Definition at line 202 of file oprofilefs.c.

int oprofilefs_create_ro_atomic ( struct super_block sb,
struct dentry root,
char const name,
atomic_t val 
)

Create a file for read-only access to an atomic_t.

Definition at line 187 of file oprofilefs.c.

int oprofilefs_create_ro_ulong ( struct super_block sb,
struct dentry root,
char const name,
ulong val 
)

Create a file for read-only access to an unsigned long.

Definition at line 165 of file oprofilefs.c.

int oprofilefs_create_ulong ( struct super_block sb,
struct dentry root,
char const name,
ulong val 
)

Create a file for read/write access to an unsigned long.

Definition at line 157 of file oprofilefs.c.

struct dentry* oprofilefs_mkdir ( struct super_block sb,
struct dentry root,
char const name 
)
read

create a directory

Definition at line 209 of file oprofilefs.c.

int __init oprofilefs_register ( void  )

Definition at line 271 of file oprofilefs.c.

ssize_t oprofilefs_str_to_user ( char const str,
char __user buf,
size_t  count,
loff_t *  offset 
)

Write the given asciz string to the given user buffer , updating *offset appropriately. Returns bytes written or -EFAULT.

Definition at line 45 of file oprofilefs.c.

int oprofilefs_ulong_from_user ( unsigned long val,
char const __user buf,
size_t  count 
)

Read an ASCII string for a number from a userspace buffer and fill *val on success. Returns 0 on success, < 0 on error.

Definition at line 70 of file oprofilefs.c.

ssize_t oprofilefs_ulong_to_user ( unsigned long  val,
char __user buf,
size_t  count,
loff_t *  offset 
)

Convert an unsigned long value into ASCII and copy it to the user buffer , updating *offset appropriately. Returns bytes written or -EFAULT.

Definition at line 53 of file oprofilefs.c.

void __exit oprofilefs_unregister ( void  )

Definition at line 277 of file oprofilefs.c.