Linux Perf
machine.h File Reference
#include <sys/types.h>
#include <linux/rbtree.h>
#include "map.h"
#include "dso.h"
#include "event.h"
#include "rwsem.h"
Include dependency graph for machine.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  threads
 
struct  machine
 
struct  machines
 
struct  extra_kernel_map
 

Macros

#define HOST_KERNEL_ID   (-1)
 
#define DEFAULT_GUEST_KERNEL_ID   (0)
 
#define THREADS__TABLE_BITS   8
 
#define THREADS__TABLE_SIZE   (1 << THREADS__TABLE_BITS)
 

Typedefs

typedef void(* machine__process_t) (struct machine *machine, void *data)
 

Functions

static struct threadsmachine__threads (struct machine *machine, pid_t tid)
 
static struct mapmachine__kernel_map (struct machine *machine)
 
static struct mapsmachine__kernel_maps (struct machine *machine)
 
int machine__get_kernel_start (struct machine *machine)
 
static u64 machine__kernel_start (struct machine *machine)
 
static bool machine__kernel_ip (struct machine *machine, u64 ip)
 
struct threadmachine__find_thread (struct machine *machine, pid_t pid, pid_t tid)
 
struct commmachine__thread_exec_comm (struct machine *machine, struct thread *thread)
 
int machine__process_comm_event (struct machine *machine, union perf_event *event, struct perf_sample *sample)
 
int machine__process_exit_event (struct machine *machine, union perf_event *event, struct perf_sample *sample)
 
int machine__process_fork_event (struct machine *machine, union perf_event *event, struct perf_sample *sample)
 
int machine__process_lost_event (struct machine *machine, union perf_event *event, struct perf_sample *sample)
 
int machine__process_lost_samples_event (struct machine *machine, union perf_event *event, struct perf_sample *sample)
 
int machine__process_aux_event (struct machine *machine, union perf_event *event)
 
int machine__process_itrace_start_event (struct machine *machine, union perf_event *event)
 
int machine__process_switch_event (struct machine *machine, union perf_event *event)
 
int machine__process_namespaces_event (struct machine *machine, union perf_event *event, struct perf_sample *sample)
 
int machine__process_mmap_event (struct machine *machine, union perf_event *event, struct perf_sample *sample)
 
int machine__process_mmap2_event (struct machine *machine, union perf_event *event, struct perf_sample *sample)
 
int machine__process_event (struct machine *machine, union perf_event *event, struct perf_sample *sample)
 
void machines__init (struct machines *machines)
 
void machines__exit (struct machines *machines)
 
void machines__process_guests (struct machines *machines, machine__process_t process, void *data)
 
struct machinemachines__add (struct machines *machines, pid_t pid, const char *root_dir)
 
struct machinemachines__find_host (struct machines *machines)
 
struct machinemachines__find (struct machines *machines, pid_t pid)
 
struct machinemachines__findnew (struct machines *machines, pid_t pid)
 
void machines__set_id_hdr_size (struct machines *machines, u16 id_hdr_size)
 
void machines__set_comm_exec (struct machines *machines, bool comm_exec)
 
struct machinemachine__new_host (void)
 
struct machinemachine__new_kallsyms (void)
 
int machine__init (struct machine *machine, const char *root_dir, pid_t pid)
 
void machine__exit (struct machine *machine)
 
void machine__delete_threads (struct machine *machine)
 
void machine__delete (struct machine *machine)
 
void machine__remove_thread (struct machine *machine, struct thread *th)
 
struct branch_infosample__resolve_bstack (struct perf_sample *sample, struct addr_location *al)
 
struct mem_infosample__resolve_mem (struct perf_sample *sample, struct addr_location *al)
 
int thread__resolve_callchain (struct thread *thread, struct callchain_cursor *cursor, struct perf_evsel *evsel, struct perf_sample *sample, struct symbol **parent, struct addr_location *root_al, int max_stack)
 
static bool machine__is_default_guest (struct machine *machine)
 
static bool machine__is_host (struct machine *machine)
 
bool machine__is (struct machine *machine, const char *arch)
 
int machine__nr_cpus_avail (struct machine *machine)
 
struct thread__machine__findnew_thread (struct machine *machine, pid_t pid, pid_t tid)
 
struct threadmachine__findnew_thread (struct machine *machine, pid_t pid, pid_t tid)
 
struct dsomachine__findnew_dso (struct machine *machine, const char *filename)
 
