Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
tools/perf/ui/browsers/annotate.c
static void annotate_browser__write_graph(void *browser, int graph) { ui_browser__write_graph(browser, graph); }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/annotate.c
static void annotate_browser__set_percent_color(void *browser, double percent, bool current) { ui_browser__set_percent_color(browser, percent, current); }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/annotate.c
static int is_fused(struct annotate_browser *ab, struct disasm_line *cursor) { struct disasm_line *pos = list_prev_entry(cursor, al.node); const char *name; int diff = 1; while (pos && pos->al.offset == -1) { pos = list_prev_entry(pos, al.node); if (!ab->opts->hide_src_code) diff++; } if (!...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/annotate.c
static void annotate_browser__calc_percent(struct annotate_browser *browser, struct evsel *evsel) { struct map_symbol *ms = browser->b.priv; struct symbol *sym = ms->sym; struct annotation *notes = symbol__annotation(sym); struct disasm_line *pos; browser->entries ...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/annotate.c
static bool annotate_browser__toggle_source(struct annotate_browser *browser) { struct annotation *notes = browser__annotation(&browser->b); struct annotation_line *al; off_t offset = browser->b.index - browser->b.top_idx; browser->b.seek(&browser->b, offset, SEEK_CUR); al = list_entry(browser->b.top, struct...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/annotate.c
static void ui_browser__init_asm_mode(struct ui_browser *browser) { struct annotation *notes = browser__annotation(browser); ui_browser__reset_index(browser); browser->nr_entries = notes->nr_asm_entries; }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/annotate.c
static bool annotate_browser__callq(struct annotate_browser *browser, struct evsel *evsel, struct hist_browser_timer *hbt) { struct map_symbol *ms = browser->b.priv, target_ms; struct disasm_line *dl = disasm_line(browser->selection); struct ...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/annotate.c
static bool annotate_browser__search_window(struct annotate_browser *browser, int delay_secs) { if (ui_browser__input_window("Search", "String: ", browser->search_bf, "ENTER: OK, ESC: Cancel", delay_secs * 2) !=...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/annotate.c
static int annotate_browser__show(struct ui_browser *browser, char *title, const char *help) { struct annotate_browser *ab = container_of(browser, struct annotate_browser, b); struct map_symbol *ms = browser->priv; struct symbol *sym = ms->sym; char symbol_dso[SYM_TITLE_...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/annotate.c
int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel, struct hist_browser_timer *hbt, struct annotation_options *opts) { struct symbol *sym = ms->sym; struct annotation *notes = symbol__annotation(sym); struct annotate_browser browser = { .b =...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/header.c
static void ui_browser__argv_write(struct ui_browser *browser, void *entry, int row) { char **arg = entry; char *str = *arg; char empty[] = " "; bool current_entry = ui_browser__is_current_entry(browser, row); unsigned long offset = (unsigned long)browser->priv; if (offs...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/header.c
static int list_menu__run(struct ui_browser *menu) { int key; unsigned long offset; static const char help[] = "h/?/F1 Show this window\n" "UP/DOWN/PGUP\n" "PGDN/SPACE\n" "LEFT/RIGHT Navigate\n" ...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/header.c
static int ui__list_menu(int argc, char *const argv[]) { struct ui_browser menu = { .entries = (void *)argv, .refresh = ui_browser__argv_refresh, .seek = ui_browser__argv_seek, .write = ui_browser__argv_write, .nr_entries = argc, }; return list_menu__run(&menu); }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/header.c
int tui__header_window(struct perf_env *env) { int i, argc = 0; char **argv; struct perf_session *session; char *ptr, *pos; size_t size; FILE *fp = open_memstream(&ptr, &size); session = container_of(env, struct perf_session, header.env); perf_header__fprintf_info(session, fp, true); fclose(fp); ...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static int hist_browser__get_folding(struct hist_browser *browser) { struct rb_node *nd; struct hists *hists = browser->hists; int unfolded_rows = 0; for (nd = rb_first_cached(&hists->entries); (nd = hists__filter_entries(nd, browser->min_pcnt)) != NULL; nd = rb_hierarchy_next(nd)) { struct ...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static u32 hist_browser__nr_entries(struct hist_browser *hb) { u32 nr_entries; if (symbol_conf.report_hierarchy) nr_entries = hb->nr_hierarchy_entries; else if (hist_browser__has_filter(hb)) nr_entries = hb->nr_non_filtered_entries; else nr_entries = hb->hists->nr_entries; hb->nr_callchain_rows...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static void hist_browser__refresh_dimensions(struct ui_browser *browser) { struct hist_browser *hb = container_of(browser, struct hist_browser, b); browser->width = 3 + (hists__sort_list_width(hb->hists) + sizeof("[k]")); /* * FIXME: Just keeping existing behaviour, but this really should be * before upd...
[ 1, 1 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static bool callchain_list__toggle_fold(struct callchain_list *cl) { if (!cl) return false; if (!cl->has_children) return false; cl->unfolded = !cl->unfolded; return true; }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static void callchain_node__init_have_children_rb_tree(struct callchain_node *node) { struct rb_node *nd = rb_first(&node->rb_root); for (nd = rb_first(&node->rb_root); nd; nd = rb_next(nd)) { struct callchain_node *child = rb_entry(nd, struct callchain_node, rb_node); struct callchain_list *chain; bo...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static void callchain__init_have_children(struct rb_root *root) { struct rb_node *nd = rb_first(root); bool has_sibling = nd && rb_next(nd); for (nd = rb_first(root); nd; nd = rb_next(nd)) { struct callchain_node *node = rb_entry(nd, struct callchain_node, rb_node); callchain_node__init_have_children(no...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static bool hist_browser__selection_has_children(struct hist_browser *browser) { struct hist_entry *he = browser->he_selection; struct map_symbol *ms = browser->selection; if (!he || !ms) return false; if (ms == &he->ms) return he->has_children; return container_of(ms, struct callchain_list, ms)->...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static bool hist_browser__selection_unfolded(struct hist_browser *browser) { struct hist_entry *he = browser->he_selection; struct map_symbol *ms = browser->selection; if (!he || !ms) return false; if (ms == &he->ms) return he->unfolded; return container_of(ms, struct callchain_list, ms)->unfolded...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static int callchain_node__set_folding(struct callchain_node *node, bool unfold) { struct callchain_list *chain; bool has_children = false; int n = 0; list_for_each_entry(chain, &node->val, list) { ++n; callchain_list__set_folding(chain, unfold); has_children...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static int hierarchy_set_folding(struct hist_browser *hb, struct hist_entry *he, bool unfold __maybe_unused) { float percent; struct rb_node *nd; struct hist_entry *child; int n = 0; for (nd = rb_first_cached(&he->hroot_out); nd; nd = rb_next(nd)) { child = rb_entry(nd, ...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static void hist_browser__set_folding(struct hist_browser *browser, bool unfold) { browser->nr_hierarchy_entries = 0; browser->nr_callchain_rows = 0; __hist_browser__set_folding(browser, unfold); browser->b.nr_entries = hist_browser__nr_entries(browser); ui_browser__res...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static int hist_browser__show_callchain(struct hist_browser *browser, struct hist_entry *entry, int level, unsigned short row, print_callchain_entry_fn print, ...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
void hist_browser__init_hpp(void) { perf_hpp__format[PERF_HPP__OVERHEAD].color = hist_browser__hpp_color_overhead; perf_hpp__format[PERF_HPP__OVERHEAD_SYS].color = hist_browser__hpp_color_overhead_sys; perf_hpp__format[PERF_HPP__OVERHEAD_US].color = hist_browser__hpp_color_overhead_us; perf_hpp__fo...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static int advance_hpp_check(struct perf_hpp *hpp, int inc) { advance_hpp(hpp, inc); return hpp->size <= 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static void hists_browser__headers(struct hist_browser *browser) { struct hists *hists = browser->hists; struct perf_hpp_list *hpp_list = hists->hpp_list; int line; for (line = 0; line < hpp_list->nr_header_lines; line++) { char headers[1024]; hists_browser__scnprintf_headers(browser, headers, sizeo...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static struct rb_node *hists__filter_prev_entries(struct rb_node *nd, float min_pcnt) { while (nd != NULL) { struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node); float percent = hist_entry__get_percent_limit(h); if (!h->filtered && percent >=...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static int hist_browser__fprintf(struct hist_browser *browser, FILE *fp) { struct rb_node *nd = hists__filter_entries(rb_first(browser->b.entries), browser->min_pcnt); int printed = 0; while (nd) { struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node); if (symbol_conf.report_hierarchy) ...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
void hist_browser__delete(struct hist_browser *browser) { free(browser); }
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static struct hist_entry * hist_browser__selected_entry(struct hist_browser *browser) { return browser->he_selection; }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static int do_annotate(struct hist_browser *browser, struct popup_action *act) { struct evsel *evsel; struct annotation *notes; struct hist_entry *he; int err; if (!browser->annotation_opts->objdump_path && perf_env__lookup_objdump(browser->env, &browser->annotation_opts-...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static int do_zoom_thread(struct hist_browser *browser, struct popup_action *act) { struct thread *thread = act->thread; if ((!hists__has(browser->hists, thread) && !hists__has(browser->hists, comm)) || thread == NULL) return 0; if (browser->hists->thread_filter) { ...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static int hists_browser__zoom_map(struct hist_browser *browser, struct map *map) { if (!hists__has(browser->hists, dso) || map == NULL) return 0; if (browser->hists->dso_filter) { pstack__remove(browser->pstack, &browser->hists->dso_filter); perf_hpp__set_elide(HIST...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static int do_toggle_callchain(struct hist_browser *browser, struct popup_action *act __maybe_unused) { hist_browser__toggle_fold(browser); return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static int add_script_opt(struct hist_browser *browser, struct popup_action *act, char **optstr, struct thread *thread, struct symbol *sym, struct evsel *evsel) { int n, j; struct hist_entry *he; n = add_script_opt_2(browser, act, opt...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static int do_zoom_socket(struct hist_browser *browser, struct popup_action *act) { if (!hists__has(browser->hists, socket) || act->socket < 0) return 0; if (browser->hists->socket_filter > -1) { pstack__remove(browser->pstack, &browser->hists->socket_filter); browser->hists-...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/hists.c
static bool filter_group_entries(struct ui_browser *browser __maybe_unused, void *entry) { struct evsel *evsel = list_entry(entry, struct evsel, core.node); if (symbol_conf.event_group && !evsel__is_group_leader(evsel)) return true; return false; }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/map.c
static u32 *symbol__browser_index(struct symbol *browser) { return ((void *)browser) - sizeof(struct rb_node) - sizeof(u32); }
[ 1, 1 ]
Linux Kernel
tools/perf/ui/browsers/scripts.c
void attr_to_script(char *extra_format, struct perf_event_attr *attr) { extra_format[0] = 0; if (attr->read_format & PERF_FORMAT_GROUP) strcat(extra_format, " -F +metric"); if (attr->sample_type & PERF_SAMPLE_BRANCH_STACK) strcat(extra_format, " -F +brstackinsn --xed"); if (attr->sample_type & PERF_SAM...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/browsers/scripts.c
void run_script(char *cmd) { pr_debug("Running %s\n", cmd); SLang_reset_tty(); if (system(cmd) < 0) pr_warning("Cannot run %s\n", cmd); printf("\033[c\033[H\033[J"); fflush(stdout); SLang_init_tty(0, 0, 0); SLsmg_refresh(); }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/browsers/scripts.c
int script_browse(const char *script_opt, struct evsel *evsel) { char *cmd, script_name[SCRIPT_FULLPATH_LEN]; bool custom = false; memset(script_name, 0, SCRIPT_FULLPATH_LEN); if (list_scripts(script_name, &custom, evsel)) return -1; if (asprintf(&cmd, "%s%s %s %s%s 2>&1 | less", custom ...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/gtk/annotate.c
static int perf_gtk__get_percent(char *buf, size_t size, struct symbol *sym, struct disasm_line *dl, int evidx) { struct sym_hist *symhist; double percent = 0.0; const char *markup; int ret = 0; strcpy(buf, ""); if (dl->al.offset == (s64)-1) return 0; symhist = ann...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/gtk/browser.c
void perf_gtk__signal(int sig) { perf_gtk__exit(false); psignal(sig, "perf"); }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/gtk/browser.c
void perf_gtk__resize_window(GtkWidget *window) { GdkRectangle rect; GdkScreen *screen; int monitor; int height; int width; screen = gtk_widget_get_screen(window); monitor = gdk_screen_get_monitor_at_window(screen, window->window); gdk_screen_get_monitor_geometry(screen, monitor, &rect); width = ...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/gtk/helpline.c
static void gtk_helpline_push(const char *msg) { if (!perf_gtk__is_active_context(pgctx)) return; gtk_statusbar_push(GTK_STATUSBAR(pgctx->statbar), pgctx->statbar_ctx_id, msg); }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/gtk/helpline.c
void perf_gtk__init_helpline(void) { helpline_fns = &gtk_helpline_fns; }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/gtk/hists.c
static void perf_gtk__add_callchain_flat(struct rb_root *root, GtkTreeStore *store, GtkTreeIter *parent, int col, u64 total) { struct rb_node *nd; bool has_single_node = (rb_first(root) == rb_l...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/gtk/hists.c
static void perf_gtk__add_callchain_folded(struct rb_root *root, GtkTreeStore *store, GtkTreeIter *parent, int col, u64 total) { struct rb_node *nd; for (nd = rb_first(root); nd; nd = r...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/gtk/hists.c
static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store, GtkTreeIter *parent, int col, u64 total) { if (callchain_param.mode == CHAIN_FLAT) perf_gtk__add_callchain_flat(root, store, parent, col, total); else if (callchain_param.mode == CHAIN_FOLDED) ...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/gtk/progress.c
static void gtk_ui_progress__update(struct ui_progress *p) { double fraction = p->total ? 1.0 * p->curr / p->total : 0.0; char buf[1024]; if (dialog == NULL) { GtkWidget *vbox = gtk_vbox_new(TRUE, 5); GtkWidget *label = gtk_label_new(p->title); dialog = gtk_window_new(GTK_WINDOW_TOPLEVEL); progr...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/gtk/progress.c
static void gtk_ui_progress__finish(void) { gtk_widget_destroy(dialog); dialog = NULL; }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/gtk/setup.c
int perf_gtk__init(void) { perf_error__register(&perf_gtk_eops); perf_gtk__init_helpline(); gtk_ui_progress__init(); perf_gtk__init_hpp(); return gtk_init_check(NULL, NULL) ? 0 : -1; }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/gtk/setup.c
void perf_gtk__exit(bool wait_for_ok __maybe_unused) { if (!perf_gtk__is_active_context(pgctx)) return; perf_error__unregister(&perf_gtk_eops); gtk_main_quit(); }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/gtk/util.c
int perf_gtk__deactivate_context(struct perf_gtk_context **ctx) { if (!perf_gtk__is_active_context(*ctx)) return -1; zfree(ctx); return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/gtk/util.c
static int perf_gtk__warning_statusbar(const char *format, va_list args) { char *msg, *p; if (!perf_gtk__is_active_context(pgctx) || vasprintf(&msg, format, args) < 0) { fprintf(stderr, "Warning:\n"); vfprintf(stderr, format, args); fprintf(stderr, "\n"); return -1; } gtk_statusbar_pop(G...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/helpline.c
static void nop_helpline__push(const char *msg __maybe_unused) {}
[ 0, 0 ]
Linux Kernel
tools/perf/ui/helpline.c
void ui_helpline__push(const char *msg) { helpline_fns->push(msg); }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/helpline.c
void ui_helpline__fpush(const char *fmt, ...) { va_list ap; va_start(ap, fmt); ui_helpline__vpush(fmt, ap); va_end(ap); }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/hist.c
int hpp__fmt_acc(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he, hpp_field_fn get_field, const char *fmtstr, hpp_snprint_fn print_fn, bool fmt_percent) { if (!symbol_conf.cumulate_callchain) { int len = fmt->user_len ?: fmt->len; retur...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/hist.c
static int __hpp__group_sort_idx(struct hist_entry *a, struct hist_entry *b, hpp_field_fn get_field, int idx) { struct evsel *evsel = hists_to_evsel(a->hists); u64 *fields_a, *fields_b; int cmp, nr_members, ret, i; cmp = field_cmp(get_field(a), get_field(b)); if (!evsel__is_...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/hist.c
static bool perf_hpp__is_hpp_entry(struct perf_hpp_fmt *a) { return a->header == hpp__header_fn; }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/hist.c
static void perf_hpp__column_unregister(struct perf_hpp_fmt *format) { list_del_init(&format->list); fmt_free(format); }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/hist.c
void perf_hpp__append_sort_keys(struct perf_hpp_list *list) { struct perf_hpp_fmt *fmt; perf_hpp_list__for_each_format(list, fmt) { struct perf_hpp_fmt *pos; perf_hpp_list__for_each_sort_list(list, pos) { if (fmt_equal(fmt, pos)) goto next; } perf_hpp__register_sort_field(fmt); ne...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/hist.c
unsigned int hists__sort_list_width(struct hists *hists) { struct perf_hpp_fmt *fmt; int ret = 0; bool first = true; struct perf_hpp dummy_hpp; hists__for_each_format(hists, fmt) { if (perf_hpp__should_skip(fmt, hists)) continue; if (first) first = false; else ret += 2; re...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/hist.c
void perf_hpp__reset_width(struct perf_hpp_fmt *fmt, struct hists *hists) { if (perf_hpp__is_sort_entry(fmt)) return perf_hpp__reset_sort_width(fmt, hists); if (perf_hpp__is_dynamic_entry(fmt)) return; BUG_ON(fmt->idx >= PERF_HPP__MAX_INDEX); switch (fmt->idx) { case PERF_HPP__OVERHEAD: case PER...
[ 0, 0 ]
Linux Kernel
tools/perf/ui/hist.c
static int add_hierarchy_fmt(struct hists *hists, struct perf_hpp_fmt *fmt) { struct perf_hpp_list_node *node = NULL; struct perf_hpp_fmt *fmt_copy; bool found = false; bool skip = perf_hpp__should_skip(fmt, hists); list_for_each_entry(node, &hists->hpp_formats, list) { if (node->level == fmt->level) { ...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/setup.c
static int setup_gtk_browser(void) { int (*perf_ui_init)(void); if (perf_gtk_handle) return 0; perf_gtk_handle = dlopen(PERF_GTK_DSO, RTLD_LAZY); if (perf_gtk_handle == NULL) { char buf[PATH_MAX]; scnprintf(buf, sizeof(buf), "%s/%s", LIBDIR, PERF_GTK_DSO); perf_gtk_handle = dlopen(buf, RTLD_L...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/setup.c
int stdio__config_color(const struct option *opt __maybe_unused, const char *mode, int unset __maybe_unused) { perf_use_color_default = perf_config_colorbool("color.ui", mode, -1); return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/stdio/hist.c
static size_t ipchain__fprintf_graph(FILE *fp, struct callchain_node *node, struct callchain_list *chain, int depth, int depth_mask, int period, u64 total_samples, int left_margin) { int i; size_t ret = 0...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/stdio/hist.c
static size_t __callchain__fprintf_folded(FILE *fp, struct callchain_node *node) { const char *sep = symbol_conf.field_sep ?: ";"; struct callchain_list *chain; size_t ret = 0; char bf[1024]; bool first; if (!node) return 0; ret += __callchain__fprintf_fold...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/stdio/hist.c
static int print_hierarchy_indent(const char *sep, int indent, const char *line, FILE *fp) { int width; if (sep != NULL || indent < 2) return 0; width = (indent - 2) * HIERARCHY_INDENT; return fprintf(fp, "%-*.*s", width, width, line); }
[ 1, 0 ]
Linux Kernel
tools/perf/ui/tui/progress.c
static int get_title(struct ui_progress *p, char *buf, size_t size) { char buf_cur[20]; char buf_tot[20]; int ret; ret = unit_number__scnprintf(buf_cur, sizeof(buf_cur), p->curr); ret += unit_number__scnprintf(buf_tot, sizeof(buf_tot), p->total); return ret + scnprintf(buf, size, "%s [%s/%s]", p->title, ...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/tui/progress.c
static void tui_progress__update(struct ui_progress *p) { char buf[100], *title = (char *)p->title; int bar, y; /* * FIXME: We should have a per UI backend way of showing progress, * stdio will just show a percentage as NN%, etc. */ if (use_browser <= 0) return; if (p->total == 0) return; ...
[ 1, 1 ]
Linux Kernel
tools/perf/ui/tui/setup.c
static void ui__signal_backtrace(int sig) { void *stackdump[32]; size_t size; ui__exit(false); psignal(sig, "perf"); printf("-------- backtrace --------\n"); size = backtrace(stackdump, ARRAY_SIZE(stackdump)); backtrace_symbols_fd(stackdump, size, STDOUT_FILENO); exit(0); }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/tui/setup.c
static void ui__signal(int sig) { ui__exit(false); psignal(sig, "perf"); exit(0); }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/tui/util.c
void __ui__info_window(const char *title, const char *text, const char *exit_msg) { int x, y; int max_len = 0, nr_lines = 0; const char *t; t = text; while (1) { const char *sep = strchr(t, '\n'); int len; if (sep == NULL) sep = strchr(t, '\0'); len = sep - t; ...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/tui/util.c
int ui__help_window(const char *text) { return ui__question_window("Help", text, "Press any key...", 0); }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/tui/util.c
static int __ui__warning(const char *title, const char *format, va_list args) { char *s; if (vasprintf(&s, format, args) > 0) { int key; key = ui__question_window(title, s, "Press any key...", 0); free(s); return key; } fprintf(stderr, "%s\n", title); vfprintf(stderr, format, args); retu...
[ 1, 0 ]
Linux Kernel
tools/perf/ui/ui.h
static inline void ui__exit(bool wait_for_ok __maybe_unused) {}
[ 0, 0 ]
Linux Kernel
tools/perf/ui/util.c
static int perf_stdio__warning(const char *format, va_list args) { fprintf(stderr, "Warning:\n"); vfprintf(stderr, format, args); return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/util.c
int ui__error(const char *format, ...) { int ret; va_list args; va_start(args, format); ret = perf_eops->error(format, args); va_end(args); return ret; }
[ 0, 0 ]
Linux Kernel
tools/perf/ui/util.c
int perf_error__unregister(struct perf_error_ops *eops) { if (perf_eops != eops) return -1; perf_eops = &default_eops; return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/affinity.c
int affinity__setup(struct affinity *a) { int cpu_set_size = get_cpu_set_size(); a->orig_cpus = bitmap_zalloc(cpu_set_size * 8); if (!a->orig_cpus) return -1; sched_getaffinity(0, cpu_set_size, (cpu_set_t *)a->orig_cpus); a->sched_cpus = bitmap_zalloc(cpu_set_size * 8); if (!a->sched_cpus) { zfree...
[ 0, 0 ]
Linux Kernel
tools/perf/util/amd-sample-raw.c
static void pr_ibs_op_data(union ibs_op_data reg) { printf( "ibs_op_data:\t%016llx CompToRetCtr %5d TagToRetCtr %5d%s%s%s BrnRet %d " " RipInvalid %d BrnFuse %d Microcode %d\n", reg.val, reg.comp_to_ret_ctr, reg.tag_to_ret_ctr, reg.op_brn_ret ? (reg.op_return ? " OpReturn 1" : " OpReturn 0") ...
[ 0, 0 ]
Linux Kernel
tools/perf/util/amd-sample-raw.c
static bool is_valid_ibs_op_sample(struct perf_sample *sample) { struct perf_ibs_data *data = sample->raw_data; union ibs_op_ctl *op_ctl = (union ibs_op_ctl *)data->data; if (op_ctl->op_en && op_ctl->op_val) return true; return false; }
[ 1, 0 ]
Linux Kernel
tools/perf/util/annotate.c
int ins__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops, int max_ins_name) { if (ins->ops->scnprintf) return ins->ops->scnprintf(ins, bf, size, ops, max_ins_name); return ins__raw_scnprintf(ins, bf, size, ops, max_ins_name); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/annotate.c
static int call__parse(struct arch *arch, struct ins_operands *ops, struct map_symbol *ms) { char *endptr, *tok, *name; struct map *map = ms->map; struct addr_map_symbol target = { .ms = { .map = map, }, }; ops->target.addr = strtoull(ops->raw, &...
[ 1, 0 ]
Linux Kernel
tools/perf/util/annotate.c
static int dec__parse(struct arch *arch __maybe_unused, struct ins_operands *ops, struct map_symbol *ms __maybe_unused) { char *target, *comment, *s, prev; target = s = ops->raw; while (s[0] != '\0' && !isspace(s[0])) ++s; prev = *s; *s = '\0'; ops->target...
[ 0, 0 ]
Linux Kernel
tools/perf/util/annotate.c
static struct annotated_source *annotated_source__new(void) { struct annotated_source *src = zalloc(sizeof(*src)); if (src != NULL) INIT_LIST_HEAD(&src->source); return src; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/annotate.c
static struct cyc_hist *symbol__cycles_hist(struct symbol *sym) { struct annotation *notes = symbol__annotation(sym); if (notes->src == NULL) { notes->src = annotated_source__new(); if (notes->src == NULL) return NULL; goto alloc_cycles_hist; } if (!notes->src->cycles_hist) { alloc_cycles...
[ 1, 0 ]
Linux Kernel
tools/perf/util/annotate.c
static int symbol__account_cycles(u64 addr, u64 start, struct symbol *sym, unsigned cycles) { struct cyc_hist *cycles_hist; unsigned offset; if (sym == NULL) return 0; cycles_hist = symbol__cycles_hist(sym); if (cycles_hist == NULL) return -ENOMEM; if (addr < sym-...
[ 1, 0 ]
Linux Kernel
tools/perf/util/annotate.c
static void annotation__count_and_fill(struct annotation *notes, u64 start, u64 end, struct cyc_hist *ch) { unsigned n_insn; unsigned int cover_insn = 0; u64 offset; n_insn = annotation__count_insn(notes, start, end); if (n_insn && ch->num && ch->cycles) { float ipc...
[ 1, 0 ]
Linux Kernel
tools/perf/util/annotate.c
void annotation__compute_ipc(struct annotation *notes, size_t size) { s64 offset; if (!notes->src || !notes->src->cycles_hist) return; notes->total_insn = annotation__count_insn(notes, 0, size - 1); notes->hit_cycles = 0; notes->hit_insn = 0; notes->cover_insn = 0; mutex_lock(&notes->lock); for ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/annotate.c
int hist_entry__inc_addr_samples(struct hist_entry *he, struct perf_sample *sample, struct evsel *evsel, u64 ip) { return symbol__inc_addr_samples(&he->ms, evsel, ip, sample); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/annotate.c
static int disasm_line__parse(char *line, const char **namep, char **rawp) { char tmp, *name = skip_spaces(line); if (name[0] == '\0') return -1; *rawp = name + 1; while ((*rawp)[0] != '\0' && !isspace((*rawp)[0])) ++*rawp; tmp = (*rawp)[0]; (*rawp)[0] = '\0'; *namep = strdup(name); if (*n...
[ 0, 0 ]
Linux Kernel
tools/perf/util/annotate.c
void disasm_line__free(struct disasm_line *dl) { if (dl->ins.ops && dl->ins.ops->free) dl->ins.ops->free(&dl->ops); else ins__delete(&dl->ops); zfree(&dl->ins.name); annotation_line__exit(&dl->al); free(dl); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/annotate.c
static int symbol__disassemble_bpf_image(struct symbol *sym, struct annotate_args *args) { struct annotation *notes = symbol__annotation(sym); struct disasm_line *dl; args->offset = -1; args->line = strdup("to be implemented"); args->line_nr = 0; args->fileloc = NU...
[ 1, 0 ]