Linux Perf
annotate.c File Reference
#include <errno.h>
#include <inttypes.h>
#include "util.h"
#include "ui/ui.h"
#include "sort.h"
#include "build-id.h"
#include "color.h"
#include "config.h"
#include "cache.h"
#include "symbol.h"
#include "units.h"
#include "debug.h"
#include "annotate.h"
#include "evsel.h"
#include "evlist.h"
#include "block-range.h"
#include "string2.h"
#include "arch/common.h"
#include <regex.h>
#include <pthread.h>
#include <linux/bitops.h>
#include <linux/kernel.h>
#include "ui/browser.h"
#include "sane_ctype.h"
#include "arch/arm/annotate/instructions.c"
#include "arch/arm64/annotate/instructions.c"
#include "arch/x86/annotate/instructions.c"
#include "arch/powerpc/annotate/instructions.c"
#include "arch/s390/annotate/instructions.c"
Include dependency graph for annotate.c:

Go to the source code of this file.

Classes

struct  arch
 
struct  annotate_args
 
struct  annotation_config
 

Macros

#define LARROW_CHAR   ((unsigned char)',')
 
#define RARROW_CHAR   ((unsigned char)'+')
 
#define DARROW_CHAR   ((unsigned char)'.')
 
#define UARROW_CHAR   ((unsigned char)'-')
 
#define ANNOTATION__CFG(n)   { .name = #n, .value = &annotation__default_options.n, }
 

Functions

static struct ins_opsins__find (struct arch *arch, const char *name)
 
static void ins__sort (struct arch *arch)
 
static int disasm_line__parse (char *line, const char **namep, char **rawp)
 
static int arch__grow_instructions (struct arch *arch)
 
static int arch__associate_ins_ops (struct arch *arch, const char *name, struct ins_ops *ops)
 
static void ins__delete (struct ins_operands *ops)
 
static int ins__raw_scnprintf (struct ins *ins, char *bf, size_t size, struct ins_operands *ops)
 
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 int call__parse (struct arch *arch, struct ins_operands *ops, struct map_symbol *ms)
 
static int call__scnprintf (struct ins *ins, char *bf, size_t size, struct ins_operands *ops)
 
bool ins__is_call (const struct ins *ins)
 
static int jump__parse (struct arch *arch __maybe_unused, struct ins_operands *ops, struct map_symbol *ms)
 
static int jump__scnprintf (struct ins *ins, char *bf, size_t size, struct ins_operands *ops)
 
bool ins__is_jump (const struct ins *ins)
 
static int comment__symbol (char *raw, char *comment, u64 *addrp, char **namep)
 
static int lock__parse (struct arch *arch, struct ins_operands *ops, struct map_symbol *ms)
 
static int lock__scnprintf (struct ins *ins, char *bf, size_t size, struct ins_operands *ops)
 
static void lock__delete (struct ins_operands *ops)
 
static int mov__parse (struct arch *arch, struct ins_operands *ops, struct map_symbol *ms __maybe_unused)
 
static int mov__scnprintf (struct ins *ins, char *bf, size_t size, struct ins_operands *ops)
 
static int dec__parse (struct arch *arch __maybe_unused, struct ins_operands *ops, struct map_symbol *ms __maybe_unused)
 
static int dec__scnprintf (struct ins *ins, char *bf, size_t size, struct ins_operands *ops)
 
static int nop__scnprintf (struct ins *ins __maybe_unused, char *bf, size_t size, struct ins_operands *ops __maybe_unused)
 
bool ins__is_ret (const struct ins *ins)
 
bool ins__is_lock (const struct ins *ins)
 
static int ins__key_cmp (const void *name, const void *insp)
 
static int ins__cmp (const void *a, const void *b)
 
static struct ins_ops__ins__find (struct arch *arch, const char *name)
 
static int arch__key_cmp (const void *name, const void *archp)
 
static int arch__cmp (const void *a, const void *b)
 