size_t machine__fprintf (struct machine *machine, FILE *fp)
 
static struct symbolmachine__find_kernel_symbol (struct machine *machine, u64 addr, struct map **mapp)
 
static struct symbolmachine__find_kernel_symbol_by_name (struct machine *machine, const char *name, struct map **mapp)
 
struct mapmachine__findnew_module_map (struct machine *machine, u64 start, const char *filename)
 
int arch__fix_module_text_start (u64 *start, const char *name)
 
int machine__load_kallsyms (struct machine *machine, const char *filename)
 
int machine__load_vmlinux_path (struct machine *machine)
 
size_t machine__fprintf_dsos_buildid (struct machine *machine, FILE *fp, bool(skip)(struct dso *dso, int parm), int parm)
 
size_t machines__fprintf_dsos (struct machines *machines, FILE *fp)
 
size_t machines__fprintf_dsos_buildid (struct machines *machines, FILE *fp, bool(skip)(struct dso *dso, int parm), int parm)
 
void machine__destroy_kernel_maps (struct machine *machine)
 
int machine__create_kernel_maps (struct machine *machine)
 
int machines__create_kernel_maps (struct machines *machines, pid_t pid)
 
int machines__create_guest_kernel_maps (struct machines *machines)
 
void machines__destroy_kernel_maps (struct machines *machines)
 
size_t machine__fprintf_vmlinux_path (struct machine *machine, FILE *fp)
 
int machine__for_each_thread (struct machine *machine, int(*fn)(struct thread *thread, void *p), void *priv)
 
int machines__for_each_thread (struct machines *machines, int(*fn)(struct thread *thread, void *p), void *priv)
 
int __machine__synthesize_threads (struct machine *machine, struct perf_tool *tool, struct target *target, struct thread_map *threads, perf_event__handler_t process, bool data_mmap, unsigned int proc_map_timeout, unsigned int nr_threads_synthesize)
 
static int machine__synthesize_threads (struct machine *machine, struct target *target, struct thread_map *threads, bool data_mmap, unsigned int proc_map_timeout, unsigned int nr_threads_synthesize)
 
pid_t machine__get_current_tid (struct machine *machine, int cpu)
 
int machine__set_current_tid (struct machine *machine, int cpu, pid_t pid, pid_t tid)
 
char * machine__resolve_kernel_addr (void *vmachine, unsigned long long *addrp, char **modp)
 
void machine__get_kallsyms_filename (struct machine *machine, char *buf, size_t bufsz)
 
int machine__create_extra_kernel_maps (struct machine *machine, struct dso *kernel)
 
int machine__create_extra_kernel_map (struct machine *machine, struct dso *kernel, struct extra_kernel_map *xm)
 
int machine__map_x86_64_entry_trampolines (struct machine *machine, struct dso *kernel)
 

Variables

const char * ref_reloc_sym_names []
 

Macro Definition Documentation

◆ DEFAULT_GUEST_KERNEL_ID

#define DEFAULT_GUEST_KERNEL_ID   (0)

Definition at line 22 of file machine.h.

◆ HOST_KERNEL_ID

#define HOST_KERNEL_ID   (-1)

Definition at line 21 of file machine.h.

◆ THREADS__TABLE_BITS

#define THREADS__TABLE_BITS   8

Definition at line 28 of file machine.h.

◆ THREADS__TABLE_SIZE

#define THREADS__TABLE_SIZE   (1 << THREADS__TABLE_BITS)

Definition at line 29 of file machine.h.

Typedef Documentation

◆ machine__process_t

typedef void(* machine__process_t) (struct machine *machine, void *data)

Definition at line 133 of file machine.h.

Function Documentation

◆ __machine__findnew_thread()

struct thread* __machine__findnew_thread ( struct machine machine,
pid_t  pid,
pid_t  tid 
)

Definition at line 487 of file machine.c.

Here is the call graph for this function:

◆ __machine__synthesize_threads()

int __machine__synthesize_threads ( struct machine machine,
struct perf_tool tool,
struct target target,
struct thread_map threads,
perf_event__handler_t  process,
bool  data_mmap,
unsigned int  proc_map_timeout,
unsigned int  nr_threads_synthesize 
)

Definition at line 2394 of file machine.c.

Here is the call graph for this function:

◆ arch__fix_module_text_start()

int arch__fix_module_text_start ( u64 *  start,
const char *  name 
)

