Linux Perf
annotate.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <linux/types.h>
#include "symbol.h"
#include "hist.h"
#include "sort.h"
#include <linux/list.h>
#include <linux/rbtree.h>
#include <pthread.h>
Include dependency graph for annotate.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ins
 
struct  ins_operands
 
struct  ins_ops
 
struct  annotation_options
 
struct  sym_hist_entry
 
struct  annotation_data
 
struct  annotation_line
 
struct  disasm_line
 
struct  annotation_write_ops
 
struct  sym_hist
 
struct  cyc_hist
 
struct  annotated_source
 
struct  annotation
 

Macros

#define ANNOTATION__IPC_WIDTH   6
 
#define ANNOTATION__CYCLES_WIDTH   6
 
#define ANNOTATION__MINMAX_CYCLES_WIDTH   19
 
#define ANNOTATION__MIN_OFFSET_LEVEL   ANNOTATION__OFFSET_JUMP_TARGETS
 

Enumerations

enum  { ANNOTATION__OFFSET_JUMP_TARGETS = 1, ANNOTATION__OFFSET_CALL, ANNOTATION__MAX_OFFSET_LEVEL }
 
enum  symbol_disassemble_errno { SYMBOL_ANNOTATE_ERRNO__SUCCESS = 0, __SYMBOL_ANNOTATE_ERRNO__START = -10000, SYMBOL_ANNOTATE_ERRNO__NO_VMLINUX = __SYMBOL_ANNOTATE_ERRNO__START, __SYMBOL_ANNOTATE_ERRNO__END }
 

Functions

bool ins__is_jump (const struct ins *ins)
 
bool ins__is_call (const struct ins *ins)
 
bool ins__is_ret (const struct ins *ins)
 
bool ins__is_lock (const struct ins *ins)
 
int ins__scnprintf (struct ins *ins, char *bf, size_t size, struct ins_operands *ops)
 
bool ins__is_fused (struct arch *arch, const char *ins1, const char *ins2)
 
static struct disasm_linedisasm_line (struct annotation_line *al)
 
static bool disasm_line__has_local_offset (const struct disasm_line *dl)
 
bool disasm_line__is_valid_local_jump (struct disasm_line *dl, struct symbol *sym)
 
void disasm_line__free (struct disasm_line *dl)
 
struct annotation_lineannotation_line__next (struct annotation_line *pos, struct list_head *head)
 
double annotation_line__max_percent (struct annotation_line *al, struct annotation *notes)
 
void annotation_line__write (struct annotation_line *al, struct annotation *notes, struct annotation_write_ops *ops)
 
int __annotation__scnprintf_samples_period (struct annotation *notes, char *bf, size_t size, struct perf_evsel *evsel, bool show_freq)
 
static int annotation__scnprintf_samples_period (struct annotation *notes, char *bf, size_t size, struct perf_evsel *evsel)
 
int disasm_line__scnprintf (struct disasm_line *dl, char *bf, size_t size, bool raw)
 
size_t disasm__fprintf (struct list_head *head, FILE *fp)
 
void symbol__calc_percent (struct symbol *sym, struct perf_evsel *evsel)
 
static int annotation__cycles_width (struct annotation *notes)
 
static int annotation__pcnt_width (struct annotation *notes)
 
static bool annotation_line__filter (struct annotation_line *al, struct annotation *notes)
 
void annotation__set_offsets (struct annotation *notes, s64 size)
 
void annotation__compute_ipc (struct annotation *notes, size_t size)
 
void annotation__mark_jump_targets (struct annotation *notes, struct symbol *sym)
 
void annotation__update_column_widths (struct annotation *notes)
 
void annotation__init_column_widths (struct annotation *notes, struct symbol *sym)
 
static struct sym_histannotated_source__histogram (struct annotated_source *src, int idx)
 
static struct sym_histannotation__histogram (struct annotation *notes, int idx)
 
static struct annotationsymbol__annotation (struct symbol *sym)
 
int addr_map_symbol__inc_samples (struct addr_map_symbol *ams, struct perf_sample *sample, struct perf_evsel *evsel)
 
int addr_map_symbol__account_cycles (struct addr_map_symbol *ams, struct addr_map_symbol *start, unsigned cycles)
 
int hist_entry__inc_addr_samples (struct hist_entry *he, struct perf_sample *sample, struct perf_evsel *evsel, u64 addr)
 