static void arch__sort (void)
 
static struct archarch__find (const char *name)
 
static struct annotated_sourceannotated_source__new (void)
 
static __maybe_unused void annotated_source__delete (struct annotated_source *src)
 
static int annotated_source__alloc_histograms (struct annotated_source *src, size_t size, int nr_hists)
 
static int symbol__alloc_hist_cycles (struct symbol *sym)
 
void symbol__annotate_zero_histograms (struct symbol *sym)
 
static int __symbol__account_cycles (struct cyc_hist *ch, u64 start, unsigned offset, unsigned cycles, unsigned have_start)
 
static int __symbol__inc_addr_samples (struct symbol *sym, struct map *map, struct annotated_source *src, int evidx, u64 addr, struct perf_sample *sample)
 
static struct cyc_histsymbol__cycles_hist (struct symbol *sym)
 
struct annotated_sourcesymbol__hists (struct symbol *sym, int nr_hists)
 
static int symbol__inc_addr_samples (struct symbol *sym, struct map *map, struct perf_evsel *evsel, u64 addr, struct perf_sample *sample)
 
static int symbol__account_cycles (u64 addr, u64 start, struct symbol *sym, unsigned cycles)
 
int addr_map_symbol__account_cycles (struct addr_map_symbol *ams, struct addr_map_symbol *start, unsigned cycles)
 
static unsigned annotation__count_insn (struct annotation *notes, u64 start, u64 end)
 
static void annotation__count_and_fill (struct annotation *notes, u64 start, u64 end, struct cyc_hist *ch)
 
void annotation__compute_ipc (struct annotation *notes, size_t size)
 
int addr_map_symbol__inc_samples (struct addr_map_symbol *ams, struct perf_sample *sample, struct perf_evsel *evsel)
 
int hist_entry__inc_addr_samples (struct hist_entry *he, struct perf_sample *sample, struct perf_evsel *evsel, u64 ip)
 
static void disasm_line__init_ins (struct disasm_line *dl, struct arch *arch, struct map_symbol *ms)
 
static void annotation_line__delete (struct annotation_line *al)
 
static struct annotation_lineannotation_line__new (struct annotate_args *args, size_t privsize)
 
static struct disasm_linedisasm_line__new (struct annotate_args *args)
 
void disasm_line__free (struct disasm_line *dl)
 
int disasm_line__scnprintf (struct disasm_line *dl, char *bf, size_t size, bool raw)
 
static void annotation_line__add (struct annotation_line *al, struct list_head *head)
 
struct annotation_lineannotation_line__next (struct annotation_line *pos, struct list_head *head)
 
static const char * annotate__address_color (struct block_range *br)
 
static const char * annotate__asm_color (struct block_range *br)
 
static void annotate__branch_printf (struct block_range *br, u64 addr)
 
static int disasm_line__print (struct disasm_line *dl, u64 start, int addr_fmt_width)
 
static int annotation_line__print (struct annotation_line *al, struct symbol *sym, u64 start, struct perf_evsel *evsel, u64 len, int min_pcnt, int printed, int max_lines, struct annotation_line *queue, int addr_fmt_width)
 
static int symbol__parse_objdump_line (struct symbol *sym, FILE *file, struct annotate_args *args, int *line_nr)
 
static __attribute__ ((constructor))
 
static void delete_last_nop (struct symbol *sym)
 
int symbol__strerror_disassemble (struct symbol *sym __maybe_unused, struct map *map, int errnum, char *buf, size_t buflen)
 
static int dso__disassemble_filename (struct dso *dso, char *filename, size_t filename_size)
 
static int symbol__disassemble (struct symbol *sym, struct annotate_args *args)
 
static void calc_percent (struct sym_hist *hist, struct annotation_data *sample, s64 offset, s64 end)
 
static void annotation__calc_percent (struct annotation *notes, struct perf_evsel *evsel, s64 len)
 