Definition at line 9 of file machine.c.

◆ machine__create_extra_kernel_map()

int machine__create_extra_kernel_map ( struct machine machine,
struct dso kernel,
struct extra_kernel_map xm 
)

Definition at line 854 of file machine.c.

Here is the call graph for this function:

◆ machine__create_extra_kernel_maps()

int machine__create_extra_kernel_maps ( struct machine machine,
struct dso kernel 
)

◆ machine__create_kernel_maps()

int machine__create_kernel_maps ( struct machine machine)

Definition at line 1321 of file machine.c.

Here is the call graph for this function:

◆ machine__delete()

void machine__delete ( struct machine machine)

Definition at line 214 of file machine.c.

Here is the call graph for this function:

◆ machine__delete_threads()

void machine__delete_threads ( struct machine machine)

Definition at line 174 of file machine.c.

Here is the call graph for this function:

◆ machine__destroy_kernel_maps()

void machine__destroy_kernel_maps ( struct machine machine)

Definition at line 1003 of file machine.c.

Here is the call graph for this function:

◆ machine__exit()

void machine__exit ( struct machine machine)

Definition at line 193 of file machine.c.

Here is the call graph for this function:

◆ machine__find_kernel_symbol()

static struct symbol* machine__find_kernel_symbol ( struct machine machine,
u64  addr,
struct map **  mapp 
)
static

Definition at line 203 of file machine.h.

Here is the call graph for this function:

◆ machine__find_kernel_symbol_by_name()

static struct symbol* machine__find_kernel_symbol_by_name ( struct machine machine,
const char *  name,
struct map **  mapp 
)
static

Definition at line 210 of file machine.h.

Here is the call graph for this function:

◆ machine__find_thread()

struct thread* machine__find_thread ( struct machine machine,
pid_t  pid,
pid_t  tid 
)

Definition at line 504 of file machine.c.

Here is the call graph for this function:

◆ machine__findnew_dso()

struct dso* machine__findnew_dso ( struct machine machine,
const char *  filename 
)

Definition at line 2496 of file machine.c.

Here is the call graph for this function:

◆ machine__findnew_module_map()

struct map* machine__findnew_module_map ( struct machine machine,
u64  start,
const char *  filename 
)

Definition at line 664 of file machine.c.

Here is the call graph for this function:

◆ machine__findnew_thread()

struct thread* machine__findnew_thread ( struct machine machine,
pid_t  pid,
pid_t  tid 
)

Definition at line 492 of file machine.c.

Here is the call graph for this function:

◆ machine__for_each_thread()

int machine__for_each_thread ( struct machine machine,
int(*)(struct thread *thread, void *p)  fn,
void *  priv 
)

Definition at line 2345 of file machine.c.

◆ machine__fprintf()

size_t machine__fprintf ( struct machine machine,
FILE *  fp 
)

Definition at line 756 of file machine.c.

Here is the call graph for this function:

◆ machine__fprintf_dsos_buildid()

size_t machine__fprintf_dsos_buildid ( struct machine machine,
FILE *  fp,
bool(skip)(struct dso *dso, int parm)  ,
int  parm 
)

Definition at line 717 of file machine.c.

Here is the call graph for this function:

◆ machine__fprintf_vmlinux_path()

size_t machine__fprintf_vmlinux_path ( struct machine machine,
FILE *  fp 
)

Definition at line 736 of file machine.c.

Here is the call graph for this function:

◆ machine__get_current_tid()

pid_t machine__get_current_tid ( struct machine machine,
int  cpu 
)

Definition at line 2411 of file machine.c.

◆ machine__get_kallsyms_filename()

void machine__get_kallsyms_filename ( struct machine machine,
char *  buf,
size_t  bufsz 
)

Definition at line 810 of file machine.c.

Here is the call graph for this function:

◆ machine__get_kernel_start()

int machine__get_kernel_start ( struct machine machine)

Definition at line 2469 of file machine.c.

Here is the call graph for this function:

◆ machine__init()

int machine__init ( struct machine machine,
const char *  root_dir,
pid_t  pid 
)

Definition at line 65 of file machine.c.

Here is the call graph for this function:

◆ machine__is()

bool machine__is ( struct machine machine,
const char *  arch 
)

Definition at line 2459 of file machine.c.

Here is the call graph for this function:

◆ machine__is_default_guest()

static bool machine__is_default_guest ( struct machine machine)
inlinestatic

