Linux Perf
kvm-stat.c File Reference
#include <errno.h>
#include "util/kvm-stat.h"
#include "util/parse-events.h"
#include "util/debug.h"
#include "book3s_hv_exits.h"
#include "book3s_hcalls.h"
Include dependency graph for kvm-stat.c:

Go to the source code of this file.

Macros

#define NR_TPS   4
 

Functions

 define_exit_reasons_table (hv_exit_reasons, kvm_trace_symbol_exit)
 
 define_exit_reasons_table (hcall_reasons, kvm_trace_symbol_hcall)
 
static void hcall_event_get_key (struct perf_evsel *evsel, struct perf_sample *sample, struct event_key *key)
 
static const char * get_hcall_exit_reason (u64 exit_code)
 
static bool hcall_event_end (struct perf_evsel *evsel, struct perf_sample *sample __maybe_unused, struct event_key *key __maybe_unused)
 
static bool hcall_event_begin (struct perf_evsel *evsel, struct perf_sample *sample, struct event_key *key)
 
static void hcall_event_decode_key (struct perf_kvm_stat *kvm __maybe_unused, struct event_key *key, char *decode)
 
static int is_tracepoint_available (const char *str, struct perf_evlist *evlist)
 
static int ppc__setup_book3s_hv (struct perf_kvm_stat *kvm, struct perf_evlist *evlist)
 
static int ppc__setup_kvm_tp (struct perf_kvm_stat *kvm)
 
int setup_kvm_events_tp (struct perf_kvm_stat *kvm)
 
int cpu_isa_init (struct perf_kvm_stat *kvm, const char *cpuid __maybe_unused)
 

Variables

const char * vcpu_id_str = "vcpu_id"
 
const int decode_str_len = 40
 
const char * kvm_entry_trace = "kvm_hv:kvm_guest_enter"
 
const char * kvm_exit_trace = "kvm_hv:kvm_guest_exit"
 
const char * ppc_book3s_hv_kvm_tp []
 
const char * kvm_events_tp [NR_TPS+1]
 
const char * kvm_exit_reason
 
static struct kvm_events_ops hcall_events
 
static struct kvm_events_ops exit_events
 
struct kvm_reg_events_ops kvm_reg_events_ops []
 
const char *const kvm_skip_events []
 

Macro Definition Documentation

◆ NR_TPS

#define NR_TPS   4

Definition at line 10 of file kvm-stat.c.

Function Documentation

◆ cpu_isa_init()

int cpu_isa_init ( struct perf_kvm_stat kvm,
const char *cpuid  __maybe_unused 
)

Definition at line 161 of file kvm-stat.c.

Here is the call graph for this function:

◆ define_exit_reasons_table() [1/2]

define_exit_reasons_table ( hv_exit_reasons  ,
kvm_trace_symbol_exit   
)

◆ define_exit_reasons_table() [2/2]

define_exit_reasons_table ( hcall_reasons  ,
kvm_trace_symbol_hcall   
)

◆ get_hcall_exit_reason()

static const char* get_hcall_exit_reason ( u64  exit_code)
static

Definition at line 41 of file kvm-stat.c.

◆ hcall_event_begin()

static bool hcall_event_begin ( struct perf_evsel evsel,
struct perf_sample sample,
struct event_key key 
)
static

Definition at line 63 of file kvm-stat.c.

Here is the call graph for this function:

◆ hcall_event_decode_key()

static void hcall_event_decode_key ( struct perf_kvm_stat *kvm  __maybe_unused,
struct event_key key,
char *  decode 
)
static

Definition at line 73 of file kvm-stat.c.

Here is the call graph for this function:

◆ hcall_event_end()

static bool hcall_event_end ( struct perf_evsel evsel,
struct perf_sample *sample  __maybe_unused,
struct event_key *key  __maybe_unused 
)
static

Definition at line 56 of file kvm-stat.c.

◆ hcall_event_get_key()

static void hcall_event_get_key ( struct perf_evsel evsel,
struct perf_sample sample,
struct event_key key 
)
static

Definition at line 33 of file kvm-stat.c.

Here is the call graph for this function:

◆ is_tracepoint_available()