void symbol__calc_percent (struct symbol *sym, struct perf_evsel *evsel)
 
int symbol__annotate (struct symbol *sym, struct map *map, struct perf_evsel *evsel, size_t privsize, struct annotation_options *options, struct arch **parch)
 
static void insert_source_line (struct rb_root *root, struct annotation_line *al)
 
static int cmp_source_line (struct annotation_line *a, struct annotation_line *b)
 
static void __resort_source_line (struct rb_root *root, struct annotation_line *al)
 
static void resort_source_line (struct rb_root *dest_root, struct rb_root *src_root)
 
static void print_summary (struct rb_root *root, const char *filename)
 
static void symbol__annotate_hits (struct symbol *sym, struct perf_evsel *evsel)
 
static int annotated_source__addr_fmt_width (struct list_head *lines, u64 start)
 
int symbol__annotate_printf (struct symbol *sym, struct map *map, struct perf_evsel *evsel, struct annotation_options *opts)
 
static void FILE__set_percent_color (void *fp __maybe_unused, double percent __maybe_unused, bool current __maybe_unused)
 
static int FILE__set_jumps_percent_color (void *fp __maybe_unused, int nr __maybe_unused, bool current __maybe_unused)
 
static int FILE__set_color (void *fp __maybe_unused, int color __maybe_unused)
 
static void FILE__printf (void *fp, const char *fmt,...)
 
static void FILE__write_graph (void *fp, int graph)
 
int symbol__annotate_fprintf2 (struct symbol *sym, FILE *fp)
 
int map_symbol__annotation_dump (struct map_symbol *ms, struct perf_evsel *evsel)
 
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)
 
static size_t disasm_line__fprintf (struct disasm_line *dl, FILE *fp)
 
size_t disasm__fprintf (struct list_head *head, FILE *fp)
 
bool disasm_line__is_valid_local_jump (struct disasm_line *dl, struct symbol *sym)
 
void annotation__mark_jump_targets (struct annotation *notes, struct symbol *sym)
 
void annotation__set_offsets (struct annotation *notes, s64 size)
 
static int width_jumps (int n)
 
void annotation__init_column_widths (struct annotation *notes, struct symbol *sym)
 
void annotation__update_column_widths (struct annotation *notes)
 
static void annotation__calc_lines (struct annotation *notes, struct map *map, struct rb_root *root)
 
static void symbol__calc_lines (struct symbol *sym, struct map *map, struct rb_root *root)
 
int symbol__tty_annotate2 (struct symbol *sym, struct map *map, struct perf_evsel *evsel, struct annotation_options *opts)
 
int symbol__tty_annotate (struct symbol *sym, struct map *map, struct perf_evsel *evsel, struct annotation_options *opts)
 
bool ui__has_annotation (void)
 
double annotation_line__max_percent (struct annotation_line *al, struct annotation *notes)
 
static void disasm_line__write (struct disasm_line *dl, struct annotation *notes, void *obj, char *bf, size_t size, void(*obj__printf)(void *obj, const char *fmt,...), void(*obj__write_graph)(void *obj, int graph))
 
static void __annotation_line__write (struct annotation_line *al, struct annotation *notes, bool first_line, bool current_entry, bool change_color, int width, void *obj, int(*obj__set_color)(void *obj, int color), void(*obj__set_percent_color)(void *obj, double percent, bool current), int(*obj__set_jumps_percent_color)(void *obj, int nr, bool current), void(*obj__printf)(void *obj, const char *fmt,...), void(*obj__write_graph)(void *obj, int graph))
 
void annotation_line__write (struct annotation_line *al, struct annotation *notes, struct annotation_write_ops *ops)
 
int symbol__annotate2 (struct symbol *sym, struct map *map, struct perf_evsel *evsel, struct annotation_options *options, struct arch **parch)
 
int __annotation__scnprintf_samples_period (struct annotation *notes, char *bf, size_t size, struct perf_evsel *evsel, bool show_freq)
 