struct annotated_sourcesymbol__hists (struct symbol *sym, int nr_hists)
 
void symbol__annotate_zero_histograms (struct symbol *sym)
 
int symbol__annotate (struct symbol *sym, struct map *map, struct perf_evsel *evsel, size_t privsize, struct annotation_options *options, struct arch **parch)
 
int symbol__annotate2 (struct symbol *sym, struct map *map, struct perf_evsel *evsel, struct annotation_options *options, struct arch **parch)
 
int symbol__strerror_disassemble (struct symbol *sym, struct map *map, int errnum, char *buf, size_t buflen)
 
int symbol__annotate_printf (struct symbol *sym, struct map *map, struct perf_evsel *evsel, struct annotation_options *options)
 
int symbol__annotate_fprintf2 (struct symbol *sym, FILE *fp)
 
void symbol__annotate_zero_histogram (struct symbol *sym, int evidx)
 
void symbol__annotate_decay_histogram (struct symbol *sym, int evidx)
 
void annotated_source__purge (struct annotated_source *as)
 
int map_symbol__annotation_dump (struct map_symbol *ms, struct perf_evsel *evsel)
 
bool ui__has_annotation (void)
 
int symbol__tty_annotate (struct symbol *sym, struct map *map, struct perf_evsel *evsel, struct annotation_options *opts)
 
int symbol__tty_annotate2 (struct symbol *sym, struct map *map, struct perf_evsel *evsel, struct annotation_options *opts)
 
static int symbol__tui_annotate (struct symbol *sym __maybe_unused, struct map *map __maybe_unused, struct perf_evsel *evsel __maybe_unused, struct hist_browser_timer *hbt __maybe_unused, struct annotation_options *opts __maybe_unused)
 
void annotation_config__init (void)
 

Variables

struct annotation_options annotation__default_options
 

Macro Definition Documentation

◆ ANNOTATION__CYCLES_WIDTH

#define ANNOTATION__CYCLES_WIDTH   6

Definition at line 63 of file annotate.h.

◆ ANNOTATION__IPC_WIDTH

#define ANNOTATION__IPC_WIDTH   6

Definition at line 62 of file annotate.h.

◆ ANNOTATION__MIN_OFFSET_LEVEL

#define ANNOTATION__MIN_OFFSET_LEVEL   ANNOTATION__OFFSET_JUMP_TARGETS

Definition at line 93 of file annotate.h.

◆ ANNOTATION__MINMAX_CYCLES_WIDTH

#define ANNOTATION__MINMAX_CYCLES_WIDTH   19

Definition at line 64 of file annotate.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ANNOTATION__OFFSET_JUMP_TARGETS 
ANNOTATION__OFFSET_CALL 
ANNOTATION__MAX_OFFSET_LEVEL 

Definition at line 87 of file annotate.h.

◆ symbol_disassemble_errno

Enumerator
SYMBOL_ANNOTATE_ERRNO__SUCCESS 
__SYMBOL_ANNOTATE_ERRNO__START 
SYMBOL_ANNOTATE_ERRNO__NO_VMLINUX 
__SYMBOL_ANNOTATE_ERRNO__END 

Definition at line 320 of file annotate.h.

Function Documentation

◆ __annotation__scnprintf_samples_period()

int __annotation__scnprintf_samples_period ( struct annotation notes,
char *  bf,
size_t  size,
struct perf_evsel evsel,
bool  show_freq 
)

Definition at line 2691 of file annotate.c.

Here is the call graph for this function:

◆ addr_map_symbol__account_cycles()

int addr_map_symbol__account_cycles ( struct addr_map_symbol ams,
struct addr_map_symbol start,
unsigned  cycles 
)

Definition at line 919 of file annotate.c.

Here is the call graph for this function:

◆ addr_map_symbol__inc_samples()

int addr_map_symbol__inc_samples ( struct addr_map_symbol ams,
struct perf_sample sample,
struct perf_evsel evsel 
)

Definition at line 1016 of file annotate.c.

Here is the call graph for this function:

◆ annotated_source__histogram()

static struct sym_hist* annotated_source__histogram ( struct annotated_source src,
int  idx 
)
static

Definition at line 283 of file annotate.h.

◆ annotated_source__purge()

void annotated_source__purge ( struct annotated_source as)

Definition at line 2209 of file annotate.c.

