Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
perf_event.h File Reference
#include <linux/perf_event.h>

Go to the source code of this file.

Data Structures

struct  event_constraint
 
struct  amd_nb
 
struct  debug_store
 
struct  er_account
 
struct  intel_shared_regs
 
struct  cpu_hw_events
 
struct  extra_reg
 
union  perf_capabilities
 
struct  x86_pmu_quirk
 
union  x86_pmu_config
 
struct  x86_pmu
 

Macros

#define MAX_PEBS_EVENTS   8
 
#define MAX_LBR_ENTRIES   16
 
#define __EVENT_CONSTRAINT(c, n, m, w, o)
 
#define EVENT_CONSTRAINT(c, n, m)   __EVENT_CONSTRAINT(c, n, m, HWEIGHT(n), 0)
 
#define EVENT_CONSTRAINT_OVERLAP(c, n, m)   __EVENT_CONSTRAINT(c, n, m, HWEIGHT(n), 1)
 
#define INTEL_EVENT_CONSTRAINT(c, n)   EVENT_CONSTRAINT(c, n, ARCH_PERFMON_EVENTSEL_EVENT)
 
#define FIXED_EVENT_CONSTRAINT(c, n)   EVENT_CONSTRAINT(c, (1ULL << (32+n)), X86_RAW_EVENT_MASK)
 
#define INTEL_UEVENT_CONSTRAINT(c, n)   EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVENT_MASK)
 
#define EVENT_CONSTRAINT_END   EVENT_CONSTRAINT(0, 0, 0)
 
#define for_each_event_constraint(e, c)   for ((e) = (c); (e)->weight; (e)++)
 
#define EVENT_EXTRA_REG(e, ms, m, vm, i)
 
#define INTEL_EVENT_EXTRA_REG(event, msr, vm, idx)   EVENT_EXTRA_REG(event, msr, ARCH_PERFMON_EVENTSEL_EVENT, vm, idx)
 
#define EVENT_EXTRA_END   EVENT_EXTRA_REG(0, 0, 0, 0, RSP_0)
 
#define X86_CONFIG(args...)   ((union x86_pmu_config){.bits = {args}}).value
 
#define x86_add_quirk(func_)
 
#define ERF_NO_HT_SHARING   1
 
#define ERF_HAS_RSP_1   2
 
#define C(x)   PERF_COUNT_HW_CACHE_##x
 

Enumerations

enum  extra_reg_type {
  EXTRA_REG_NONE = -1, EXTRA_REG_RSP_0 = 0, EXTRA_REG_RSP_1 = 1, EXTRA_REG_LBR = 2,
  EXTRA_REG_MAX
}
 

Functions

 DECLARE_PER_CPU (struct cpu_hw_events, cpu_hw_events)
 
int x86_perf_event_set_period (struct perf_event *event)
 
u64 x86_perf_event_update (struct perf_event *event)
 
int x86_setup_perfctr (struct perf_event *event)
 
int x86_pmu_hw_config (struct perf_event *event)
 
void x86_pmu_disable_all (void)
 
void x86_pmu_enable_all (int added)
 
int perf_assign_events (struct event_constraint **constraints, int n, int wmin, int wmax, int *assign)
 
int x86_schedule_events (struct cpu_hw_events *cpuc, int n, int *assign)
 
void x86_pmu_stop (struct perf_event *event, int flags)
 
void x86_pmu_enable_event (struct perf_event *event)
 
int x86_pmu_handle_irq (struct pt_regs *regs)
 

Variables

struct x86_pmu x86_pmu __read_mostly
 
u64 __read_mostly hw_cache_event_ids [PERF_COUNT_HW_CACHE_MAX][PERF_COUNT_HW_CACHE_OP_MAX][PERF_COUNT_HW_CACHE_RESULT_MAX]
 
u64 __read_mostly hw_cache_extra_regs [PERF_COUNT_HW_CACHE_MAX][PERF_COUNT_HW_CACHE_OP_MAX][PERF_COUNT_HW_CACHE_RESULT_MAX]
 
struct event_constraint emptyconstraint
 
struct event_constraint unconstrained
 

Macro Definition Documentation

#define __EVENT_CONSTRAINT (   c,
  n,
  m,
  w,
 
)
Value:
{\
{ .idxmsk64 = (n) }, \
.code = (c), \
.cmask = (m), \
.weight = (w), \
.overlap = (o), \
}

Definition at line 173 of file perf_event.h.

#define C (   x)    PERF_COUNT_HW_CACHE_##x

Definition at line 434 of file perf_event.h.

#define ERF_HAS_RSP_1   2

Definition at line 418 of file perf_event.h.

#define ERF_NO_HT_SHARING   1

Definition at line 417 of file perf_event.h.