static int annotation_config__cmp (const void *name, const void *cfgp)
 
static int annotation__config (const char *var, const char *value, void *data __maybe_unused)
 
void annotation_config__init (void)
 

Variables

struct annotation_options annotation__default_options
 
static regex_t file_lineno
 
static struct ins_ops call_ops
 
static struct ins_ops dec_ops
 
static struct ins_ops jump_ops
 
static struct ins_ops mov_ops
 
static struct ins_ops nop_ops
 
static struct ins_ops lock_ops
 
static struct ins_ops ret_ops
 
static struct arch architectures []
 
static struct annotation_config annotation__configs []
 

Macro Definition Documentation

◆ ANNOTATION__CFG

#define ANNOTATION__CFG (   n)    { .name = #n, .value = &annotation__default_options.n, }

Definition at line 2731 of file annotate.c.

◆ DARROW_CHAR

#define DARROW_CHAR   ((unsigned char)'.')

Definition at line 42 of file annotate.c.

◆ LARROW_CHAR

#define LARROW_CHAR   ((unsigned char)',')

Definition at line 40 of file annotate.c.

◆ RARROW_CHAR

#define RARROW_CHAR   ((unsigned char)'+')

Definition at line 41 of file annotate.c.

◆ UARROW_CHAR

#define UARROW_CHAR   ((unsigned char)'-')

Definition at line 43 of file annotate.c.

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:

◆ __annotation_line__write()

static void __annotation_line__write ( struct annotation_line al,
struct annotation notes,
bool  first_line,
bool  current_entry,
bool  change_color,
int  width,
void *  obj,
int(*)(void *obj, int color)  obj__set_color,
void(*)(void *obj, double percent, bool current)  obj__set_percent_color,
int(*)(void *obj, int nr, bool current)  obj__set_jumps_percent_color,
void(*)(void *obj, const char *fmt,...)  obj__printf,
void(*)(void *obj, int graph)  obj__write_graph 
)
static

Definition at line 2488 of file annotate.c.

Here is the call graph for this function:

◆ __attribute__()

static __attribute__ ( (constructor)  )
static

Definition at line 1495 of file annotate.c.

◆ __ins__find()

static struct ins_ops* __ins__find ( struct arch arch,
const char *  name 
)
static

Definition at line 622 of file annotate.c.

Here is the call graph for this function:

◆ __resort_source_line()

static void __resort_source_line ( struct rb_root *  root,
struct annotation_line al 
)
static

Definition at line 1893 of file annotate.c.

Here is the call graph for this function:

◆ __symbol__account_cycles()

static int __symbol__account_cycles ( struct cyc_hist ch,
u64  start,
unsigned  offset,
unsigned  cycles,
unsigned  have_start 
)
static

Definition at line 758 of file annotate.c.

◆ __symbol__inc_addr_samples()

static int __symbol__inc_addr_samples ( struct symbol sym,
struct map map,
struct annotated_source src,
int  evidx,
u64  addr,
struct perf_sample sample 
)
static

Definition at line 804 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:

◆ annotate__address_color()

static const char* annotate__address_color ( struct block_range br)
static

Definition at line 1202 of file annotate.c.

Here is the call graph for this function:

◆ annotate__asm_color()

static const char* annotate__asm_color ( struct block_range br)
static

Definition at line 1219 of file annotate.c.

Here is the call graph for this function:

◆ annotate__branch_printf()

static void annotate__branch_printf ( struct block_range br,
u64  addr 
)
static

Definition at line 1232 of file annotate.c.

Here is the call graph for this function:

◆ annotated_source__addr_fmt_width()

static int annotated_source__addr_fmt_width ( struct list_head *  lines,
u64  start 
)
static

Definition at line 1982 of file annotate.c.

◆ annotated_source__alloc_histograms()

static int annotated_source__alloc_histograms ( struct annotated_source src,
size_t  size,
int  nr_hists 
)
static

