aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/gtk/annotate.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-01-30 14:15:14 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-01-30 14:15:14 -0500
commitd8b91dde38f4c43bd0bbbf17a90f735b16aaff2c (patch)
treebd72dabf6e4b23e060fce429c87e60504f69de54 /tools/perf/ui/gtk/annotate.c
parent5e7481a25e90b661d1dbbba18be3fd3dfe12ec6f (diff)
parente4c1091cb495d9cbec8956d642644a71a1689958 (diff)
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf updates from Ingo Molnar: "Kernel side changes: - Clean up the x86 instruction decoder (Masami Hiramatsu) - Add new uprobes optimization for PUSH instructions on x86 (Yonghong Song) - Add MSR_IA32_THERM_STATUS to the MSR events (Stephane Eranian) - Fix misc bugs, update documentation, plus various cleanups (Jiri Olsa) There's a large number of tooling side improvements: - Intel-PT/BTS improvements (Adrian Hunter) - Numerous 'perf trace' improvements (Arnaldo Carvalho de Melo) - Introduce an errno code to string facility (Hendrik Brueckner) - Various build system improvements (Jiri Olsa) - Add support for CoreSight trace decoding by making the perf tools use the external openCSD (Mathieu Poirier, Tor Jeremiassen) - Add ARM Statistical Profiling Extensions (SPE) support (Kim Phillips) - libtraceevent updates (Steven Rostedt) - Intel vendor event JSON updates (Andi Kleen) - Introduce 'perf report --mmaps' and 'perf report --tasks' to show info present in 'perf.data' (Jiri Olsa, Arnaldo Carvalho de Melo) - Add infrastructure to record first and last sample time to the perf.data file header, so that when processing all samples in a 'perf record' session, such as when doing build-id processing, or when specifically requesting that that info be recorded, use that in 'perf report --time', that also got support for percent slices in addition to absolute ones. I.e. now it is possible to ask for the samples in the 10%-20% time slice of a perf.data file (Jin Yao) - Allow system wide 'perf stat --per-thread', sorting the result (Jin Yao) E.g.: [root@jouet ~]# perf stat --per-thread --metrics IPC ^C Performance counter stats for 'system wide': make-22229 23,012,094,032 inst_retired.any # 0.8 IPC cc1-22419 692,027,497 inst_retired.any # 0.8 IPC gcc-22418 328,231,855 inst_retired.any # 0.9 IPC cc1-22509 220,853,647 inst_retired.any # 0.8 IPC gcc-22486 199,874,810 inst_retired.any # 1.0 IPC as-22466 177,896,365 inst_retired.any # 0.9 IPC cc1-22465 150,732,374 inst_retired.any # 0.8 IPC gcc-22508 112,555,593 inst_retired.any # 0.9 IPC cc1-22487 108,964,079 inst_retired.any # 0.7 IPC qemu-system-x86-2697 21,330,550 inst_retired.any # 0.3 IPC systemd-journal-551 20,642,951 inst_retired.any # 0.4 IPC docker-containe-17651 9,552,892 inst_retired.any # 0.5 IPC dockerd-current-9809 7,528,586 inst_retired.any # 0.5 IPC make-22153 12,504,194,380 inst_retired.any # 0.8 IPC python2-22429 12,081,290,954 inst_retired.any # 0.8 IPC <SNIP> python2-22429 15,026,328,103 cpu_clk_unhalted.thread cc1-22419 826,660,193 cpu_clk_unhalted.thread gcc-22418 365,321,295 cpu_clk_unhalted.thread cc1-22509 279,169,362 cpu_clk_unhalted.thread gcc-22486 210,156,950 cpu_clk_unhalted.thread <SNIP> 5.638075538 seconds time elapsed [root@jouet ~]# - Improve shell auto-completion of perf events (Jin Yao) - 'perf probe' improvements (Masami Hiramatsu) - Improve PMU infrastructure to support amp64's ThunderX2 implementation defined core events (Ganapatrao Kulkarni) - Various annotation related improvements and fixes (Thomas Richter) - Clarify usage of 'overwrite' and 'backward' in the evlist/mmap code, removing the 'overwrite' parameter from several functions as it was always used it as 'false' (Wang Nan) - Fix/improve 'perf record' reverse recording support (Wang Nan) - Improve command line options documentation (Sihyeon Jang) - Optimize sample parsing for ordering events, where we don't need to parse all the PERF_SAMPLE_ bits, just the ones leading to the timestamp needed to reorder events (Jiri Olsa) - Generalize the annotation code to support other source information besides objdump/DWARF obtained ones, starting with python scripts, that will is slated to be merged soon (Jiri Olsa) - ... and a lot more that I failed to list, see the shortlog and changelog for details" * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (262 commits) perf trace beauty flock: Move to separate object file perf evlist: Remove fcntl.h from evlist.h perf trace beauty futex: Beautify FUTEX_BITSET_MATCH_ANY perf trace: Do not print from time delta for interrupted syscall lines perf trace: Add --print-sample perf bpf: Remove misplaced __maybe_unused attribute MAINTAINERS: Adding entry for CoreSight trace decoding perf tools: Add mechanic to synthesise CoreSight trace packets perf tools: Add full support for CoreSight trace decoding pert tools: Add queue management functionality perf tools: Add functionality to communicate with the openCSD decoder perf tools: Add support for decoding CoreSight trace data perf tools: Add decoder mechanic to support dumping trace data perf tools: Add processing of coresight metadata perf tools: Add initial entry point for decoder CoreSight traces perf tools: Integrating the CoreSight decoding library perf vendor events intel: Update IvyTown files to V20 perf vendor events intel: Update IvyBridge files to V20 perf vendor events intel: Update BroadwellDE events to V7 perf vendor events intel: Update SkylakeX events to V1.06 ...
Diffstat (limited to 'tools/perf/ui/gtk/annotate.c')
-rw-r--r--tools/perf/ui/gtk/annotate.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/tools/perf/ui/gtk/annotate.c b/tools/perf/ui/gtk/annotate.c
index fc7a2e105bfd..aeeaf15029f0 100644
--- a/tools/perf/ui/gtk/annotate.c
+++ b/tools/perf/ui/gtk/annotate.c
@@ -31,14 +31,14 @@ static int perf_gtk__get_percent(char *buf, size_t size, struct symbol *sym,
31 31
32 strcpy(buf, ""); 32 strcpy(buf, "");
33 33
34 if (dl->offset == (s64) -1) 34 if (dl->al.offset == (s64) -1)
35 return 0; 35 return 0;
36 36
37 symhist = annotation__histogram(symbol__annotation(sym), evidx); 37 symhist = annotation__histogram(symbol__annotation(sym), evidx);
38 if (!symbol_conf.event_group && !symhist->addr[dl->offset].nr_samples) 38 if (!symbol_conf.event_group && !symhist->addr[dl->al.offset].nr_samples)
39 return 0; 39 return 0;
40 40
41 percent = 100.0 * symhist->addr[dl->offset].nr_samples / symhist->nr_samples; 41 percent = 100.0 * symhist->addr[dl->al.offset].nr_samples / symhist->nr_samples;
42 42
43 markup = perf_gtk__get_percent_color(percent); 43 markup = perf_gtk__get_percent_color(percent);
44 if (markup) 44 if (markup)
@@ -57,16 +57,16 @@ static int perf_gtk__get_offset(char *buf, size_t size, struct symbol *sym,
57 57
58 strcpy(buf, ""); 58 strcpy(buf, "");
59 59
60 if (dl->offset == (s64) -1) 60 if (dl->al.offset == (s64) -1)
61 return 0; 61 return 0;
62 62
63 return scnprintf(buf, size, "%"PRIx64, start + dl->offset); 63 return scnprintf(buf, size, "%"PRIx64, start + dl->al.offset);
64} 64}
65 65
66static int perf_gtk__get_line(char *buf, size_t size, struct disasm_line *dl) 66static int perf_gtk__get_line(char *buf, size_t size, struct disasm_line *dl)
67{ 67{
68 int ret = 0; 68 int ret = 0;
69 char *line = g_markup_escape_text(dl->line, -1); 69 char *line = g_markup_escape_text(dl->al.line, -1);
70 const char *markup = "<span fgcolor='gray'>"; 70 const char *markup = "<span fgcolor='gray'>";
71 71
72 strcpy(buf, ""); 72 strcpy(buf, "");
@@ -74,7 +74,7 @@ static int perf_gtk__get_line(char *buf, size_t size, struct disasm_line *dl)
74 if (!line) 74 if (!line)
75 return 0; 75 return 0;
76 76
77 if (dl->offset != (s64) -1) 77 if (dl->al.offset != (s64) -1)
78 markup = NULL; 78 markup = NULL;
79 79
80 if (markup) 80 if (markup)
@@ -119,7 +119,7 @@ static int perf_gtk__annotate_symbol(GtkWidget *window, struct symbol *sym,
119 gtk_tree_view_set_model(GTK_TREE_VIEW(view), GTK_TREE_MODEL(store)); 119 gtk_tree_view_set_model(GTK_TREE_VIEW(view), GTK_TREE_MODEL(store));
120 g_object_unref(GTK_TREE_MODEL(store)); 120 g_object_unref(GTK_TREE_MODEL(store));
121 121
122 list_for_each_entry(pos, &notes->src->source, node) { 122 list_for_each_entry(pos, &notes->src->source, al.node) {
123 GtkTreeIter iter; 123 GtkTreeIter iter;
124 int ret = 0; 124 int ret = 0;
125 125
@@ -148,8 +148,8 @@ static int perf_gtk__annotate_symbol(GtkWidget *window, struct symbol *sym,
148 148
149 gtk_container_add(GTK_CONTAINER(window), view); 149 gtk_container_add(GTK_CONTAINER(window), view);
150 150
151 list_for_each_entry_safe(pos, n, &notes->src->source, node) { 151 list_for_each_entry_safe(pos, n, &notes->src->source, al.node) {
152 list_del(&pos->node); 152 list_del(&pos->al.node);
153 disasm_line__free(pos); 153 disasm_line__free(pos);
154 } 154 }
155 155
@@ -169,8 +169,7 @@ static int symbol__gtk_annotate(struct symbol *sym, struct map *map,
169 if (map->dso->annotate_warned) 169 if (map->dso->annotate_warned)
170 return -1; 170 return -1;
171 171
172 err = symbol__disassemble(sym, map, perf_evsel__env_arch(evsel), 172 err = symbol__annotate(sym, map, evsel, 0, NULL);
173 0, NULL, NULL);
174 if (err) { 173 if (err) {
175 char msg[BUFSIZ]; 174 char msg[BUFSIZ];
176 symbol__strerror_disassemble(sym, map, err, msg, sizeof(msg)); 175 symbol__strerror_disassemble(sym, map, err, msg, sizeof(msg));
@@ -178,6 +177,8 @@ static int symbol__gtk_annotate(struct symbol *sym, struct map *map,
178 return -1; 177 return -1;
179 } 178 }
180 179
180 symbol__calc_percent(sym, evsel);
181
181 if (perf_gtk__is_active_context(pgctx)) { 182 if (perf_gtk__is_active_context(pgctx)) {
182 window = pgctx->main_window; 183 window = pgctx->main_window;
183 notebook = pgctx->notebook; 184 notebook = pgctx->notebook;