op_events.h File Reference

Details of PMC profiling events. More...

#include "op_cpu_type.h"
#include "op_types.h"
#include "op_list.h"
Include dependency graph for op_events.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  op_unit_mask
 Describe an unit mask. More...
struct  op_unit_mask::op_described_um
struct  op_event
 Describe an event. More...
struct  op_default_event_descr

Defines

#define EXTRA_EDGE   (1U << 18)
#define EXTRA_MIN_VAL   EXTRA_EDGE
#define EXTRA_ANY   (1U << 21)
#define EXTRA_INV   (1U << 23)
#define EXTRA_CMASK_SHIFT   24
#define EXTRA_CMASK_MASK   0xff
#define EXTRA_PEBS   (1U << 19)
#define EXTRA_NONE   (1U << 22)
#define TIMER_EVENT_NAME   "TIMER"
#define TIMER_EVENT_UNIT_MASK_NAME   "timer_unit_mask"
#define TIMER_EVENT_DESC   "Timer based sampling"
#define TIMER_EVENT_VALUE   (u32)-1
#define MAX_UNIT_MASK   64

Enumerations

enum  unit_mask_type { utm_mandatory, utm_exclusive, utm_bitmask }
 

Describe an unit mask type.

More...
enum  op_event_check { OP_OK_EVENT = 0, OP_INVALID_EVENT = 1, OP_INVALID_UM = 2, OP_INVALID_COUNTER = 4 }
 

op_check_events() return code

More...

Functions

struct list_headop_events (op_cpu cpu_type)
 Return the known events list.
struct op_eventop_find_event (op_cpu cpu_type, u32 nr, u32 um)
 Find a given event, returns NULL on error.
struct op_eventop_find_event_any (op_cpu cpu_type, u32 nr)
struct op_eventfind_event_by_name (char const *name, unsigned um, int um_valid)
 Find a given event by name.
char const * find_mapping_for_event (u32 val, op_cpu cpu_type)
 Find a mapping for a given event ID for architectures requiring additional information from what is held in the events file.
int op_check_events (int ctr, u32 event, u32 um, op_cpu cpu_type)
 sanity check event values
void op_free_events (void)
 free memory used by any call to above function.
void op_default_event (op_cpu cpu_type, struct op_default_event_descr *descr)
 op_default_event - return the details of the default event
void op_resolve_unit_mask (struct parsed_event *pe, u32 *extra)

Detailed Description

Details of PMC profiling events.

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

Define Documentation

#define EXTRA_ANY   (1U << 21)

Referenced by parse_extra().

#define EXTRA_CMASK_MASK   0xff

Referenced by parse_extra().

#define EXTRA_CMASK_SHIFT   24

Referenced by parse_extra().

#define EXTRA_EDGE   (1U << 18)

Referenced by parse_extra().

#define EXTRA_INV   (1U << 23)

Referenced by parse_extra().

#define EXTRA_MIN_VAL   EXTRA_EDGE
#define EXTRA_NONE   (1U << 22)

Referenced by parse_extra().

#define EXTRA_PEBS   (1U << 19)
#define MAX_UNIT_MASK   64
#define TIMER_EVENT_DESC   "Timer based sampling"
#define TIMER_EVENT_NAME   "TIMER"
#define TIMER_EVENT_UNIT_MASK_NAME   "timer_unit_mask"
#define TIMER_EVENT_VALUE   (u32)-1

Enumeration Type Documentation

op_check_events() return code

Enumerator:
OP_OK_EVENT 

event is valid and allowed

OP_INVALID_EVENT 

event number is invalid

OP_INVALID_UM 

unit mask is invalid

OP_INVALID_COUNTER 

event is not allowed for the given counter

Describe an unit mask type.

Events can optionally use a filter called the unit mask. the mask type can be a bitmask or a discrete value

Enumerator:
utm_mandatory 

useless but required by the hardware

utm_exclusive 

only one of the values is allowed

utm_bitmask 

bitmask


Function Documentation

struct op_event* find_event_by_name ( char const *  name,
unsigned  um,
int  um_valid 
) [read]

Find a given event by name.

References op_event::event_next, list_entry, list_for_each, and op_event::name.

Referenced by op_resolve_unit_mask().

char const* find_mapping_for_event ( u32  val,
op_cpu  cpu_type 
)

Find a mapping for a given event ID for architectures requiring additional information from what is held in the events file.

References CPU_PPC64_970, CPU_PPC64_970MP, CPU_PPC64_IBM_COMPAT_V1, CPU_PPC64_PA6T, CPU_PPC64_POWER4, CPU_PPC64_POWER5, CPU_PPC64_POWER5p, CPU_PPC64_POWER5pp, CPU_PPC64_POWER6, CPU_PPC64_POWER7, and op_get_cpu_name().