Definition at line 700 of file annotate.c.

◆ annotated_source__delete()

static __maybe_unused void annotated_source__delete ( struct annotated_source src)
static

Definition at line 691 of file annotate.c.

Here is the call graph for this function:

◆ annotated_source__new()

static struct annotated_source* annotated_source__new ( void  )
static

Definition at line 681 of file annotate.c.

Here is the call graph for this function:

◆ 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__calc_lines()

static void annotation__calc_lines ( struct annotation notes,
struct map map,
struct rb_root *  root 
)
static

Definition at line 2348 of file annotate.c.

Here is the call graph for this function:

◆ annotation__calc_percent()

static void annotation__calc_percent ( struct annotation notes,
struct perf_evsel evsel,
s64  len 
)
static

Definition at line 1776 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__config()

static int annotation__config ( const char *  var,
const char *  value,
void *data  __maybe_unused 
)
static

Definition at line 2760 of file annotate.c.

Here is the call graph for this function:

◆ annotation__count_and_fill()

static void annotation__count_and_fill ( struct annotation notes,
u64  start,
u64  end,
struct cyc_hist ch 
)
static

Definition at line 965 of file annotate.c.

Here is the call graph for this function:

◆ annotation__count_insn()

static unsigned annotation__count_insn ( struct annotation notes,
u64  start,
u64  end 
)
static

Definition at line 953 of file annotate.c.

◆ 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__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__cmp()

static int annotation_config__cmp ( const void *  name,
const void *  cfgp 
)
static

Definition at line 2753 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__add()

static void annotation_line__add ( struct annotation_line al,
struct list_head *  head 
)
static

Definition at line 1187 of file annotate.c.

◆ annotation_line__delete()

static void annotation_line__delete ( struct annotation_line al)
static

Definition at line 1080 of file annotate.c.

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__new()

static struct annotation_line* annotation_line__new ( struct annotate_args args,
size_t  privsize 
)
static

Definition at line 1101 of file annotate.c.

Here is the call graph for this function:

◆ 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__print()

static int annotation_line__print ( struct annotation_line al,
struct symbol sym,
u64  start,
struct perf_evsel evsel,
u64  len,
int  min_pcnt,
int  printed,
int  max_lines,
struct annotation_line queue,
int  addr_fmt_width 
)
static

Definition at line 1298 of file annotate.c.

Here is the call graph for this function:

◆ 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:

◆ arch__associate_ins_ops()

static int arch__associate_ins_ops ( struct arch arch,
const char *  name,
struct ins_ops ops 
)
static

Definition at line 116 of file annotate.c.

Here is the call graph for this function:

◆ arch__cmp()

static int arch__cmp ( const void *  a,
const void *  b 
)
static

Definition at line 653 of file annotate.c.

◆ arch__find()

static struct arch* arch__find ( const char *  name)
static

Definition at line 668 of file annotate.c.

Here is the call graph for this function:

◆ arch__grow_instructions()

static int arch__grow_instructions ( struct arch arch)
static

Definition at line 88 of file annotate.c.

Here is the call graph for this function:

◆ arch__key_cmp()

static int arch__key_cmp ( const void *  name,
const void *  archp 
)
static

Definition at line 646 of file annotate.c.

◆ arch__sort()

static void arch__sort ( void  )
static

Definition at line 661 of file annotate.c.

Here is the call graph for this function:

◆ calc_percent()

static void calc_percent ( struct sym_hist hist,
struct annotation_data sample,
s64  offset,
s64  end 
)
static

Definition at line 1756 of file annotate.c.

◆ call__parse()

static int call__parse ( struct arch arch,
struct ins_operands ops,
struct map_symbol ms 
)
static

Definition at line 207 of file annotate.c.

Here is the call graph for this function:

◆ call__scnprintf()

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

Definition at line 253 of file annotate.c.

Here is the call graph for this function:

