Linux Perf
stat.c File Reference
#include <errno.h>
#include <inttypes.h>
#include <math.h>
#include "stat.h"
#include "evlist.h"
#include "evsel.h"
#include "thread_map.h"
Include dependency graph for stat.c:

Go to the source code of this file.

Macros

#define ID(id, name)   [PERF_STAT_EVSEL_ID__##id] = #name
 

Functions

void update_stats (struct stats *stats, u64 val)
 
double avg_stats (struct stats *stats)
 
double stddev_stats (struct stats *stats)
 
double rel_stddev_stats (double stddev, double avg)
 
bool __perf_evsel_stat__is (struct perf_evsel *evsel, enum perf_stat_evsel_id id)
 
static void perf_stat_evsel_id_init (struct perf_evsel *evsel)
 
static void perf_evsel__reset_stat_priv (struct perf_evsel *evsel)
 
static int perf_evsel__alloc_stat_priv (struct perf_evsel *evsel)
 
static void perf_evsel__free_stat_priv (struct perf_evsel *evsel)
 
static int perf_evsel__alloc_prev_raw_counts (struct perf_evsel *evsel, int ncpus, int nthreads)
 
static void perf_evsel__free_prev_raw_counts (struct perf_evsel *evsel)
 
static int perf_evsel__alloc_stats (struct perf_evsel *evsel, bool alloc_raw)
 
int perf_evlist__alloc_stats (struct perf_evlist *evlist, bool alloc_raw)
 
void perf_evlist__free_stats (struct perf_evlist *evlist)
 
void perf_evlist__reset_stats (struct perf_evlist *evlist)
 
static void zero_per_pkg (struct perf_evsel *counter)
 
static int check_per_pkg (struct perf_evsel *counter, struct perf_counts_values *vals, int cpu, bool *skip)
 
static int process_counter_values (struct perf_stat_config *config, struct perf_evsel *evsel, int cpu, int thread, struct perf_counts_values *count)
 
static int process_counter_maps (struct perf_stat_config *config, struct perf_evsel *counter)
 
int perf_stat_process_counter (struct perf_stat_config *config, struct perf_evsel *counter)
 
int perf_event__process_stat_event (struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_session *session)
 
size_t perf_event__fprintf_stat (union perf_event *event, FILE *fp)
 
size_t perf_event__fprintf_stat_round (union perf_event *event, FILE *fp)
 
size_t perf_event__fprintf_stat_config (union perf_event *event, FILE *fp)
 

Variables

static const char * id_str [PERF_STAT_EVSEL_ID__MAX]
 

Macro Definition Documentation

◆ ID