Definition at line 182 of file machine.h.

◆ machine__is_host()

static bool machine__is_host ( struct machine machine)
inlinestatic

Definition at line 187 of file machine.h.

Here is the call graph for this function:

◆ machine__kernel_ip()

static bool machine__kernel_ip ( struct machine machine,
u64  ip 
)
inlinestatic

Definition at line 95 of file machine.h.

Here is the call graph for this function:

◆ machine__kernel_map()

static struct map* machine__kernel_map ( struct machine machine)
static

Definition at line 72 of file machine.h.

◆ machine__kernel_maps()

static struct maps* machine__kernel_maps ( struct machine machine)
static

Definition at line 81 of file machine.h.

Here is the call graph for this function:

◆ machine__kernel_start()

static u64 machine__kernel_start ( struct machine machine)
inlinestatic

Definition at line 88 of file machine.h.

Here is the call graph for this function:

◆ machine__load_kallsyms()

int machine__load_kallsyms ( struct machine machine,
const char *  filename 
)

Definition at line 1095 of file machine.c.

Here is the call graph for this function:

◆ machine__load_vmlinux_path()

int machine__load_vmlinux_path ( struct machine machine)

Definition at line 1113 of file machine.c.

Here is the call graph for this function:

◆ machine__map_x86_64_entry_trampolines()

int machine__map_x86_64_entry_trampolines ( struct machine machine,
struct dso kernel 
)

Definition at line 915 of file machine.c.

Here is the call graph for this function:

◆ machine__new_host()

struct machine* machine__new_host ( void  )

Definition at line 118 of file machine.c.

Here is the call graph for this function:

◆ machine__new_kallsyms()

struct machine* machine__new_kallsyms ( void  )

Definition at line 135 of file machine.c.

Here is the call graph for this function:

◆ machine__nr_cpus_avail()

int machine__nr_cpus_avail ( struct machine machine)

Definition at line 2464 of file machine.c.

Here is the call graph for this function:

◆ machine__process_aux_event()

int machine__process_aux_event ( struct machine machine,
union perf_event event 
)

◆ machine__process_comm_event()

int machine__process_comm_event ( struct machine machine,
union perf_event event,
struct perf_sample sample 
)

Definition at line 525 of file machine.c.

Here is the call graph for this function:

◆ machine__process_event()

int machine__process_event ( struct machine machine,
union perf_event event,
struct perf_sample sample 
)

Definition at line 1729 of file machine.c.

Here is the call graph for this function:

◆ machine__process_exit_event()

int machine__process_exit_event ( struct machine machine,
union perf_event event,
struct perf_sample sample 
)

◆ machine__process_fork_event()

int machine__process_fork_event ( struct machine machine,
union perf_event event,
struct perf_sample sample 
)

Definition at line 1662 of file machine.c.

Here is the call graph for this function:

◆ machine__process_itrace_start_event()

int machine__process_itrace_start_event ( struct machine machine,
union perf_event event 
)

◆ machine__process_lost_event()

int machine__process_lost_event ( struct machine machine,
union perf_event event,
struct perf_sample sample 
)

◆ machine__process_lost_samples_event()

int machine__process_lost_samples_event ( struct machine machine,
union perf_event event,
struct perf_sample sample 
)

◆ machine__process_mmap2_event()

int machine__process_mmap2_event ( struct machine machine,
union perf_event event,
struct perf_sample sample 
)

Definition at line 1527 of file machine.c.

Here is the call graph for this function:

◆ machine__process_mmap_event()

int machine__process_mmap_event ( struct machine machine,
union perf_event event,
struct perf_sample sample 
)

Definition at line 1580 of file machine.c.

Here is the call graph for this function:

◆ machine__process_namespaces_event()

int machine__process_namespaces_event ( struct machine machine,
union perf_event event,
struct perf_sample sample 
)

◆ machine__process_switch_event()

int machine__process_switch_event ( struct machine machine,
union perf_event event 
)

◆ machine__remove_thread()

void machine__remove_thread ( struct machine machine,
struct thread th 
)

Definition at line 1657 of file machine.c.

Here is the call graph for this function:

◆ machine__resolve_kernel_addr()

char* machine__resolve_kernel_addr ( void *  vmachine,
unsigned long long *  addrp,
char **  modp 
)

Definition at line 2501 of file machine.c.

Here is the call graph for this function:

◆ machine__set_current_tid()