◆ cmp_source_line()

static int cmp_source_line ( struct annotation_line a,
struct annotation_line b 
)
static

Definition at line 1880 of file annotate.c.

◆ comment__symbol()

static int comment__symbol ( char *  raw,
char *  comment,
u64 *  addrp,
char **  namep 
)
static

Definition at line 391 of file annotate.c.

◆ dec__parse()

static int dec__parse ( struct arch *arch  __maybe_unused,
struct ins_operands ops,
struct map_symbol *ms  __maybe_unused 
)
static

Definition at line 537 of file annotate.c.

Here is the call graph for this function:

◆ dec__scnprintf()

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

Definition at line 564 of file annotate.c.

Here is the call graph for this function:

◆ delete_last_nop()

static void delete_last_nop ( struct symbol sym)
static

Definition at line 1500 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__fprintf()

static size_t disasm_line__fprintf ( struct disasm_line dl,
FILE *  fp 
)
static

Definition at line 2219 of file annotate.c.

◆ 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__init_ins()

static void disasm_line__init_ins ( struct disasm_line dl,
struct arch arch,
struct map_symbol ms 
)
static

Definition at line 1028 of file annotate.c.

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__new()

static struct disasm_line* disasm_line__new ( struct annotate_args args)
static

Definition at line 1138 of file annotate.c.

Here is the call graph for this function:

◆ disasm_line__parse()

static int disasm_line__parse ( char *  line,
const char **  namep,
char **  rawp 
)
static

Definition at line 1039 of file annotate.c.

Here is the call graph for this function:

◆ disasm_line__print()

static int disasm_line__print ( struct disasm_line dl,
u64  start,
int  addr_fmt_width 
)
static

Definition at line 1284 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:

◆ disasm_line__write()

static void disasm_line__write ( struct disasm_line dl,
struct annotation notes,
void *  obj,
char *  bf,
size_t  size,
void(*)(void *obj, const char *fmt,...)  obj__printf,
void(*)(void *obj, int graph)  obj__write_graph 
)
static

Definition at line 2457 of file annotate.c.

Here is the call graph for this function:

◆ dso__disassemble_filename()

static int dso__disassemble_filename ( struct dso dso,
char *  filename,
size_t  filename_size 
)
static

Definition at line 1563 of file annotate.c.

Here is the call graph for this function:

◆ FILE__printf()

static void FILE__printf ( void *  fp,
const char *  fmt,
  ... 
)
static

Definition at line 2108 of file annotate.c.

◆ FILE__set_color()

static int FILE__set_color ( void *fp  __maybe_unused,
int color  __maybe_unused 
)
static

Definition at line 2103 of file annotate.c.

◆ FILE__set_jumps_percent_color()

static int FILE__set_jumps_percent_color ( void *fp  __maybe_unused,
int nr  __maybe_unused,
bool current  __maybe_unused 
)
static

Definition at line 2097 of file annotate.c.

◆ FILE__set_percent_color()

static void FILE__set_percent_color ( void *fp  __maybe_unused,
double percent  __maybe_unused,
bool current  __maybe_unused 
)
static

Definition at line 2091 of file annotate.c.

◆ FILE__write_graph()

static void FILE__write_graph ( void *  fp,
int  graph 
)
static

Definition at line 2117 of file annotate.c.

◆ hist_entry__inc_addr_samples()

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

Definition at line 1022 of file annotate.c.

Here is the call graph for this function:

◆ ins__cmp()

static int ins__cmp ( const void *  a,
const void *  b 
)
static

Definition at line 607 of file annotate.c.

◆ ins__delete()

static void ins__delete ( struct ins_operands ops)
static

Definition at line 174 of file annotate.c.

◆ ins__find()

static struct ins_ops * ins__find ( struct arch arch,
const char *  name 
)
static

Definition at line 636 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__key_cmp()

static int ins__key_cmp ( const void *  name,
const void *  insp 
)
static

