switch (key) { case -1: if (!ann->skip_missing) return; /* fall through */ case K_RIGHT: case'>':
next = rb_next(nd); break; case K_LEFT: case'<':
next = rb_prev(nd); break; default: return;
}
if (use_browser == 0 || next != NULL)
nd = next;
continue;
}
if (use_browser == 2) { int ret; int (*annotate)(struct hist_entry *he, struct evsel *evsel, struct hist_browser_timer *hbt);
annotate = dlsym(perf_gtk_handle, "hist_entry__gtk_annotate"); if (annotate == NULL) {
ui__error("GTK browser not found!\n"); return;
}
ret = annotate(he, evsel, NULL); if (!ret || !ann->skip_missing) return;
switch (key) { case -1: if (!ann->skip_missing) return; /* fall through */ case K_RIGHT: case'>':
next = rb_next(nd); break; case K_LEFT: case'<':
next = rb_prev(nd); break; default: return;
}
int cmd_annotate(int argc, constchar **argv)
{ struct perf_annotate annotate = {}; struct perf_data data = {
.mode = PERF_DATA_MODE_READ,
}; struct itrace_synth_opts itrace_synth_opts = {
.set = 0,
}; constchar *disassembler_style = NULL, *objdump_path = NULL, *addr2line_path = NULL; struct option options[] = {
OPT_STRING('i', "input", &input_name, "file", "input file name"),
OPT_STRING('d', "dsos", &symbol_conf.dso_list_str, "dso[,dso...]", "only consider symbols in these dsos"),
OPT_STRING('s', "symbol", &annotate.sym_hist_filter, "symbol", "symbol to annotate"),
OPT_BOOLEAN('f', "force", &data.force, "don't complain, do it"),
OPT_INCR('v', "verbose", &verbose, "be more verbose (show symbol address, etc)"),
OPT_BOOLEAN('q', "quiet", &quiet, "do now show any warnings or messages"),
OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, "dump raw trace in ASCII"), #ifdef HAVE_GTK2_SUPPORT
OPT_BOOLEAN(0, "gtk", &annotate.use_gtk, "Use the GTK interface"), #endif #ifdef HAVE_SLANG_SUPPORT
OPT_BOOLEAN(0, "tui", &annotate.use_tui, "Use the TUI interface"), #endif
OPT_BOOLEAN(0, "stdio", &annotate.use_stdio, "Use the stdio interface"),
OPT_BOOLEAN(0, "stdio2", &annotate.use_stdio2, "Use the stdio interface"),
OPT_BOOLEAN(0, "ignore-vmlinux", &symbol_conf.ignore_vmlinux, "don't load vmlinux even if found"),
OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name, "file", "vmlinux pathname"),
OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules, "load module symbols - WARNING: use only with -k and LIVE kernel"),
OPT_BOOLEAN('l', "print-line", &annotate_opts.print_lines, "print matching source lines (may be slow)"),
OPT_BOOLEAN('P', "full-paths", &annotate_opts.full_path, "Don't shorten the displayed pathnames"),
OPT_BOOLEAN(0, "skip-missing", &annotate.skip_missing, "Skip symbols that cannot be annotated"),
OPT_BOOLEAN_SET(0, "group", &symbol_conf.event_group,
&annotate.group_set, "Show event group information together"),
OPT_STRING('C', "cpu", &annotate.cpu_list, "cpu", "list of cpus to profile"),
OPT_CALLBACK(0, "symfs", NULL, "directory", "Look for files with symbols relative to this directory",
symbol__config_symfs),
OPT_BOOLEAN(0, "source", &annotate_opts.annotate_src, "Interleave source code with assembly code (default)"),
OPT_BOOLEAN(0, "asm-raw", &annotate_opts.show_asm_raw, "Display raw encoding of assembly instructions (default)"),
OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style", "Specify disassembler style (e.g. -M intel for intel syntax)"),
OPT_STRING(0, "prefix", &annotate_opts.prefix, "prefix", "Add prefix to source file path names in programs (with --prefix-strip)"),
OPT_STRING(0, "prefix-strip", &annotate_opts.prefix_strip, "N", "Strip first N entries of source file path name in programs (with --prefix)"),
OPT_STRING(0, "objdump", &objdump_path, "path", "objdump binary to use for disassembly and annotations"),
OPT_STRING(0, "addr2line", &addr2line_path, "path", "addr2line binary to use for line numbers"),
OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle, "Enable symbol demangling"),
OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel, "Enable kernel symbol demangling"),
OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period, "Show a column with the sum of periods"),
OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples, "Show a column with the number of samples"),
OPT_CALLBACK_DEFAULT(0, "stdio-color", NULL, "mode", "'always' (default), 'never' or 'auto' only applicable to --stdio mode",
stdio__config_color, "always"),
OPT_CALLBACK(0, "percent-type", &annotate_opts, "local-period", "Set percent type local/global-period/hits",
annotate_parse_percent_type),
OPT_CALLBACK(0, "percent-limit", &annotate, "percent", "Don't show entries under that percent", parse_percent_limit),
OPT_CALLBACK_OPTARG(0, "itrace", &itrace_synth_opts, NULL, "opts", "Instruction Tracing options\n" ITRACE_HELP,
itrace_parse_synth_opts),
OPT_CALLBACK_OPTARG(0, "data-type", &annotate, NULL, "name", "Show data type annotate for the memory accesses",
parse_data_type),
OPT_BOOLEAN(0, "type-stat", &annotate.type_stat, "Show stats for the data type annotation"),
OPT_BOOLEAN(0, "insn-stat", &annotate.insn_stat, "Show instruction stats for the data type annotation"),
OPT_BOOLEAN(0, "skip-empty", &symbol_conf.skip_empty, "Do not display empty (or dummy) events in the output"),
OPT_BOOLEAN(0, "code-with-type", &annotate_opts.code_with_type, "Show data type info in code annotation (memory instructions only)"),
OPT_END()
}; int ret;
argc = parse_options(argc, argv, options, annotate_usage, 0); if (argc) { /* *Specialcase:ifthere'sanargumentleftthenassumethat *it'sasymbolfilter:
*/ if (argc > 1)
usage_with_options(annotate_usage, options);
annotate.sym_hist_filter = argv[0];
}
if (disassembler_style) {
annotate_opts.disassembler_style = strdup(disassembler_style); if (!annotate_opts.disassembler_style) return -ENOMEM;
} if (objdump_path) {
annotate_opts.objdump_path = strdup(objdump_path); if (!annotate_opts.objdump_path) return -ENOMEM;
} if (addr2line_path) {
symbol_conf.addr2line_path = strdup(addr2line_path); if (!symbol_conf.addr2line_path) return -ENOMEM;
}
if (annotate_check_args() < 0) return -EINVAL;
#ifdef HAVE_GTK2_SUPPORT if (symbol_conf.show_nr_samples && annotate.use_gtk) {
pr_err("--show-nr-samples is not available in --gtk mode at this time\n"); return ret;
} #endif
#ifndef HAVE_LIBDW_SUPPORT if (annotate.data_type) {
pr_err("Error: Data type profiling is disabled due to missing DWARF support\n"); return -ENOTSUP;
} #endif
ret = symbol__validate_sym_arguments(); if (ret) return ret;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.