Here is the call graph for this function:

◆ annotation__compute_ipc()

void annotation__compute_ipc ( struct annotation notes,
size_t  size 
)

Definition at line 987 of file annotate.c.

Here is the call graph for this function:

◆ annotation__cycles_width()

static int annotation__cycles_width ( struct annotation notes)
inlinestatic

Definition at line 259 of file annotate.h.

◆ annotation__histogram()

static struct sym_hist* annotation__histogram ( struct annotation notes,
int  idx 
)
static

Definition at line 288 of file annotate.h.

Here is the call graph for this function:

◆ annotation__init_column_widths()

void annotation__init_column_widths ( struct annotation notes,
struct symbol sym 
)

Definition at line 2327 of file annotate.c.

Here is the call graph for this function:

◆ annotation__mark_jump_targets()

void annotation__mark_jump_targets ( struct annotation notes,
struct symbol sym 
)

Definition at line 2257 of file annotate.c.

Here is the call graph for this function:

◆ annotation__pcnt_width()

static int annotation__pcnt_width ( struct annotation notes)
inlinestatic

Definition at line 267 of file annotate.h.

◆ annotation__scnprintf_samples_period()

static int annotation__scnprintf_samples_period ( struct annotation notes,
char *  bf,
size_t  size,
struct perf_evsel evsel 
)
inlinestatic

Definition at line 181 of file annotate.h.

Here is the call graph for this function:

◆ annotation__set_offsets()

void annotation__set_offsets ( struct annotation notes,
s64  size 
)

Definition at line 2290 of file annotate.c.

◆ annotation__update_column_widths()

void annotation__update_column_widths ( struct annotation notes)

Definition at line 2335 of file annotate.c.

◆ annotation_config__init()

void annotation_config__init ( void  )

Definition at line 2788 of file annotate.c.

Here is the call graph for this function:

◆ annotation_line__filter()

static bool annotation_line__filter ( struct annotation_line al,
struct annotation notes 
)
inlinestatic

Definition at line 272 of file annotate.h.

Here is the call graph for this function:

◆ annotation_line__max_percent()

double annotation_line__max_percent ( struct annotation_line al,
struct annotation notes 
)

Definition at line 2444 of file annotate.c.

◆ annotation_line__next()

struct annotation_line* annotation_line__next ( struct annotation_line pos,
struct list_head *  head 
)

Definition at line 1193 of file annotate.c.

◆ annotation_line__write()

void annotation_line__write ( struct annotation_line al,
struct annotation notes,
struct annotation_write_ops ops 
)

Definition at line 2642 of file annotate.c.

Here is the call graph for this function:

◆ disasm__fprintf()

size_t disasm__fprintf ( struct list_head *  head,
FILE *  fp 
)

Definition at line 2236 of file annotate.c.

Here is the call graph for this function:

◆ disasm_line()

static struct disasm_line* disasm_line ( struct annotation_line al)
static

Definition at line 137 of file annotate.h.

◆ disasm_line__free()

void disasm_line__free ( struct disasm_line dl)

Definition at line 1168 of file annotate.c.

Here is the call graph for this function:

◆ disasm_line__has_local_offset()

static bool disasm_line__has_local_offset ( const struct disasm_line dl)
inlinestatic

Definition at line 146 of file annotate.h.

Here is the call graph for this function:

◆ disasm_line__is_valid_local_jump()

bool disasm_line__is_valid_local_jump ( struct disasm_line dl,
struct symbol sym 
)

Definition at line 2247 of file annotate.c.

Here is the call graph for this function:

◆ disasm_line__scnprintf()

int disasm_line__scnprintf ( struct disasm_line dl,
char *  bf,
size_t  size,
bool  raw 
)

Definition at line 1179 of file annotate.c.

Here is the call graph for this function:

◆ hist_entry__inc_addr_samples()

int hist_entry__inc_addr_samples ( struct hist_entry he,
struct perf_sample sample,
struct perf_evsel evsel,
u64  addr 
)

Definition at line 1022 of file annotate.c.

Here is the call graph for this function:

◆ ins__is_call()

bool ins__is_call ( const struct ins ins)

Definition at line 273 of file annotate.c.

◆ ins__is_fused()

bool ins__is_fused ( struct arch arch,
const char *  ins1,
const char *  ins2 
)

Definition at line 199 of file annotate.c.