Definition at line 600 of file annotate.c.

◆ ins__raw_scnprintf()

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

Definition at line 184 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:

◆ ins__sort()

static void ins__sort ( struct arch arch)
static

Definition at line 615 of file annotate.c.

Here is the call graph for this function:

◆ insert_source_line()

static void insert_source_line ( struct rb_root *  root,
struct annotation_line al 
)
static

Definition at line 1849 of file annotate.c.

◆ jump__parse()

static int jump__parse ( struct arch *arch  __maybe_unused,
struct ins_operands ops,
struct map_symbol ms 
)
static

Definition at line 278 of file annotate.c.

Here is the call graph for this function:

◆ jump__scnprintf()

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

Definition at line 351 of file annotate.c.

Here is the call graph for this function:

◆ lock__delete()

static void lock__delete ( struct ins_operands ops)
static

Definition at line 456 of file annotate.c.

Here is the call graph for this function:

◆ lock__parse()

static int lock__parse ( struct arch arch,
struct ins_operands ops,
struct map_symbol ms 
)
static

Definition at line 418 of file annotate.c.

Here is the call graph for this function:

◆ lock__scnprintf()

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

Definition at line 443 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:

◆ mov__parse()

static int mov__parse ( struct arch arch,
struct ins_operands ops,
struct map_symbol *ms  __maybe_unused 
)
static

Definition at line 476 of file annotate.c.

Here is the call graph for this function:

◆ mov__scnprintf()

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

Definition at line 524 of file annotate.c.

Here is the call graph for this function:

◆ nop__scnprintf()

static int nop__scnprintf ( struct ins *ins  __maybe_unused,
char *  bf,
size_t  size,
struct ins_operands *ops  __maybe_unused 
)
static

Definition at line 576 of file annotate.c.

Here is the call graph for this function:

◆ print_summary()

static void print_summary ( struct rb_root *  root,
const char *  filename 
)
static

Definition at line 1931 of file annotate.c.

Here is the call graph for this function:

◆ resort_source_line()

static void resort_source_line ( struct rb_root *  dest_root,
struct rb_root *  src_root 
)
static

Definition at line 1913 of file annotate.c.

Here is the call graph for this function:

◆ symbol__account_cycles()

static int symbol__account_cycles ( u64  addr,
u64  start,
struct symbol sym,
unsigned  cycles 
)
static

Definition at line 892 of file annotate.c.

Here is the call graph for this function:

◆ symbol__alloc_hist_cycles()

static int symbol__alloc_hist_cycles ( struct symbol sym)
static

Definition at line 732 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_hits()

static void symbol__annotate_hits ( struct symbol sym,
struct perf_evsel evsel 
)
static

Definition at line 1969 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 opts 
)

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__calc_lines()

static void symbol__calc_lines ( struct symbol sym,
struct map map,
struct rb_root *  root 
)
static

Definition at line 2378 of file annotate.c.

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__cycles_hist()

static struct cyc_hist* symbol__cycles_hist ( struct symbol sym)
static

Definition at line 839 of file annotate.c.

Here is the call graph for this function:

◆ symbol__disassemble()

static int symbol__disassemble ( struct symbol sym,
struct annotate_args args 
)
static

Definition at line 1614 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__inc_addr_samples()

static int symbol__inc_addr_samples ( struct symbol sym,
struct map map,
struct perf_evsel evsel,
u64  addr,
struct perf_sample sample 
)
static

Definition at line 878 of file annotate.c.

Here is the call graph for this function:

◆ symbol__parse_objdump_line()

static int symbol__parse_objdump_line ( struct symbol sym,
FILE *  file,
struct annotate_args args,
int *  line_nr 
)
static

Definition at line 1412 of file annotate.c.

Here is the call graph for this function:

◆ symbol__strerror_disassemble()

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

Definition at line 1524 of file annotate.c.

Here is the call graph for this function:

◆ 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:

◆ ui__has_annotation()

