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

Go to the source code of this file.

Macros

#define LBR_KERNEL_BIT   0 /* do not capture at ring0 */
 
#define LBR_USER_BIT   1 /* do not capture at ring > 0 */
 
#define LBR_JCC_BIT   2 /* do not capture conditional branches */
 
#define LBR_REL_CALL_BIT   3 /* do not capture relative calls */
 
#define LBR_IND_CALL_BIT   4 /* do not capture indirect calls */
 
#define LBR_RETURN_BIT   5 /* do not capture near returns */
 
#define LBR_IND_JMP_BIT   6 /* do not capture indirect jumps */
 
#define LBR_REL_JMP_BIT   7 /* do not capture relative jumps */
 
#define LBR_FAR_BIT   8 /* do not capture far branches */
 
#define LBR_KERNEL   (1 << LBR_KERNEL_BIT)
 
#define LBR_USER   (1 << LBR_USER_BIT)
 
#define LBR_JCC   (1 << LBR_JCC_BIT)
 
#define LBR_REL_CALL   (1 << LBR_REL_CALL_BIT)
 
#define LBR_IND_CALL   (1 << LBR_IND_CALL_BIT)
 
#define LBR_RETURN   (1 << LBR_RETURN_BIT)
 
#define LBR_REL_JMP   (1 << LBR_REL_JMP_BIT)
 
#define LBR_IND_JMP   (1 << LBR_IND_JMP_BIT)
 
#define LBR_FAR   (1 << LBR_FAR_BIT)
 
#define LBR_PLM   (LBR_KERNEL | LBR_USER)
 
#define LBR_SEL_MASK   0x1ff /* valid bits in LBR_SELECT */
 
#define LBR_NOT_SUPP   -1 /* LBR filter not supported */
 
#define LBR_IGN   0 /* ignored */
 
#define LBR_ANY
 
#define LBR_FROM_FLAG_MISPRED   (1ULL << 63)
 
#define for_each_branch_sample_type(x)
 
#define X86_BR_PLM   (X86_BR_USER | X86_BR_KERNEL)
 
#define X86_BR_ANY
 
#define X86_BR_ALL   (X86_BR_PLM | X86_BR_ANY)
 
#define X86_BR_ANY_CALL
 

Enumerations

enum  { LBR_FORMAT_32 = 0x00, LBR_FORMAT_LIP = 0x01, LBR_FORMAT_EIP = 0x02, LBR_FORMAT_EIP_FLAGS = 0x03 }
 
enum  {
  X86_BR_NONE = 0, X86_BR_USER = 1 << 0, X86_BR_KERNEL = 1 << 1, X86_BR_CALL = 1 << 2,
  X86_BR_RET = 1 << 3, X86_BR_SYSCALL = 1 << 4, X86_BR_SYSRET = 1 << 5, X86_BR_INT = 1 << 6,
  X86_BR_IRET = 1 << 7, X86_BR_JCC = 1 << 8, X86_BR_JMP = 1 << 9, X86_BR_IRQ = 1 << 10,
  X86_BR_IND_CALL = 1 << 11
}
 

Functions

void intel_pmu_lbr_reset (void)
 
void intel_pmu_lbr_enable (struct perf_event *event)
 
void intel_pmu_lbr_disable (struct perf_event *event)
 
void intel_pmu_lbr_enable_all (void)
 
void intel_pmu_lbr_disable_all (void)
 
void intel_pmu_lbr_read (void)
 
int intel_pmu_setup_lbr_filter (struct perf_event *event)
 
void intel_pmu_lbr_init_core (void)
 
void intel_pmu_lbr_init_nhm (void)
 
void intel_pmu_lbr_init_snb (void)
 
void intel_pmu_lbr_init_atom (void)
 

Macro Definition Documentation

#define for_each_branch_sample_type (   x)
Value:

Definition at line 60 of file perf_event_intel_lbr.c.

#define LBR_ANY
Value:
LBR_REL_CALL |\
LBR_IND_CALL |\
LBR_RETURN |\
LBR_REL_JMP |\
LBR_IND_JMP |\
LBR_FAR)

Definition at line 49 of file perf_event_intel_lbr.c.

#define LBR_FAR   (1 << LBR_FAR_BIT)

Definition at line 41 of file perf_event_intel_lbr.c.

#define LBR_FAR_BIT   8 /* do not capture far branches */

Definition at line 31 of file perf_event_intel_lbr.c.

#define LBR_FROM_FLAG_MISPRED   (1ULL << 63)

Definition at line 58 of file perf_event_intel_lbr.c.

#define LBR_IGN   0 /* ignored */

Definition at line 47 of file perf_event_intel_lbr.c.

#define LBR_IND_CALL   (1 << LBR_IND_CALL_BIT)

Definition at line 37 of file perf_event_intel_lbr.c.

#define LBR_IND_CALL_BIT   4 /* do not capture indirect calls */

Definition at line 27 of file perf_event_intel_lbr.c.

#define LBR_IND_JMP   (1 << LBR_IND_JMP_BIT)

Definition at line 40 of file perf_event_intel_lbr.c.

#define LBR_IND_JMP_BIT   6 /* do not capture indirect jumps */

