Linux Kernel
3.7.1
|
#include <linux/sched.h>
#include <linux/oprofile.h>
#include <linux/errno.h>
#include "event_buffer.h"
#include "cpu_buffer.h"
#include "buffer_sync.h"
#include "oprof.h"
Go to the source code of this file.
Macros | |
#define | OP_BUFFER_FLAGS 0 |
#define | DEFAULT_TIMER_EXPIRE (HZ / 10) |
#define | RB_EVENT_HDR_SIZE 4 |
Each CPU has a local buffer that stores PC value/event pairs. We also log context switches when we notice them. Eventually each CPU's buffer is processed into the global event buffer by sync_buffer().
We use a local buffer for two reasons: an NMI or similar interrupt cannot synchronise, and high sampling rates would lead to catastrophic global synchronisation if a global buffer was used.
Definition in file cpu_buffer.c.
#define DEFAULT_TIMER_EXPIRE (HZ / 10) |
Definition at line 38 of file cpu_buffer.c.
#define OP_BUFFER_FLAGS 0 |
Definition at line 31 of file cpu_buffer.c.
#define RB_EVENT_HDR_SIZE 4 |
Definition at line 60 of file cpu_buffer.c.
Definition at line 62 of file cpu_buffer.c.
DEFINE_PER_CPU | ( | struct oprofile_cpu_buffer | , |
op_cpu_buffer | |||
) |
Definition at line 112 of file cpu_buffer.c.
Definition at line 117 of file cpu_buffer.c.
Definition at line 53 of file cpu_buffer.c.
Definition at line 176 of file cpu_buffer.c.
Definition at line 161 of file cpu_buffer.c.
Definition at line 156 of file cpu_buffer.c.
Definition at line 142 of file cpu_buffer.c.
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.
Definition at line 46 of file cpu_buffer.c.
Definition at line 41 of file cpu_buffer.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.
Definition at line 95 of file cpu_buffer.c.