#define EVENT_CONSTRAINT (   c,
  n,
  m 
)    __EVENT_CONSTRAINT(c, n, m, HWEIGHT(n), 0)

Definition at line 181 of file perf_event.h.

#define EVENT_CONSTRAINT_END   EVENT_CONSTRAINT(0, 0, 0)

Definition at line 234 of file perf_event.h.

#define EVENT_CONSTRAINT_OVERLAP (   c,
  n,
  m 
)    __EVENT_CONSTRAINT(c, n, m, HWEIGHT(n), 1)

Definition at line 205 of file perf_event.h.

#define EVENT_EXTRA_END   EVENT_EXTRA_REG(0, 0, 0, 0, RSP_0)

Definition at line 269 of file perf_event.h.

#define EVENT_EXTRA_REG (   e,
  ms,
  m,
  vm,
  i 
)
Value:
{ \
.event = (e), \
.msr = (ms), \
.config_mask = (m), \
.valid_mask = (vm), \
.idx = EXTRA_REG_##i \
}

Definition at line 258 of file perf_event.h.

#define FIXED_EVENT_CONSTRAINT (   c,
  n 
)    EVENT_CONSTRAINT(c, (1ULL << (32+n)), X86_RAW_EVENT_MASK)

Definition at line 225 of file perf_event.h.

#define for_each_event_constraint (   e,
  c 
)    for ((e) = (c); (e)->weight; (e)++)

Definition at line 237 of file perf_event.h.

#define INTEL_EVENT_CONSTRAINT (   c,
  n 
)    EVENT_CONSTRAINT(c, n, ARCH_PERFMON_EVENTSEL_EVENT)

Definition at line 211 of file perf_event.h.

#define INTEL_EVENT_EXTRA_REG (   event,
  msr,
  vm,
  idx 
)    EVENT_EXTRA_REG(event, msr, ARCH_PERFMON_EVENTSEL_EVENT, vm, idx)

Definition at line 266 of file perf_event.h.

#define INTEL_UEVENT_CONSTRAINT (   c,
  n 
)    EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVENT_MASK)

Definition at line 231 of file perf_event.h.

#define MAX_LBR_ENTRIES   16

Definition at line 113 of file perf_event.h.

#define MAX_PEBS_EVENTS   8

Definition at line 72 of file perf_event.h.

#define x86_add_quirk (   func_)
Value:
do { \
static struct x86_pmu_quirk __quirk __initdata = { \
.func = func_, \
}; \
__quirk.next = x86_pmu.quirks; \
x86_pmu.quirks = &__quirk; \
} while (0)

Definition at line 408 of file perf_event.h.

#define X86_CONFIG (   args...)    ((union x86_pmu_config){.bits = {args}}).value

Definition at line 308 of file perf_event.h.

Enumeration Type Documentation

Enumerator:
EXTRA_REG_NONE 
EXTRA_REG_RSP_0 
EXTRA_REG_RSP_1 
EXTRA_REG_LBR 
EXTRA_REG_MAX 

Definition at line 43 of file perf_event.h.

Function Documentation

DECLARE_PER_CPU ( struct cpu_hw_events  ,
cpu_hw_events   
)
int perf_assign_events ( struct event_constraint **  constraints,
int  n,
int  wmin,
int  wmax,
int assign 
)

Definition at line 708 of file perf_event.c.

int x86_perf_event_set_period ( struct perf_event event)

Definition at line 929 of file perf_event.c.

u64 x86_perf_event_update ( struct perf_event event)

Definition at line 60 of file perf_event.c.

void x86_pmu_disable_all ( void  )

Definition at line 493 of file perf_event.c.

void x86_pmu_enable_all ( int  added)

Definition at line 528 of file perf_event.c.

void x86_pmu_enable_event ( struct perf_event event)

Definition at line 989 of file perf_event.c.

int x86_pmu_handle_irq ( struct pt_regs regs)

Definition at line 1181 of file perf_event.c.

int x86_pmu_hw_config ( struct perf_event event)

Definition at line 383 of file perf_event.c.

void x86_pmu_stop ( struct perf_event event,
int  flags 
)

Definition at line 1128 of file perf_event.c.

int x86_schedule_events ( struct cpu_hw_events cpuc,
int  n,
int assign 
)

Definition at line 725 of file perf_event.c.

int x86_setup_perfctr ( struct perf_event event)

Definition at line 290 of file perf_event.c.

Variable Documentation

struct x86_pmu x86_pmu __read_mostly

Definition at line 81 of file setup.c.

struct event_constraint emptyconstraint

Definition at line 1258 of file perf_event.c.

Definition at line 49 of file perf_event.c.

Definition at line 53 of file perf_event.c.

struct event_constraint unconstrained

Definition at line 1259 of file perf_event.c.