static int is_tracepoint_available ( const char *  str,
struct perf_evlist evlist 
)
static

Definition at line 107 of file kvm-stat.c.

Here is the call graph for this function:

◆ ppc__setup_book3s_hv()

static int ppc__setup_book3s_hv ( struct perf_kvm_stat kvm,
struct perf_evlist evlist 
)
static

Definition at line 119 of file kvm-stat.c.

Here is the call graph for this function:

◆ ppc__setup_kvm_tp()

static int ppc__setup_kvm_tp ( struct perf_kvm_stat kvm)
static

Definition at line 145 of file kvm-stat.c.

Here is the call graph for this function:

◆ setup_kvm_events_tp()

int setup_kvm_events_tp ( struct perf_kvm_stat kvm)

Definition at line 156 of file kvm-stat.c.

Here is the call graph for this function:

Variable Documentation

◆ decode_str_len

const int decode_str_len = 40

Definition at line 13 of file kvm-stat.c.

◆ exit_events

struct kvm_events_ops exit_events
static
Initial value:
= {
.is_begin_event = exit_event_begin,
.is_end_event = exit_event_end,
.decode_key = exit_event_decode_key,
.name = "VM-EXIT"
}
bool exit_event_begin(struct perf_evsel *evsel, struct perf_sample *sample, struct event_key *key)
void exit_event_decode_key(struct perf_kvm_stat *kvm, struct event_key *key, char *decode)
bool exit_event_end(struct perf_evsel *evsel, struct perf_sample *sample, struct event_key *key)

Definition at line 89 of file kvm-stat.c.

◆ hcall_events

struct kvm_events_ops hcall_events
static
Initial value:
= {
.is_begin_event = hcall_event_begin,
.is_end_event = hcall_event_end,
.decode_key = hcall_event_decode_key,
.name = "HCALL-EVENT",
}
static void hcall_event_decode_key(struct perf_kvm_stat *kvm __maybe_unused, struct event_key *key, char *decode)
Definition: kvm-stat.c:73
static bool hcall_event_end(struct perf_evsel *evsel, struct perf_sample *sample __maybe_unused, struct event_key *key __maybe_unused)
Definition: kvm-stat.c:56
static bool hcall_event_begin(struct perf_evsel *evsel, struct perf_sample *sample, struct event_key *key)
Definition: kvm-stat.c:63

Definition at line 82 of file kvm-stat.c.

◆ kvm_entry_trace

const char* kvm_entry_trace = "kvm_hv:kvm_guest_enter"

Definition at line 14 of file kvm-stat.c.

◆ kvm_events_tp

const char* kvm_events_tp[NR_TPS+1]

Definition at line 30 of file kvm-stat.c.

◆ kvm_exit_reason

const char* kvm_exit_reason

Definition at line 31 of file kvm-stat.c.

◆ kvm_exit_trace

const char* kvm_exit_trace = "kvm_hv:kvm_guest_exit"

Definition at line 15 of file kvm-stat.c.

◆ kvm_reg_events_ops

Initial value:
= {
{ .name = "vmexit", .ops = &exit_events },
{ .name = "hcall", .ops = &hcall_events },
{ NULL, NULL },
}
static struct kvm_events_ops exit_events
Definition: kvm-stat.c:89
static struct kvm_events_ops hcall_events
Definition: kvm-stat.c:82
const char * name
Definition: kvm-stat.h:62

Definition at line 96 of file kvm-stat.c.

◆ kvm_skip_events

const char* const kvm_skip_events[]
Initial value:
= {
NULL,
}

Definition at line 102 of file kvm-stat.c.

◆ ppc_book3s_hv_kvm_tp

const char* ppc_book3s_hv_kvm_tp[]
Initial value:
= {
"kvm_hv:kvm_guest_enter",
"kvm_hv:kvm_guest_exit",
"kvm_hv:kvm_hcall_enter",
"kvm_hv:kvm_hcall_exit",
NULL,
}

Definition at line 21 of file kvm-stat.c.

◆ vcpu_id_str

const char* vcpu_id_str = "vcpu_id"

Definition at line 12 of file kvm-stat.c.