#define ID (   id,
  name 
)    [PERF_STAT_EVSEL_ID__##id] = #name

Definition at line 78 of file stat.c.

Function Documentation

◆ __perf_evsel_stat__is()

bool __perf_evsel_stat__is ( struct perf_evsel evsel,
enum perf_stat_evsel_id  id 
)

Definition at line 70 of file stat.c.

◆ avg_stats()

double avg_stats ( struct stats stats)

Definition at line 26 of file stat.c.

◆ check_per_pkg()

static int check_per_pkg ( struct perf_evsel counter,
struct perf_counts_values vals,
int  cpu,
bool *  skip 
)
static

Definition at line 213 of file stat.c.

Here is the call graph for this function:

◆ perf_event__fprintf_stat()

size_t perf_event__fprintf_stat ( union perf_event event,
FILE *  fp 
)

Definition at line 400 of file stat.c.

◆ perf_event__fprintf_stat_config()

size_t perf_event__fprintf_stat_config ( union perf_event event,
FILE *  fp 
)

Definition at line 424 of file stat.c.

Here is the call graph for this function:

◆ perf_event__fprintf_stat_round()

size_t perf_event__fprintf_stat_round ( union perf_event event,
FILE *  fp 
)

Definition at line 413 of file stat.c.

◆ perf_event__process_stat_event()

int perf_event__process_stat_event ( struct perf_tool *tool  __maybe_unused,
union perf_event event,
struct perf_session session 
)

Definition at line 377 of file stat.c.

Here is the call graph for this function:

◆ perf_evlist__alloc_stats()

int perf_evlist__alloc_stats ( struct perf_evlist evlist,
bool  alloc_raw 
)

Definition at line 170 of file stat.c.

Here is the call graph for this function:

◆ perf_evlist__free_stats()

void perf_evlist__free_stats ( struct perf_evlist evlist)

Definition at line 186 of file stat.c.

Here is the call graph for this function:

◆ perf_evlist__reset_stats()

void perf_evlist__reset_stats ( struct perf_evlist evlist)

Definition at line 197 of file stat.c.

Here is the call graph for this function:

◆ perf_evsel__alloc_prev_raw_counts()

static int perf_evsel__alloc_prev_raw_counts ( struct perf_evsel evsel,
int  ncpus,
int  nthreads 
)
static

Definition at line 139 of file stat.c.

Here is the call graph for this function:

◆ perf_evsel__alloc_stat_priv()

static int perf_evsel__alloc_stat_priv ( struct perf_evsel evsel)
static

Definition at line 121 of file stat.c.

Here is the call graph for this function:

◆ perf_evsel__alloc_stats()

static int perf_evsel__alloc_stats ( struct perf_evsel evsel,
bool  alloc_raw 
)
static

Definition at line 157 of file stat.c.

Here is the call graph for this function:

◆ perf_evsel__free_prev_raw_counts()

static void perf_evsel__free_prev_raw_counts ( struct perf_evsel evsel)
static

Definition at line 151 of file stat.c.

Here is the call graph for this function:

◆ perf_evsel__free_stat_priv()

static void perf_evsel__free_stat_priv ( struct perf_evsel evsel)
static

Definition at line 130 of file stat.c.

Here is the call graph for this function:

◆ perf_evsel__reset_stat_priv()

static void perf_evsel__reset_stat_priv ( struct perf_evsel evsel)
static

Definition at line 110 of file stat.c.

Here is the call graph for this function:

◆ perf_stat_evsel_id_init()

static void perf_stat_evsel_id_init ( struct perf_evsel evsel)
static

Definition at line 95 of file stat.c.

Here is the call graph for this function:

◆ perf_stat_process_counter()

int perf_stat_process_counter ( struct perf_stat_config config,
struct perf_evsel counter 
)

Definition at line 327 of file stat.c.

Here is the call graph for this function:

◆ process_counter_maps()

static int process_counter_maps ( struct perf_stat_config config,
struct perf_evsel counter 
)
static

Definition at line 306 of file stat.c.

Here is the call graph for this function:

◆ process_counter_values()

static int process_counter_values ( struct perf_stat_config config,
struct perf_evsel evsel,
int  cpu,
int  thread,
struct perf_counts_values count 
)
static

Definition at line 256 of file stat.c.

Here is the call graph for this function:

◆ rel_stddev_stats()

double rel_stddev_stats ( double  stddev,
double  avg 
)

Definition at line 60 of file stat.c.

Here is the call graph for this function:

◆ stddev_stats()

double stddev_stats ( struct stats stats)

Definition at line 47 of file stat.c.

◆ update_stats()

void update_stats ( struct stats stats,
u64  val 
)

Definition at line 10 of file stat.c.

◆ zero_per_pkg()

static void zero_per_pkg ( struct perf_evsel counter)
static

Definition at line 207 of file stat.c.

Here is the call graph for this function:

Variable Documentation

◆ id_str

const char* id_str[PERF_STAT_EVSEL_ID__MAX]
static
Initial value:
= {
ID(NONE, x),
ID(CYCLES_IN_TX, cpu/cycles-t/),
ID(TRANSACTION_START, cpu/tx-start/),
ID(ELISION_START, cpu/el-start/),
ID(CYCLES_IN_TX_CP, cpu/cycles-ct/),
ID(TOPDOWN_TOTAL_SLOTS, topdown-total-slots),
ID(TOPDOWN_SLOTS_ISSUED, topdown-slots-issued),
ID(TOPDOWN_SLOTS_RETIRED, topdown-slots-retired),
ID(TOPDOWN_FETCH_BUBBLES, topdown-fetch-bubbles),
ID(TOPDOWN_RECOVERY_BUBBLES, topdown-recovery-bubbles),
ID(SMI_NUM, msr/smi/),
ID(APERF, msr/aperf/),
}
#define ID(id, name)
Definition: stat.c:78
u64 start
Definition: hists_common.c:25

Definition at line 79 of file stat.c.