◆ ins__is_jump()

bool ins__is_jump ( const struct ins ins)

Definition at line 386 of file annotate.c.

◆ ins__is_lock()

bool ins__is_lock ( const struct ins ins)

Definition at line 595 of file annotate.c.

◆ ins__is_ret()

bool ins__is_ret ( const struct ins ins)

Definition at line 590 of file annotate.c.

◆ ins__scnprintf()

int ins__scnprintf ( struct ins ins,
char *  bf,
size_t  size,
struct ins_operands ops 
)

Definition at line 190 of file annotate.c.

Here is the call graph for this function:

◆ map_symbol__annotation_dump()

int map_symbol__annotation_dump ( struct map_symbol ms,
struct perf_evsel evsel 
)

Definition at line 2157 of file annotate.c.

Here is the call graph for this function:

◆ symbol__annotate()

int symbol__annotate ( struct symbol sym,
struct map map,
struct perf_evsel evsel,
size_t  privsize,
struct annotation_options options,
struct arch **  parch 
)

Definition at line 1810 of file annotate.c.

Here is the call graph for this function:

◆ symbol__annotate2()

int symbol__annotate2 ( struct symbol sym,
struct map map,
struct perf_evsel evsel,
struct annotation_options options,
struct arch **  parch 
)

Definition at line 2652 of file annotate.c.

Here is the call graph for this function:

◆ symbol__annotate_decay_histogram()

void symbol__annotate_decay_histogram ( struct symbol sym,
int  evidx 
)

Definition at line 2196 of file annotate.c.

Here is the call graph for this function:

◆ symbol__annotate_fprintf2()

int symbol__annotate_fprintf2 ( struct symbol sym,
FILE *  fp 
)

Definition at line 2132 of file annotate.c.

Here is the call graph for this function:

◆ symbol__annotate_printf()

int symbol__annotate_printf ( struct symbol sym,
struct map map,
struct perf_evsel evsel,
struct annotation_options options 
)

Definition at line 1995 of file annotate.c.

Here is the call graph for this function:

◆ symbol__annotate_zero_histogram()

void symbol__annotate_zero_histogram ( struct symbol sym,
int  evidx 
)

Definition at line 2188 of file annotate.c.

Here is the call graph for this function:

◆ symbol__annotate_zero_histograms()

void symbol__annotate_zero_histograms ( struct symbol sym)

Definition at line 743 of file annotate.c.

Here is the call graph for this function:

◆ symbol__annotation()

static struct annotation* symbol__annotation ( struct symbol sym)
static

Definition at line 293 of file annotate.h.

Here is the call graph for this function:

◆ symbol__calc_percent()

void symbol__calc_percent ( struct symbol sym,
struct perf_evsel evsel 
)

Definition at line 1803 of file annotate.c.

Here is the call graph for this function:

◆ symbol__hists()

struct annotated_source* symbol__hists ( struct symbol sym,
int  nr_hists 
)

Definition at line 858 of file annotate.c.

Here is the call graph for this function:

◆ symbol__strerror_disassemble()

int symbol__strerror_disassemble ( struct symbol sym,
struct map map,
int  errnum,
char *  buf,
size_t  buflen 
)

◆ symbol__tty_annotate()

int symbol__tty_annotate ( struct symbol sym,
struct map map,
struct perf_evsel evsel,
struct annotation_options opts 
)

Definition at line 2413 of file annotate.c.

Here is the call graph for this function:

◆ symbol__tty_annotate2()

int symbol__tty_annotate2 ( struct symbol sym,
struct map map,
struct perf_evsel evsel,
struct annotation_options opts 
)

Definition at line 2386 of file annotate.c.

Here is the call graph for this function:

◆ symbol__tui_annotate()

static int symbol__tui_annotate ( struct symbol *sym  __maybe_unused,
struct map *map  __maybe_unused,
struct perf_evsel *evsel  __maybe_unused,
struct hist_browser_timer *hbt  __maybe_unused,
struct annotation_options *opts  __maybe_unused 
)
inlinestatic

Definition at line 364 of file annotate.h.

Here is the call graph for this function:

◆ ui__has_annotation()

bool ui__has_annotation ( void  )

Definition at line 2438 of file annotate.c.

Variable Documentation

◆ annotation__default_options

struct annotation_options annotation__default_options

Definition at line 47 of file annotate.c.