int machine__set_current_tid ( struct machine machine,
int  cpu,
pid_t  pid,
pid_t  tid 
)

Definition at line 2419 of file machine.c.

Here is the call graph for this function:

◆ machine__synthesize_threads()

static int machine__synthesize_threads ( struct machine machine,
struct target target,
struct thread_map threads,
bool  data_mmap,
unsigned int  proc_map_timeout,
unsigned int  nr_threads_synthesize 
)
inlinestatic

Definition at line 253 of file machine.h.

Here is the call graph for this function:

◆ machine__thread_exec_comm()

struct comm* machine__thread_exec_comm ( struct machine machine,
struct thread thread 
)

Definition at line 516 of file machine.c.

Here is the call graph for this function:

◆ machine__threads()

static struct threads* machine__threads ( struct machine machine,
pid_t  tid 
)
static

Definition at line 62 of file machine.h.

◆ machines__add()

struct machine* machines__add ( struct machines machines,
pid_t  pid,
const char *  root_dir 
)

Definition at line 234 of file machine.c.

Here is the call graph for this function:

◆ machines__create_guest_kernel_maps()

int machines__create_guest_kernel_maps ( struct machines machines)

Definition at line 1021 of file machine.c.

Here is the call graph for this function:

◆ machines__create_kernel_maps()

int machines__create_kernel_maps ( struct machines machines,
pid_t  pid 
)

Definition at line 1085 of file machine.c.

Here is the call graph for this function:

◆ machines__destroy_kernel_maps()

void machines__destroy_kernel_maps ( struct machines machines)

Definition at line 1070 of file machine.c.

Here is the call graph for this function:

◆ machines__exit()

void machines__exit ( struct machines machines)

Definition at line 228 of file machine.c.

Here is the call graph for this function:

◆ machines__find()

struct machine* machines__find ( struct machines machines,
pid_t  pid 
)

Definition at line 277 of file machine.c.

◆ machines__find_host()

struct machine* machines__find_host ( struct machines machines)

◆ machines__findnew()

struct machine* machines__findnew ( struct machines machines,
pid_t  pid 
)

Definition at line 303 of file machine.c.

Here is the call graph for this function:

◆ machines__for_each_thread()

int machines__for_each_thread ( struct machines machines,
int(*)(struct thread *thread, void *p)  fn,
void *  priv 
)

Definition at line 2373 of file machine.c.

Here is the call graph for this function:

◆ machines__fprintf_dsos()

size_t machines__fprintf_dsos ( struct machines machines,
FILE *  fp 
)

Definition at line 704 of file machine.c.

Here is the call graph for this function:

◆ machines__fprintf_dsos_buildid()

size_t machines__fprintf_dsos_buildid ( struct machines machines,
FILE *  fp,
bool(skip)(struct dso *dso, int parm)  ,
int  parm 
)

Definition at line 723 of file machine.c.

Here is the call graph for this function:

◆ machines__init()

void machines__init ( struct machines machines)

Definition at line 222 of file machine.c.

Here is the call graph for this function:

◆ machines__process_guests()

void machines__process_guests ( struct machines machines,
machine__process_t  process,
void *  data 
)

Definition at line 337 of file machine.c.

◆ machines__set_comm_exec()

void machines__set_comm_exec ( struct machines machines,
bool  comm_exec 
)

Definition at line 264 of file machine.c.

◆ machines__set_id_hdr_size()

void machines__set_id_hdr_size ( struct machines machines,
u16  id_hdr_size 
)

Definition at line 348 of file machine.c.

◆ sample__resolve_bstack()

struct branch_info* sample__resolve_bstack ( struct perf_sample sample,
struct addr_location al 
)

Definition at line 1928 of file machine.c.

Here is the call graph for this function:

◆ sample__resolve_mem()

struct mem_info* sample__resolve_mem ( struct perf_sample sample,
struct addr_location al 
)

Definition at line 1813 of file machine.c.

Here is the call graph for this function:

◆ thread__resolve_callchain()

int thread__resolve_callchain ( struct thread thread,
struct callchain_cursor cursor,
struct perf_evsel evsel,
struct perf_sample sample,
struct symbol **  parent,
struct addr_location root_al,
int  max_stack 
)

Definition at line 2308 of file machine.c.

Here is the call graph for this function:

Variable Documentation

◆ ref_reloc_sym_names

const char* ref_reloc_sym_names[]

Definition at line 819 of file machine.c.