Definition at line 29 of file perf_event_intel_lbr.c.

#define LBR_JCC   (1 << LBR_JCC_BIT)

Definition at line 35 of file perf_event_intel_lbr.c.

#define LBR_JCC_BIT   2 /* do not capture conditional branches */

Definition at line 25 of file perf_event_intel_lbr.c.

#define LBR_KERNEL   (1 << LBR_KERNEL_BIT)

Definition at line 33 of file perf_event_intel_lbr.c.

#define LBR_KERNEL_BIT   0 /* do not capture at ring0 */

Definition at line 23 of file perf_event_intel_lbr.c.

#define LBR_NOT_SUPP   -1 /* LBR filter not supported */

Definition at line 46 of file perf_event_intel_lbr.c.

#define LBR_PLM   (LBR_KERNEL | LBR_USER)

Definition at line 43 of file perf_event_intel_lbr.c.

#define LBR_REL_CALL   (1 << LBR_REL_CALL_BIT)

Definition at line 36 of file perf_event_intel_lbr.c.

#define LBR_REL_CALL_BIT   3 /* do not capture relative calls */

Definition at line 26 of file perf_event_intel_lbr.c.

#define LBR_REL_JMP   (1 << LBR_REL_JMP_BIT)

Definition at line 39 of file perf_event_intel_lbr.c.

#define LBR_REL_JMP_BIT   7 /* do not capture relative jumps */

Definition at line 30 of file perf_event_intel_lbr.c.

#define LBR_RETURN   (1 << LBR_RETURN_BIT)

Definition at line 38 of file perf_event_intel_lbr.c.

#define LBR_RETURN_BIT   5 /* do not capture near returns */

Definition at line 28 of file perf_event_intel_lbr.c.

#define LBR_SEL_MASK   0x1ff /* valid bits in LBR_SELECT */

Definition at line 45 of file perf_event_intel_lbr.c.

#define LBR_USER   (1 << LBR_USER_BIT)

Definition at line 34 of file perf_event_intel_lbr.c.

#define LBR_USER_BIT   1 /* do not capture at ring > 0 */

Definition at line 24 of file perf_event_intel_lbr.c.

#define X86_BR_ALL   (X86_BR_PLM | X86_BR_ANY)

Definition at line 100 of file perf_event_intel_lbr.c.

#define X86_BR_ANY
Value:
X86_BR_RET |\
X86_BR_SYSCALL |\
X86_BR_SYSRET |\
X86_BR_INT |\
X86_BR_IRET |\
X86_BR_JCC |\
X86_BR_JMP |\
X86_BR_IRQ |\
X86_BR_IND_CALL)

Definition at line 88 of file perf_event_intel_lbr.c.

#define X86_BR_ANY_CALL
Value:
X86_BR_IND_CALL |\
X86_BR_SYSCALL |\
X86_BR_IRQ |\
X86_BR_INT)

Definition at line 102 of file perf_event_intel_lbr.c.

#define X86_BR_PLM   (X86_BR_USER | X86_BR_KERNEL)

Definition at line 86 of file perf_event_intel_lbr.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
LBR_FORMAT_32 
LBR_FORMAT_LIP 
LBR_FORMAT_EIP 
LBR_FORMAT_EIP_FLAGS 

Definition at line 10 of file perf_event_intel_lbr.c.

anonymous enum
Enumerator:
X86_BR_NONE 
X86_BR_USER 
X86_BR_KERNEL 
X86_BR_CALL 
X86_BR_RET 
X86_BR_SYSCALL 
X86_BR_SYSRET 
X86_BR_INT 
X86_BR_IRET 
X86_BR_JCC 
X86_BR_JMP 
X86_BR_IRQ 
X86_BR_IND_CALL 

Definition at line 68 of file perf_event_intel_lbr.c.

Function Documentation

void intel_pmu_lbr_disable ( struct perf_event event)

Definition at line 187 of file perf_event_intel_lbr.c.

void intel_pmu_lbr_disable_all ( void  )

Definition at line 212 of file perf_event_intel_lbr.c.

void intel_pmu_lbr_enable ( struct perf_event event)

Definition at line 167 of file perf_event_intel_lbr.c.

void intel_pmu_lbr_enable_all ( void  )

Definition at line 204 of file perf_event_intel_lbr.c.

void intel_pmu_lbr_init_atom ( void  )

Definition at line 682 of file perf_event_intel_lbr.c.

void intel_pmu_lbr_init_core ( void  )

Definition at line 626 of file perf_event_intel_lbr.c.

void intel_pmu_lbr_init_nhm ( void  )

Definition at line 641 of file perf_event_intel_lbr.c.

void intel_pmu_lbr_init_snb ( void  )

Definition at line 662 of file perf_event_intel_lbr.c.

void intel_pmu_lbr_read ( void  )

Definition at line 293 of file perf_event_intel_lbr.c.

void intel_pmu_lbr_reset ( void  )

Definition at line 156 of file perf_event_intel_lbr.c.

int intel_pmu_setup_lbr_filter ( struct perf_event event)

Definition at line 376 of file perf_event_intel_lbr.c.