Linux Kernel
3.7.1
|
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/printk.h>
#include <linux/atomic.h>
Go to the source code of this file.
Data Structures | |
struct | oprofile_operations |
struct | op_entry |
Macros | |
#define | ESCAPE_CODE ~0UL |
#define | CTX_SWITCH_CODE 1 |
#define | CPU_SWITCH_CODE 2 |
#define | COOKIE_SWITCH_CODE 3 |
#define | KERNEL_ENTER_SWITCH_CODE 4 |
#define | KERNEL_EXIT_SWITCH_CODE 5 |
#define | MODULE_LOADED_CODE 6 |
#define | CTX_TGID_CODE 7 |
#define | TRACE_BEGIN_CODE 8 |
#define | TRACE_END_CODE 9 |
#define | XEN_ENTER_SWITCH_CODE 10 |
#define | SPU_PROFILING_CODE 11 |
#define | SPU_CTX_SWITCH_CODE 12 |
#define | IBS_FETCH_CODE 13 |
#define | IBS_OP_CODE 14 |
Variables | |
raw_spinlock_t | oprofilefs_lock |
API for machine-specific interrupts to interface to oprofile.
Definition in file oprofile.h.
#define COOKIE_SWITCH_CODE 3 |
Definition at line 32 of file oprofile.h.
#define CPU_SWITCH_CODE 2 |
Definition at line 31 of file oprofile.h.
#define CTX_SWITCH_CODE 1 |
Definition at line 30 of file oprofile.h.
#define CTX_TGID_CODE 7 |
Definition at line 36 of file oprofile.h.
#define ESCAPE_CODE ~0UL |
Definition at line 29 of file oprofile.h.
#define IBS_FETCH_CODE 13 |
Definition at line 42 of file oprofile.h.
#define IBS_OP_CODE 14 |
Definition at line 43 of file oprofile.h.
#define KERNEL_ENTER_SWITCH_CODE 4 |
Definition at line 33 of file oprofile.h.
#define KERNEL_EXIT_SWITCH_CODE 5 |
Definition at line 34 of file oprofile.h.
#define MODULE_LOADED_CODE 6 |
Definition at line 35 of file oprofile.h.
#define SPU_CTX_SWITCH_CODE 12 |
Definition at line 41 of file oprofile.h.
#define SPU_PROFILING_CODE 11 |
Definition at line 40 of file oprofile.h.
#define TRACE_BEGIN_CODE 8 |
Definition at line 37 of file oprofile.h.
#define TRACE_END_CODE 9 |
Definition at line 38 of file oprofile.h.
#define XEN_ENTER_SWITCH_CODE 10 |
Definition at line 39 of file oprofile.h.
Definition at line 384 of file cpu_buffer.c.
Definition at line 391 of file cpu_buffer.c.
void oprofile_add_ext_hw_sample | ( | unsigned long | pc, |
struct pt_regs *const | regs, | ||
unsigned long | event, | ||
int | is_kernel, | ||
struct task_struct * | task | ||
) |
Add an hardware sample.
Definition at line 319 of file cpu_buffer.c.
void oprofile_add_ext_sample | ( | unsigned long | pc, |
struct pt_regs *const | regs, | ||
unsigned long | event, | ||
int | is_kernel | ||
) |
Add an extended sample. Use this when the PC is not from the regs, and we cannot determine if we're in kernel mode from the regs.
This function does perform a backtrace.
Definition at line 326 of file cpu_buffer.c.
Definition at line 413 of file cpu_buffer.c.
Add a sample. This may be called from any context.
Definition at line 332 of file cpu_buffer.c.
Definition at line 419 of file cpu_buffer.c.
int oprofile_arch_init | ( | struct oprofile_operations * | ops | ) |
Definition at line 46 of file cpu_buffer.c.
Definition at line 41 of file cpu_buffer.c.
void oprofile_put_buff | ( | unsigned long * | buf, |
unsigned int | start, | ||
unsigned int | stop, | ||
unsigned int | max | ||
) |
Add the contents of a circular buffer to the event buffer.
Definition at line 570 of file buffer_sync.c.
Definition at line 406 of file cpu_buffer.c.
void oprofile_write_reserve | ( | struct op_entry * | entry, |
struct pt_regs *const | regs, | ||
unsigned long | pc, | ||
int | code, | ||
int | size | ||
) |
Definition at line 355 of file cpu_buffer.c.
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.
|
read |
create a directory
Definition at line 209 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.
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.
raw_spinlock_t oprofilefs_lock |
lock for read/write safety