Referenced by main().

int op_check_events ( int  ctr,
u32  event,
u32  um,
op_cpu  cpu_type 
)

sanity check event values

Parameters:
ctr counter number
event value for counter
um unit mask for counter
cpu_type processor type

Check that the counter event and unit mask values are allowed.

The function returns bitmask of failure cause 0 otherwise

See also:
op_cpu, OP_EVENTS_OK

References op_event::counter_mask, op_event::event_next, list_entry, list_for_each, op_unit_mask::num, OP_INVALID_COUNTER, OP_INVALID_EVENT, OP_INVALID_UM, OP_OK_EVENT, op_unit_mask::um, op_event::unit, op_unit_mask::unit_type_mask, utm_bitmask, op_event::val, and op_unit_mask::op_described_um::value.

void op_default_event ( op_cpu  cpu_type,
struct op_default_event_descr descr 
)

op_default_event - return the details of the default event

Parameters:
cpu_type cpu type
descr filled event description

Fills in the event description if applicable

References op_default_event_descr::count, CPU_AMD64_GENERIC, CPU_ARCH_PERFMON, CPU_ARM_MPCORE, CPU_ARM_SCORPION, CPU_ARM_SCORPIONMP, CPU_ARM_V6, CPU_ARM_V7, CPU_ARM_V7_CA15, CPU_ARM_V7_CA5, CPU_ARM_V7_CA7, CPU_ARM_V7_CA9, CPU_ARM_XSCALE1, CPU_ARM_XSCALE2, CPU_ATHLON, CPU_ATOM, CPU_AVR32, CPU_AXP_EV4, CPU_AXP_EV5, CPU_AXP_EV6, CPU_AXP_EV67, CPU_AXP_PCA56, CPU_CORE, CPU_CORE_2, CPU_CORE_I7, CPU_FAMILY10, CPU_FAMILY11H, CPU_FAMILY12H, CPU_FAMILY14H, CPU_FAMILY15H, CPU_HAMMER, CPU_HASWELL, CPU_IA64, CPU_IA64_1, CPU_IA64_2, CPU_IVYBRIDGE, CPU_MIPS_1004K, CPU_MIPS_20K, CPU_MIPS_24K, CPU_MIPS_25K, CPU_MIPS_34K, CPU_MIPS_5K, CPU_MIPS_74K, CPU_MIPS_LOONGSON2, CPU_MIPS_R10000, CPU_MIPS_R12000, CPU_MIPS_RM7000, CPU_MIPS_RM9000, CPU_MIPS_SB1, CPU_MIPS_VR5432, CPU_MIPS_VR5500, CPU_NEHALEM, CPU_NO_GOOD, CPU_P4, CPU_P4_HT2, CPU_P6_MOBILE, CPU_PII, CPU_PIII, CPU_PPC64_970, CPU_PPC64_970MP, CPU_PPC64_ARCH_V1, CPU_PPC64_CELL, CPU_PPC64_IBM_COMPAT_V1, CPU_PPC64_PA6T, CPU_PPC64_POWER4, CPU_PPC64_POWER5, CPU_PPC64_POWER5p, CPU_PPC64_POWER5pp, CPU_PPC64_POWER6, CPU_PPC64_POWER7, CPU_PPC64_POWER8, CPU_PPC_7450, CPU_PPC_E300, CPU_PPC_E500, CPU_PPC_E500_2, CPU_PPRO, CPU_RTC, CPU_S390_Z10, CPU_S390_Z196, CPU_S390_ZEC12, CPU_SANDYBRIDGE, CPU_TILE_TILE64, CPU_TILE_TILEGX, CPU_TILE_TILEPRO, CPU_TIMER_INT, CPU_WESTMERE, MAX_CPU_TYPE, op_default_event_descr::name, op_get_nr_counters(), TIMER_EVENT_NAME, and op_default_event_descr::um.

Referenced by op_pe_utils::op_get_default_event().

struct list_head* op_events ( op_cpu  cpu_type  )  [read]

Return the known events list.

Idempotent

Referenced by main().

struct op_event* op_find_event ( op_cpu  cpu_type,
u32  nr,
u32  um 
) [read]

Find a given event, returns NULL on error.

struct op_event* op_find_event_any ( op_cpu  cpu_type,
u32  nr 
) [read]
void op_free_events ( void   ) 

free memory used by any call to above function.

Need to be called only once

References op_event::event_next, list_entry, list_for_each_safe, and op_unit_mask::um_next.

Referenced by main().

void op_resolve_unit_mask ( struct parsed_event pe,
u32 extra 
)

Generated on 29 Jul 2013 for oprofile by  doxygen 1.6.1