bool ui__has_annotation ( void  )

Definition at line 2438 of file annotate.c.

◆ width_jumps()

static int width_jumps ( int  n)
inlinestatic

Definition at line 2318 of file annotate.c.

Variable Documentation

◆ annotation__configs

struct annotation_config annotation__configs[]
static
Initial value:
= {
ANNOTATION__CFG(hide_src_code),
ANNOTATION__CFG(jump_arrows),
ANNOTATION__CFG(offset_level),
ANNOTATION__CFG(show_linenr),
ANNOTATION__CFG(show_nr_jumps),
ANNOTATION__CFG(show_nr_samples),
ANNOTATION__CFG(show_total_period),
ANNOTATION__CFG(use_offset),
}
#define ANNOTATION__CFG(n)
Definition: annotate.c:2731

◆ annotation__default_options

struct annotation_options annotation__default_options
Initial value:
= {
.use_offset = true,
.jump_arrows = true,
.annotate_src = true,
}

Definition at line 47 of file annotate.c.

◆ architectures

struct arch architectures[]
static

Definition at line 142 of file annotate.c.

◆ call_ops

static struct ins_ops call_ops
static
Initial value:
= {
.parse = call__parse,
.scnprintf = call__scnprintf,
}
static int call__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops)
Definition: annotate.c:253
static int call__parse(struct arch *arch, struct ins_operands *ops, struct map_symbol *ms)
Definition: annotate.c:207

Definition at line 80 of file annotate.c.

◆ dec_ops

static struct ins_ops dec_ops
static
Initial value:
= {
.parse = dec__parse,
.scnprintf = dec__scnprintf,
}
static int dec__parse(struct arch *arch __maybe_unused, struct ins_operands *ops, struct map_symbol *ms __maybe_unused)
Definition: annotate.c:537
static int dec__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops)
Definition: annotate.c:564

Definition at line 81 of file annotate.c.

◆ file_lineno

regex_t file_lineno
static

Definition at line 54 of file annotate.c.

◆ jump_ops

static struct ins_ops jump_ops
static
Initial value:
= {
.parse = jump__parse,
.scnprintf = jump__scnprintf,
}
static int jump__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops)
Definition: annotate.c:351
static int jump__parse(struct arch *arch __maybe_unused, struct ins_operands *ops, struct map_symbol *ms)
Definition: annotate.c:278

Definition at line 82 of file annotate.c.

◆ lock_ops

static struct ins_ops lock_ops
static
Initial value:
= {
.free = lock__delete,
.parse = lock__parse,
.scnprintf = lock__scnprintf,
}
static void lock__delete(struct ins_operands *ops)
Definition: annotate.c:456
static int lock__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops)
Definition: annotate.c:443
static int lock__parse(struct arch *arch, struct ins_operands *ops, struct map_symbol *ms)
Definition: annotate.c:418

Definition at line 85 of file annotate.c.

◆ mov_ops

static struct ins_ops mov_ops
static
Initial value:
= {
.parse = mov__parse,
.scnprintf = mov__scnprintf,
}
static int mov__parse(struct arch *arch, struct ins_operands *ops, struct map_symbol *ms __maybe_unused)
Definition: annotate.c:476
static int mov__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops)
Definition: annotate.c:524

Definition at line 83 of file annotate.c.

◆ nop_ops

static struct ins_ops nop_ops
static
Initial value:
= {
.scnprintf = nop__scnprintf,
}
static int nop__scnprintf(struct ins *ins __maybe_unused, char *bf, size_t size, struct ins_operands *ops __maybe_unused)
Definition: annotate.c:576

Definition at line 84 of file annotate.c.

◆ ret_ops

static struct ins_ops ret_ops
static
Initial value:
= {
.scnprintf = ins__raw_scnprintf,
}
static int ins__raw_scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops)
Definition: annotate.c:184

Definition at line 86 of file annotate.c.