45 ret += scnprintf(buf, size,
"%s", markup);
46 ret += scnprintf(buf + ret, size - ret,
"%6.2f%%", percent);
48 ret += scnprintf(buf + ret, size - ret,
"</span>");
63 return scnprintf(buf, size,
"%"PRIx64, start + dl->
al.
offset);
69 char *line = g_markup_escape_text(dl->
al.
line, -1);
70 const char *markup =
"<span fgcolor='gray'>";
81 ret += scnprintf(buf, size,
"%s", markup);
82 ret += scnprintf(buf + ret, size - ret,
"%s", line);
84 ret += scnprintf(buf + ret, size - ret,
"</span>");
97 GtkCellRenderer *renderer;
106 col_types[i] = G_TYPE_STRING;
108 store = gtk_list_store_newv(MAX_ANN_COLS, col_types);
110 view = gtk_tree_view_new();
111 renderer = gtk_cell_renderer_text_new();
114 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view),
119 gtk_tree_view_set_model(GTK_TREE_VIEW(view), GTK_TREE_MODEL(store));
120 g_object_unref(GTK_TREE_MODEL(store));
122 list_for_each_entry(pos, ¬es->
src->
source, al.node) {
126 gtk_list_store_append(store, &iter);
134 ret += scnprintf(s + ret,
sizeof(s) - ret,
" ");
149 gtk_container_add(GTK_CONTAINER(window), view);
151 list_for_each_entry_safe(pos, n, ¬es->
src->
source, al.node) {
165 GtkWidget *scrolled_window;
166 GtkWidget *tab_label;
196 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
197 gtk_window_set_title(GTK_WINDOW(window),
"perf annotate");
199 g_signal_connect(window,
"delete_event", gtk_main_quit, NULL);
205 vbox = gtk_vbox_new(FALSE, 0);
206 notebook = gtk_notebook_new();
209 gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
213 gtk_box_pack_start(GTK_BOX(vbox), infobar,
218 gtk_box_pack_start(GTK_BOX(vbox), statbar, FALSE, FALSE, 0);
220 gtk_container_add(GTK_CONTAINER(window), vbox);
223 scrolled_window = gtk_scrolled_window_new(NULL, NULL);
224 tab_label = gtk_label_new(sym->
name);
226 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window),
227 GTK_POLICY_AUTOMATIC,
228 GTK_POLICY_AUTOMATIC);
230 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scrolled_window,
252 gtk_widget_show_all(window);
255 gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
int perf_gtk__deactivate_context(struct perf_gtk_context **ctx)
void symbol__calc_percent(struct symbol *sym, struct perf_evsel *evsel)
static int perf_gtk__get_line(char *buf, size_t size, struct disasm_line *dl)
int ui__error(const char *format,...)
static const char *const col_names[]
int hist_entry__gtk_annotate(struct hist_entry *he, struct perf_evsel *evsel, struct hist_browser_timer *hbt)
static GtkWidget * perf_gtk__setup_info_bar(void)
struct annotation_line al
int symbol__strerror_disassemble(struct symbol *sym __maybe_unused, struct map *map, int errnum, char *buf, size_t buflen)
void perf_gtk__show_annotations(void)
static struct sym_hist * annotation__histogram(struct annotation *notes, int idx)
static int perf_gtk__get_percent(char *buf, size_t size, struct symbol *sym, struct disasm_line *dl, int evidx)
void perf_gtk__signal(int sig)
struct sym_hist_entry addr[0]
static struct annotation * symbol__annotation(struct symbol *sym)
u64 map__rip_2objdump(struct map *map, u64 rip)
struct perf_gtk_context * perf_gtk__activate_context(GtkWidget *window)
struct annotation_options annotation__default_options
GtkWidget * perf_gtk__setup_statusbar(void)
struct annotated_source * src
static int sym(yyscan_t scanner, int type, int config)
const char * perf_gtk__get_percent_color(double percent)
static int perf_gtk__annotate_symbol(GtkWidget *window, struct symbol *sym, struct map *map, struct perf_evsel *evsel, struct hist_browser_timer *hbt __maybe_unused)
static double percent(int st, int tot)
struct perf_gtk_context * pgctx
static bool perf_evsel__is_group_event(struct perf_evsel *evsel)
static bool perf_gtk__is_active_context(struct perf_gtk_context *ctx)
static int perf_gtk__get_offset(char *buf, size_t size, struct symbol *sym, struct map *map, struct disasm_line *dl)
void disasm_line__free(struct disasm_line *dl)
void perf_gtk__resize_window(GtkWidget *window)
int symbol__annotate(struct symbol *sym, struct map *map, struct perf_evsel *evsel, size_t privsize, struct annotation_options *options, struct arch **parch)
static int symbol__gtk_annotate(struct symbol *sym, struct map *map, struct perf_evsel *evsel, struct hist_browser_timer *hbt)
def store(time, event, cpu, thread, val, ena, run)