Hello,
This is to support interactive TUI browser for type annotation.
Like the normal (code) annotation, it should be able to display the data type
annotation. Now `perf annotate --data-type` will show the result in TUI by
default if it's enabled. Also `perf report -s type` can show the same output
using a menu item.
It's still in a very early stage and supports the basic functionalities only.
I'll work on more features like in the normal annotation browser later.
The code is also available at 'perf/annotate-data-tui-v1' branch at
git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git
Thanks,
Namhyung
Namhyung Kim (6):
perf annotate: Show progress of sample processing
perf annotate-data: Add hist_entry__annotate_data_tty()
perf annotate-data: Add hist_entry__annotate_data_tui()
perf annotate-data: Support event group display in TUI
perf report: Add a menu item to annotate data type in TUI
perf report: Do not collect sample histogram unnecessarily
tools/perf/builtin-annotate.c | 149 ++++--------
tools/perf/builtin-report.c | 7 +-
tools/perf/ui/browsers/Build | 1 +
tools/perf/ui/browsers/annotate-data.c | 312 +++++++++++++++++++++++++
tools/perf/ui/browsers/hists.c | 31 +++
tools/perf/util/annotate-data.c | 113 +++++++++
tools/perf/util/annotate-data.h | 6 +
tools/perf/util/annotate.c | 7 +
8 files changed, 515 insertions(+), 111 deletions(-)
create mode 100644 tools/perf/ui/browsers/annotate-data.c
base-commit: 9c3e9af74326978ba6f4432bb038e6c80f4f56fd
--
2.44.0.478.gd926399ef9-goog
Like perf report, it can take a while to process samples. Show the
progress window to inform users how long it'll take.
Signed-off-by: Namhyung Kim <[email protected]>
---
tools/perf/builtin-annotate.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 16e1581207c9..332e1ddcacbd 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -37,6 +37,7 @@
#include "util/map_symbol.h"
#include "util/branch.h"
#include "util/util.h"
+#include "ui/progress.h"
#include <dlfcn.h>
#include <errno.h>
@@ -665,13 +666,23 @@ static int __cmd_annotate(struct perf_annotate *ann)
evlist__for_each_entry(session->evlist, pos) {
struct hists *hists = evsel__hists(pos);
u32 nr_samples = hists->stats.nr_samples;
+ struct ui_progress prog;
if (nr_samples > 0) {
total_nr_samples += nr_samples;
- hists__collapse_resort(hists, NULL);
+
+ ui_progress__init(&prog, nr_samples,
+ "Merging related events...");
+ hists__collapse_resort(hists, &prog);
+ ui_progress__finish();
+
/* Don't sort callchain */
evsel__reset_sample_bit(pos, CALLCHAIN);
- evsel__output_resort(pos, NULL);
+
+ ui_progress__init(&prog, nr_samples,
+ "Sorting events for output...");
+ evsel__output_resort(pos, &prog);
+ ui_progress__finish();
/*
* An event group needs to display other events too.
--
2.44.0.478.gd926399ef9-goog
And move the related code into util/annotate-data.c file.
Signed-off-by: Namhyung Kim <[email protected]>
---
tools/perf/builtin-annotate.c | 106 +-----------------------------
tools/perf/util/annotate-data.c | 110 ++++++++++++++++++++++++++++++++
tools/perf/util/annotate-data.h | 3 +
3 files changed, 114 insertions(+), 105 deletions(-)
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 332e1ddcacbd..0812664faa54 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -329,108 +329,6 @@ static int hist_entry__tty_annotate(struct hist_entry *he,
return symbol__tty_annotate2(&he->ms, evsel);
}
-static void print_annotated_data_header(struct hist_entry *he, struct evsel *evsel)
-{
- struct dso *dso = map__dso(he->ms.map);
- int nr_members = 1;
- int nr_samples = he->stat.nr_events;
- int width = 7;
- const char *val_hdr = "Percent";
-
- if (evsel__is_group_event(evsel)) {
- struct hist_entry *pair;
-
- list_for_each_entry(pair, &he->pairs.head, pairs.node)
- nr_samples += pair->stat.nr_events;
- }
-
- printf("Annotate type: '%s' in %s (%d samples):\n",
- he->mem_type->self.type_name, dso->name, nr_samples);
-
- if (evsel__is_group_event(evsel)) {
- struct evsel *pos;
- int i = 0;
-
- for_each_group_evsel(pos, evsel)
- printf(" event[%d] = %s\n", i++, pos->name);
-
- nr_members = evsel->core.nr_members;
- }
-
- if (symbol_conf.show_total_period) {
- width = 11;
- val_hdr = "Period";
- } else if (symbol_conf.show_nr_samples) {
- width = 7;
- val_hdr = "Samples";
- }
-
- printf("============================================================================\n");
- printf("%*s %10s %10s %s\n", (width + 1) * nr_members, val_hdr,
- "offset", "size", "field");
-}
-
-static void print_annotated_data_value(struct type_hist *h, u64 period, int nr_samples)
-{
- double percent = h->period ? (100.0 * period / h->period) : 0;
- const char *color = get_percent_color(percent);
-
- if (symbol_conf.show_total_period)
- color_fprintf(stdout, color, " %11" PRIu64, period);
- else if (symbol_conf.show_nr_samples)
- color_fprintf(stdout, color, " %7d", nr_samples);
- else
- color_fprintf(stdout, color, " %7.2f", percent);
-}
-
-static void print_annotated_data_type(struct annotated_data_type *mem_type,
- struct annotated_member *member,
- struct evsel *evsel, int indent)
-{
- struct annotated_member *child;
- struct type_hist *h = mem_type->histograms[evsel->core.idx];
- int i, nr_events = 1, samples = 0;
- u64 period = 0;
- int width = symbol_conf.show_total_period ? 11 : 7;
-
- for (i = 0; i < member->size; i++) {
- samples += h->addr[member->offset + i].nr_samples;
- period += h->addr[member->offset + i].period;
- }
- print_annotated_data_value(h, period, samples);
-
- if (evsel__is_group_event(evsel)) {
- struct evsel *pos;
-
- for_each_group_member(pos, evsel) {
- h = mem_type->histograms[pos->core.idx];
-
- samples = 0;
- period = 0;
- for (i = 0; i < member->size; i++) {
- samples += h->addr[member->offset + i].nr_samples;
- period += h->addr[member->offset + i].period;
- }
- print_annotated_data_value(h, period, samples);
- }
- nr_events = evsel->core.nr_members;
- }
-
- printf(" %10d %10d %*s%s\t%s",
- member->offset, member->size, indent, "", member->type_name,
- member->var_name ?: "");
-
- if (!list_empty(&member->children))
- printf(" {\n");
-
- list_for_each_entry(child, &member->children, node)
- print_annotated_data_type(mem_type, child, evsel, indent + 4);
-
- if (!list_empty(&member->children))
- printf("%*s}", (width + 1) * nr_events + 24 + indent, "");
- printf(";\n");
-}
-
static void print_annotate_data_stat(struct annotated_data_stat *s)
{
#define PRINT_STAT(fld) if (s->fld) printf("%10d : %s\n", s->fld, #fld)
@@ -571,9 +469,7 @@ static void hists__find_annotations(struct hists *hists,
goto find_next;
}
- print_annotated_data_header(he, evsel);
- print_annotated_data_type(he->mem_type, &he->mem_type->self, evsel, 0);
- printf("\n");
+ hist_entry__annotate_data_tty(he, evsel);
goto find_next;
}
diff --git a/tools/perf/util/annotate-data.c b/tools/perf/util/annotate-data.c
index b69a1cd1577a..99c5dcdfc9df 100644
--- a/tools/perf/util/annotate-data.c
+++ b/tools/perf/util/annotate-data.c
@@ -19,6 +19,7 @@
#include "evlist.h"
#include "map.h"
#include "map_symbol.h"
+#include "sort.h"
#include "strbuf.h"
#include "symbol.h"
#include "symbol_conf.h"
@@ -1710,3 +1711,112 @@ int annotated_data_type__update_samples(struct annotated_data_type *adt,
h->addr[offset].period += period;
return 0;
}
+
+static void print_annotated_data_header(struct hist_entry *he, struct evsel *evsel)
+{
+ struct dso *dso = map__dso(he->ms.map);
+ int nr_members = 1;
+ int nr_samples = he->stat.nr_events;
+ int width = 7;
+ const char *val_hdr = "Percent";
+
+ if (evsel__is_group_event(evsel)) {
+ struct hist_entry *pair;
+
+ list_for_each_entry(pair, &he->pairs.head, pairs.node)
+ nr_samples += pair->stat.nr_events;
+ }
+
+ printf("Annotate type: '%s' in %s (%d samples):\n",
+ he->mem_type->self.type_name, dso->name, nr_samples);
+
+ if (evsel__is_group_event(evsel)) {
+ struct evsel *pos;
+ int i = 0;
+
+ for_each_group_evsel(pos, evsel)
+ printf(" event[%d] = %s\n", i++, pos->name);
+
+ nr_members = evsel->core.nr_members;
+ }
+
+ if (symbol_conf.show_total_period) {
+ width = 11;
+ val_hdr = "Period";
+ } else if (symbol_conf.show_nr_samples) {
+ width = 7;
+ val_hdr = "Samples";
+ }
+
+ printf("============================================================================\n");
+ printf("%*s %10s %10s %s\n", (width + 1) * nr_members, val_hdr,
+ "offset", "size", "field");
+}
+
+static void print_annotated_data_value(struct type_hist *h, u64 period, int nr_samples)
+{
+ double percent = h->period ? (100.0 * period / h->period) : 0;
+ const char *color = get_percent_color(percent);
+
+ if (symbol_conf.show_total_period)
+ color_fprintf(stdout, color, " %11" PRIu64, period);
+ else if (symbol_conf.show_nr_samples)
+ color_fprintf(stdout, color, " %7d", nr_samples);
+ else
+ color_fprintf(stdout, color, " %7.2f", percent);
+}
+
+static void print_annotated_data_type(struct annotated_data_type *mem_type,
+ struct annotated_member *member,
+ struct evsel *evsel, int indent)
+{
+ struct annotated_member *child;
+ struct type_hist *h = mem_type->histograms[evsel->core.idx];
+ int i, nr_events = 1, samples = 0;
+ u64 period = 0;
+ int width = symbol_conf.show_total_period ? 11 : 7;
+
+ for (i = 0; i < member->size; i++) {
+ samples += h->addr[member->offset + i].nr_samples;
+ period += h->addr[member->offset + i].period;
+ }
+ print_annotated_data_value(h, period, samples);
+
+ if (evsel__is_group_event(evsel)) {
+ struct evsel *pos;
+
+ for_each_group_member(pos, evsel) {
+ h = mem_type->histograms[pos->core.idx];
+
+ samples = 0;
+ period = 0;
+ for (i = 0; i < member->size; i++) {
+ samples += h->addr[member->offset + i].nr_samples;
+ period += h->addr[member->offset + i].period;
+ }
+ print_annotated_data_value(h, period, samples);
+ }
+ nr_events = evsel->core.nr_members;
+ }
+
+ printf(" %10d %10d %*s%s\t%s",
+ member->offset, member->size, indent, "", member->type_name,
+ member->var_name ?: "");
+
+ if (!list_empty(&member->children))
+ printf(" {\n");
+
+ list_for_each_entry(child, &member->children, node)
+ print_annotated_data_type(mem_type, child, evsel, indent + 4);
+
+ if (!list_empty(&member->children))
+ printf("%*s}", (width + 1) * nr_events + 24 + indent, "");
+ printf(";\n");
+}
+
+void hist_entry__annotate_data_tty(struct hist_entry *he, struct evsel *evsel)
+{
+ print_annotated_data_header(he, evsel);
+ print_annotated_data_type(he->mem_type, &he->mem_type->self, evsel, 0);
+ printf("\n");
+}
diff --git a/tools/perf/util/annotate-data.h b/tools/perf/util/annotate-data.h
index fe1e53d6e8c7..037e2622b7a3 100644
--- a/tools/perf/util/annotate-data.h
+++ b/tools/perf/util/annotate-data.h
@@ -10,6 +10,7 @@
struct annotated_op_loc;
struct debuginfo;
struct evsel;
+struct hist_entry;
struct map_symbol;
struct thread;
@@ -140,6 +141,8 @@ struct annotated_data_stat {
};
extern struct annotated_data_stat ann_data_stat;
+void hist_entry__annotate_data_tty(struct hist_entry *he, struct evsel *evsel);
+
#ifdef HAVE_DWARF_SUPPORT
/* Returns data type at the location (ip, reg, offset) */
--
2.44.0.478.gd926399ef9-goog
Support data type profiling output on TUI.
Signed-off-by: Namhyung Kim <[email protected]>
---
tools/perf/builtin-annotate.c | 30 ++-
tools/perf/ui/browsers/Build | 1 +
tools/perf/ui/browsers/annotate-data.c | 282 +++++++++++++++++++++++++
tools/perf/util/annotate-data.c | 5 +-
tools/perf/util/annotate-data.h | 5 +-
5 files changed, 317 insertions(+), 6 deletions(-)
create mode 100644 tools/perf/ui/browsers/annotate-data.c
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 0812664faa54..6f7104f06c42 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -469,8 +469,32 @@ static void hists__find_annotations(struct hists *hists,
goto find_next;
}
- hist_entry__annotate_data_tty(he, evsel);
- goto find_next;
+ if (use_browser == 1)
+ key = hist_entry__annotate_data_tui(he, evsel, NULL);
+ else
+ key = hist_entry__annotate_data_tty(he, evsel);
+
+ 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 (next != NULL)
+ nd = next;
+
+ continue;
}
if (use_browser == 2) {
@@ -873,9 +897,7 @@ int cmd_annotate(int argc, const char **argv)
use_browser = 2;
#endif
- /* FIXME: only support stdio for now */
if (annotate.data_type) {
- use_browser = 0;
annotate_opts.annotate_src = false;
symbol_conf.annotate_data_member = true;
symbol_conf.annotate_data_sample = true;
diff --git a/tools/perf/ui/browsers/Build b/tools/perf/ui/browsers/Build
index 7a1d5ddaf688..2608b5da3167 100644
--- a/tools/perf/ui/browsers/Build
+++ b/tools/perf/ui/browsers/Build
@@ -1,4 +1,5 @@
perf-y += annotate.o
+perf-y += annotate-data.o
perf-y += hists.o
perf-y += map.o
perf-y += scripts.o
diff --git a/tools/perf/ui/browsers/annotate-data.c b/tools/perf/ui/browsers/annotate-data.c
new file mode 100644
index 000000000000..fefacaaf16db
--- /dev/null
+++ b/tools/perf/ui/browsers/annotate-data.c
@@ -0,0 +1,282 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <inttypes.h>
+#include <string.h>
+#include <sys/ttydefaults.h>
+
+#include "ui/browser.h"
+#include "ui/helpline.h"
+#include "ui/keysyms.h"
+#include "ui/ui.h"
+#include "util/annotate.h"
+#include "util/annotate-data.h"
+#include "util/evsel.h"
+#include "util/sort.h"
+
+struct annotated_data_browser {
+ struct ui_browser b;
+ struct list_head entries;
+};
+
+struct browser_entry {
+ struct list_head node;
+ struct annotated_member *data;
+ struct type_hist_entry hists;
+ int indent;
+};
+
+static void update_hist_entry(struct type_hist_entry *dst,
+ struct type_hist_entry *src)
+{
+ dst->nr_samples += src->nr_samples;
+ dst->period += src->period;
+}
+
+static int get_member_overhead(struct annotated_data_type *adt,
+ struct browser_entry *entry,
+ struct evsel *evsel)
+{
+ struct annotated_member *member = entry->data;
+ int i;
+
+ for (i = 0; i < member->size; i++) {
+ struct type_hist *h;
+ int offset = member->offset + i;
+
+ h = adt->histograms[evsel->core.idx];
+ update_hist_entry(&entry->hists, &h->addr[offset]);
+ }
+ return 0;
+}
+
+static int add_child_entries(struct annotated_data_browser *browser,
+ struct annotated_data_type *adt,
+ struct annotated_member *member,
+ struct evsel *evsel, int indent)
+{
+ struct annotated_member *pos;
+ struct browser_entry *entry;
+ int nr_entries = 0;
+
+ entry = zalloc(sizeof(*entry));
+ if (entry == NULL)
+ return -1;
+
+ entry->data = member;
+ entry->indent = indent;
+ if (get_member_overhead(adt, entry, evsel) < 0) {
+ free(entry);
+ return -1;
+ }
+
+ list_add_tail(&entry->node, &browser->entries);
+ nr_entries++;
+
+ list_for_each_entry(pos, &member->children, node) {
+ int nr = add_child_entries(browser, adt, pos, evsel, indent + 1);
+
+ if (nr < 0)
+ return nr;
+
+ nr_entries += nr;
+ }
+
+ /* add an entry for the closing bracket ("}") */
+ if (!list_empty(&member->children)) {
+ entry = zalloc(sizeof(*entry));
+ if (entry == NULL)
+ return -1;
+
+ entry->indent = indent;
+ list_add_tail(&entry->node, &browser->entries);
+ nr_entries++;
+ }
+
+ return nr_entries;
+}
+
+static int annotated_data_browser__collect_entries(struct annotated_data_browser *browser)
+{
+ struct hist_entry *he = browser->b.priv;
+ struct annotated_data_type *adt = he->mem_type;
+ struct evsel *evsel = hists_to_evsel(he->hists);
+
+ INIT_LIST_HEAD(&browser->entries);
+ browser->b.entries = &browser->entries;
+ browser->b.nr_entries = add_child_entries(browser, adt, &adt->self,
+ evsel, /*indent=*/0);
+ return 0;
+}
+
+static void annotated_data_browser__delete_entries(struct annotated_data_browser *browser)
+{
+ struct browser_entry *pos, *tmp;
+
+ list_for_each_entry_safe(pos, tmp, &browser->entries, node) {
+ list_del_init(&pos->node);
+ free(pos);
+ }
+}
+
+static unsigned int browser__refresh(struct ui_browser *uib)
+{
+ return ui_browser__list_head_refresh(uib);
+}
+
+static int browser__show(struct ui_browser *uib)
+{
+ struct hist_entry *he = uib->priv;
+ struct annotated_data_type *adt = he->mem_type;
+ const char *help = "Press 'h' for help on key bindings";
+ char title[256];
+
+ snprintf(title, sizeof(title), "Annotate type: '%s' (%d samples)",
+ adt->self.type_name, he->stat.nr_events);
+
+ if (ui_browser__show(uib, title, help) < 0)
+ return -1;
+
+ /* second line header */
+ ui_browser__gotorc_title(uib, 0, 0);
+ ui_browser__set_color(uib, HE_COLORSET_ROOT);
+
+ if (symbol_conf.show_total_period)
+ strcpy(title, "Period");
+ else if (symbol_conf.show_nr_samples)
+ strcpy(title, "Samples");
+ else
+ strcpy(title, "Percent");
+
+ ui_browser__printf(uib, " %10s %10s %10s %s",
+ title, "Offset", "Size", "Field");
+ ui_browser__write_nstring(uib, "", uib->width);
+ return 0;
+}
+
+static void browser__write_overhead(struct ui_browser *uib,
+ struct type_hist *total,
+ struct type_hist_entry *hist, int row)
+{
+ u64 period = hist->period;
+ double percent = total->period ? (100.0 * period / total->period) : 0;
+ bool current = ui_browser__is_current_entry(uib, row);
+ int nr_samples = 0;
+
+ ui_browser__set_percent_color(uib, percent, current);
+
+ if (symbol_conf.show_total_period)
+ ui_browser__printf(uib, " %10" PRIu64, period);
+ else if (symbol_conf.show_nr_samples)
+ ui_browser__printf(uib, " %10d", nr_samples);
+ else
+ ui_browser__printf(uib, " %10.2f", percent);
+
+ ui_browser__set_percent_color(uib, 0, current);
+}
+
+static void browser__write(struct ui_browser *uib, void *entry, int row)
+{
+ struct browser_entry *be = entry;
+ struct annotated_member *member = be->data;
+ struct hist_entry *he = uib->priv;
+ struct annotated_data_type *adt = he->mem_type;
+ struct evsel *evsel = hists_to_evsel(he->hists);
+
+ if (member == NULL) {
+ bool current = ui_browser__is_current_entry(uib, row);
+
+ /* print the closing bracket */
+ ui_browser__set_percent_color(uib, 0, current);
+ ui_browser__write_nstring(uib, "", 11);
+ ui_browser__printf(uib, " %10s %10s %*s};",
+ "", "", be->indent * 4, "");
+ ui_browser__write_nstring(uib, "", uib->width);
+ return;
+ }
+
+ /* print the number */
+ browser__write_overhead(uib, adt->histograms[evsel->core.idx],
+ &be->hists, row);
+
+ /* print type info */
+ if (be->indent == 0 && !member->var_name) {
+ ui_browser__printf(uib, " %10d %10d %s%s",
+ member->offset, member->size,
+ member->type_name,
+ list_empty(&member->children) ? ";" : " {");
+ } else {
+ ui_browser__printf(uib, " %10d %10d %*s%s\t%s%s",
+ member->offset, member->size,
+ be->indent * 4, "", member->type_name,
+ member->var_name ?: "",
+ list_empty(&member->children) ? ";" : " {");
+ }
+ /* fill the rest */
+ ui_browser__write_nstring(uib, "", uib->width);
+}
+
+static int annotated_data_browser__run(struct annotated_data_browser *browser,
+ struct evsel *evsel __maybe_unused,
+ struct hist_browser_timer *hbt)
+{
+ int delay_secs = hbt ? hbt->refresh : 0;
+ int key;
+
+ if (browser__show(&browser->b) < 0)
+ return -1;
+
+ while (1) {
+ key = ui_browser__run(&browser->b, delay_secs);
+
+ switch (key) {
+ case K_TIMER:
+ if (hbt)
+ hbt->timer(hbt->arg);
+ continue;
+ case K_F1:
+ case 'h':
+ ui_browser__help_window(&browser->b,
+ "UP/DOWN/PGUP\n"
+ "PGDN/SPACE Navigate\n"
+ "</> Move to prev/next symbol\n"
+ "q/ESC/CTRL+C Exit\n\n");
+ continue;
+ case K_LEFT:
+ case '<':
+ case '>':
+ case K_ESC:
+ case 'q':
+ case CTRL('c'):
+ goto out;
+ default:
+ continue;
+ }
+ }
+out:
+ ui_browser__hide(&browser->b);
+ return key;
+}
+
+int hist_entry__annotate_data_tui(struct hist_entry *he, struct evsel *evsel,
+ struct hist_browser_timer *hbt)
+{
+ struct annotated_data_browser browser = {
+ .b = {
+ .refresh = browser__refresh,
+ .seek = ui_browser__list_head_seek,
+ .write = browser__write,
+ .priv = he,
+ .extra_title_lines = 1,
+ },
+ };
+ int ret;
+
+ ui_helpline__push("Press ESC to exit");
+
+ ret = annotated_data_browser__collect_entries(&browser);
+ if (ret == 0)
+ ret = annotated_data_browser__run(&browser, evsel, hbt);
+
+ annotated_data_browser__delete_entries(&browser);
+
+ return ret;
+}
diff --git a/tools/perf/util/annotate-data.c b/tools/perf/util/annotate-data.c
index 99c5dcdfc9df..1cd857400038 100644
--- a/tools/perf/util/annotate-data.c
+++ b/tools/perf/util/annotate-data.c
@@ -1814,9 +1814,12 @@ static void print_annotated_data_type(struct annotated_data_type *mem_type,
printf(";\n");
}
-void hist_entry__annotate_data_tty(struct hist_entry *he, struct evsel *evsel)
+int hist_entry__annotate_data_tty(struct hist_entry *he, struct evsel *evsel)
{
print_annotated_data_header(he, evsel);
print_annotated_data_type(he->mem_type, &he->mem_type->self, evsel, 0);
printf("\n");
+
+ /* move to the next entry */
+ return '>';
}
diff --git a/tools/perf/util/annotate-data.h b/tools/perf/util/annotate-data.h
index 037e2622b7a3..9a6d9b519724 100644
--- a/tools/perf/util/annotate-data.h
+++ b/tools/perf/util/annotate-data.h
@@ -11,6 +11,7 @@ struct annotated_op_loc;
struct debuginfo;
struct evsel;
struct hist_entry;
+struct hist_browser_timer;
struct map_symbol;
struct thread;
@@ -141,7 +142,9 @@ struct annotated_data_stat {
};
extern struct annotated_data_stat ann_data_stat;
-void hist_entry__annotate_data_tty(struct hist_entry *he, struct evsel *evsel);
+int hist_entry__annotate_data_tty(struct hist_entry *he, struct evsel *evsel);
+int hist_entry__annotate_data_tui(struct hist_entry *he, struct evsel *evsel,
+ struct hist_browser_timer *hbt);
#ifdef HAVE_DWARF_SUPPORT
--
2.44.0.478.gd926399ef9-goog
Like in stdio, it should print all events in a group together.
Signed-off-by: Namhyung Kim <[email protected]>
---
tools/perf/ui/browsers/annotate-data.c | 50 ++++++++++++++++++++------
1 file changed, 40 insertions(+), 10 deletions(-)
diff --git a/tools/perf/ui/browsers/annotate-data.c b/tools/perf/ui/browsers/annotate-data.c
index fefacaaf16db..a4a0f042f201 100644
--- a/tools/perf/ui/browsers/annotate-data.c
+++ b/tools/perf/ui/browsers/annotate-data.c
@@ -10,20 +10,27 @@
#include "util/annotate.h"
#include "util/annotate-data.h"
#include "util/evsel.h"
+#include "util/evlist.h"
#include "util/sort.h"
struct annotated_data_browser {
struct ui_browser b;
struct list_head entries;
+ int nr_events;
};
struct browser_entry {
struct list_head node;
struct annotated_member *data;
- struct type_hist_entry hists;
+ struct type_hist_entry *hists;
int indent;
};
+static struct annotated_data_browser *get_browser(struct ui_browser *uib)
+{
+ return container_of(uib, struct annotated_data_browser, b);
+}
+
static void update_hist_entry(struct type_hist_entry *dst,
struct type_hist_entry *src)
{
@@ -33,17 +40,21 @@ static void update_hist_entry(struct type_hist_entry *dst,
static int get_member_overhead(struct annotated_data_type *adt,
struct browser_entry *entry,
- struct evsel *evsel)
+ struct evsel *leader)
{
struct annotated_member *member = entry->data;
- int i;
+ int i, k;
for (i = 0; i < member->size; i++) {
struct type_hist *h;
+ struct evsel *evsel;
int offset = member->offset + i;
- h = adt->histograms[evsel->core.idx];
- update_hist_entry(&entry->hists, &h->addr[offset]);
+ for_each_group_evsel(evsel, leader) {
+ h = adt->histograms[evsel->core.idx];
+ k = evsel__group_idx(evsel);
+ update_hist_entry(&entry->hists[k], &h->addr[offset]);
+ }
}
return 0;
}
@@ -61,6 +72,12 @@ static int add_child_entries(struct annotated_data_browser *browser,
if (entry == NULL)
return -1;
+ entry->hists = calloc(browser->nr_events, sizeof(*entry->hists));
+ if (entry->hists == NULL) {
+ free(entry);
+ return -1;
+ }
+
entry->data = member;
entry->indent = indent;
if (get_member_overhead(adt, entry, evsel) < 0) {
@@ -113,6 +130,7 @@ static void annotated_data_browser__delete_entries(struct annotated_data_browser
list_for_each_entry_safe(pos, tmp, &browser->entries, node) {
list_del_init(&pos->node);
+ free(pos->hists);
free(pos);
}
}
@@ -126,6 +144,7 @@ static int browser__show(struct ui_browser *uib)
{
struct hist_entry *he = uib->priv;
struct annotated_data_type *adt = he->mem_type;
+ struct annotated_data_browser *browser = get_browser(uib);
const char *help = "Press 'h' for help on key bindings";
char title[256];
@@ -146,7 +165,8 @@ static int browser__show(struct ui_browser *uib)
else
strcpy(title, "Percent");
- ui_browser__printf(uib, " %10s %10s %10s %s",
+ ui_browser__printf(uib, "%*s %10s %10s %10s %s",
+ 11 * (browser->nr_events - 1), "",
title, "Offset", "Size", "Field");
ui_browser__write_nstring(uib, "", uib->width);
return 0;
@@ -175,18 +195,20 @@ static void browser__write_overhead(struct ui_browser *uib,
static void browser__write(struct ui_browser *uib, void *entry, int row)
{
+ struct annotated_data_browser *browser = get_browser(uib);
struct browser_entry *be = entry;
struct annotated_member *member = be->data;
struct hist_entry *he = uib->priv;
struct annotated_data_type *adt = he->mem_type;
- struct evsel *evsel = hists_to_evsel(he->hists);
+ struct evsel *leader = hists_to_evsel(he->hists);
+ struct evsel *evsel;
if (member == NULL) {
bool current = ui_browser__is_current_entry(uib, row);
/* print the closing bracket */
ui_browser__set_percent_color(uib, 0, current);
- ui_browser__write_nstring(uib, "", 11);
+ ui_browser__write_nstring(uib, "", 11 * browser->nr_events);
ui_browser__printf(uib, " %10s %10s %*s};",
"", "", be->indent * 4, "");
ui_browser__write_nstring(uib, "", uib->width);
@@ -194,8 +216,12 @@ static void browser__write(struct ui_browser *uib, void *entry, int row)
}
/* print the number */
- browser__write_overhead(uib, adt->histograms[evsel->core.idx],
- &be->hists, row);
+ for_each_group_evsel(evsel, leader) {
+ struct type_hist *h = adt->histograms[evsel->core.idx];
+ int idx = evsel__group_idx(evsel);
+
+ browser__write_overhead(uib, h, &be->hists[idx], row);
+ }
/* print type info */
if (be->indent == 0 && !member->var_name) {
@@ -267,11 +293,15 @@ int hist_entry__annotate_data_tui(struct hist_entry *he, struct evsel *evsel,
.priv = he,
.extra_title_lines = 1,
},
+ .nr_events = 1,
};
int ret;
ui_helpline__push("Press ESC to exit");
+ if (evsel__is_group_event(evsel))
+ browser.nr_events = evsel->core.nr_members;
+
ret = annotated_data_browser__collect_entries(&browser);
if (ret == 0)
ret = annotated_data_browser__run(&browser, evsel, hbt);
--
2.44.0.478.gd926399ef9-goog
When the hist entry has the type info, it should be able to display the
annotation browser for the type like in `perf annotate --data-type`.
Signed-off-by: Namhyung Kim <[email protected]>
---
tools/perf/builtin-report.c | 5 +++++
tools/perf/ui/browsers/hists.c | 31 +++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index dcd93ee5fc24..aaa6427a1224 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -1694,6 +1694,11 @@ int cmd_report(int argc, const char **argv)
else
use_browser = 0;
+ if (report.data_type && use_browser == 1) {
+ symbol_conf.annotate_data_member = true;
+ symbol_conf.annotate_data_sample = true;
+ }
+
if (sort_order && strstr(sort_order, "ipc")) {
parse_options_usage(report_usage, options, "s", 1);
goto error;
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 0c02b3a8e121..71b32591d61a 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -38,6 +38,7 @@
#include "../ui.h"
#include "map.h"
#include "annotate.h"
+#include "annotate-data.h"
#include "srcline.h"
#include "string2.h"
#include "units.h"
@@ -2505,6 +2506,32 @@ add_annotate_opt(struct hist_browser *browser __maybe_unused,
return 1;
}
+static int
+do_annotate_type(struct hist_browser *browser, struct popup_action *act)
+{
+ struct hist_entry *he = browser->he_selection;
+
+ hist_entry__annotate_data_tui(he, act->evsel, browser->hbt);
+ ui_browser__handle_resize(&browser->b);
+ return 0;
+}
+
+static int
+add_annotate_type_opt(struct hist_browser *browser,
+ struct popup_action *act, char **optstr,
+ struct hist_entry *he)
+{
+ if (he == NULL || he->mem_type == NULL || he->mem_type->histograms == NULL)
+ return 0;
+
+ if (asprintf(optstr, "Annotate type %s", he->mem_type->self.type_name) < 0)
+ return 0;
+
+ act->evsel = hists_to_evsel(browser->hists);
+ act->fn = do_annotate_type;
+ return 1;
+}
+
static int
do_zoom_thread(struct hist_browser *browser, struct popup_action *act)
{
@@ -3307,6 +3334,10 @@ static int evsel__hists_browse(struct evsel *evsel, int nr_events, const char *h
browser->he_selection->ip);
}
skip_annotation:
+ nr_options += add_annotate_type_opt(browser,
+ &actions[nr_options],
+ &options[nr_options],
+ browser->he_selection);
nr_options += add_thread_opt(browser, &actions[nr_options],
&options[nr_options], thread);
nr_options += add_dso_opt(browser, &actions[nr_options],
--
2.44.0.478.gd926399ef9-goog
The data type profiling alone doesn't need the sample histogram for
functions. It only needs the histogram for the types.
Let's remove the condition in the report_callback to check the data type
profiling and make sure the annotation has the annotated_source before
calling symbol__disassemble().
Signed-off-by: Namhyung Kim <[email protected]>
---
tools/perf/builtin-report.c | 2 +-
tools/perf/util/annotate.c | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index aaa6427a1224..dafba6e030ef 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -172,7 +172,7 @@ static int hist_iter__report_callback(struct hist_entry_iter *iter,
struct mem_info *mi;
struct branch_info *bi;
- if (!ui__has_annotation() && !rep->symbol_ipc && !rep->data_type)
+ if (!ui__has_annotation() && !rep->symbol_ipc)
return 0;
if (sort__mode == SORT_MODE__BRANCH) {
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 11da27801d88..7e034d2f2adb 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -908,6 +908,13 @@ int symbol__annotate(struct map_symbol *ms, struct evsel *evsel,
args.arch = arch;
args.ms = *ms;
+
+ if (notes->src == NULL) {
+ notes->src = annotated_source__new();
+ if (notes->src == NULL)
+ return -1;
+ }
+
if (annotate_opts.full_addr)
notes->src->start = map__objdump_2mem(ms->map, ms->sym->start);
else
--
2.44.0.478.gd926399ef9-goog
On Tue, Apr 9, 2024 at 4:50 PM Namhyung Kim <[email protected]> wrote:
>
> Hello,
>
> This is to support interactive TUI browser for type annotation.
>
> Like the normal (code) annotation, it should be able to display the data type
> annotation. Now `perf annotate --data-type` will show the result in TUI by
> default if it's enabled. Also `perf report -s type` can show the same output
> using a menu item.
>
> It's still in a very early stage and supports the basic functionalities only.
> I'll work on more features like in the normal annotation browser later.
>
> The code is also available at 'perf/annotate-data-tui-v1' branch at
>
> git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git
>
> Thanks,
> Namhyung
>
>
> Namhyung Kim (6):
> perf annotate: Show progress of sample processing
> perf annotate-data: Add hist_entry__annotate_data_tty()
> perf annotate-data: Add hist_entry__annotate_data_tui()
> perf annotate-data: Support event group display in TUI
> perf report: Add a menu item to annotate data type in TUI
> perf report: Do not collect sample histogram unnecessarily
Reviewed-by: Ian Rogers <[email protected]>
Thanks,
Ian
> tools/perf/builtin-annotate.c | 149 ++++--------
> tools/perf/builtin-report.c | 7 +-
> tools/perf/ui/browsers/Build | 1 +
> tools/perf/ui/browsers/annotate-data.c | 312 +++++++++++++++++++++++++
> tools/perf/ui/browsers/hists.c | 31 +++
> tools/perf/util/annotate-data.c | 113 +++++++++
> tools/perf/util/annotate-data.h | 6 +
> tools/perf/util/annotate.c | 7 +
> 8 files changed, 515 insertions(+), 111 deletions(-)
> create mode 100644 tools/perf/ui/browsers/annotate-data.c
>
>
> base-commit: 9c3e9af74326978ba6f4432bb038e6c80f4f56fd
> --
> 2.44.0.478.gd926399ef9-goog
>
On Tue, Apr 09, 2024 at 04:49:58PM -0700, Namhyung Kim wrote:
> Like in stdio, it should print all events in a group together.
Please provide the desired output, i.e. the "like in stdio", together
with the 'perf record' that creates a perf.data file that will then be
used with 'perf annotate' to produce the old output and then the new,
I'm trying to do that now to review the patch.
- Arnaldo
> Signed-off-by: Namhyung Kim <[email protected]>
> ---
> tools/perf/ui/browsers/annotate-data.c | 50 ++++++++++++++++++++------
> 1 file changed, 40 insertions(+), 10 deletions(-)
>
> diff --git a/tools/perf/ui/browsers/annotate-data.c b/tools/perf/ui/browsers/annotate-data.c
> index fefacaaf16db..a4a0f042f201 100644
> --- a/tools/perf/ui/browsers/annotate-data.c
> +++ b/tools/perf/ui/browsers/annotate-data.c
> @@ -10,20 +10,27 @@
> #include "util/annotate.h"
> #include "util/annotate-data.h"
> #include "util/evsel.h"
> +#include "util/evlist.h"
> #include "util/sort.h"
>
> struct annotated_data_browser {
> struct ui_browser b;
> struct list_head entries;
> + int nr_events;
> };
>
> struct browser_entry {
> struct list_head node;
> struct annotated_member *data;
> - struct type_hist_entry hists;
> + struct type_hist_entry *hists;
> int indent;
> };
>
> +static struct annotated_data_browser *get_browser(struct ui_browser *uib)
> +{
> + return container_of(uib, struct annotated_data_browser, b);
> +}
> +
> static void update_hist_entry(struct type_hist_entry *dst,
> struct type_hist_entry *src)
> {
> @@ -33,17 +40,21 @@ static void update_hist_entry(struct type_hist_entry *dst,
>
> static int get_member_overhead(struct annotated_data_type *adt,
> struct browser_entry *entry,
> - struct evsel *evsel)
> + struct evsel *leader)
> {
> struct annotated_member *member = entry->data;
> - int i;
> + int i, k;
>
> for (i = 0; i < member->size; i++) {
> struct type_hist *h;
> + struct evsel *evsel;
> int offset = member->offset + i;
>
> - h = adt->histograms[evsel->core.idx];
> - update_hist_entry(&entry->hists, &h->addr[offset]);
> + for_each_group_evsel(evsel, leader) {
> + h = adt->histograms[evsel->core.idx];
> + k = evsel__group_idx(evsel);
> + update_hist_entry(&entry->hists[k], &h->addr[offset]);
> + }
> }
> return 0;
> }
> @@ -61,6 +72,12 @@ static int add_child_entries(struct annotated_data_browser *browser,
> if (entry == NULL)
> return -1;
>
> + entry->hists = calloc(browser->nr_events, sizeof(*entry->hists));
> + if (entry->hists == NULL) {
> + free(entry);
> + return -1;
> + }
> +
> entry->data = member;
> entry->indent = indent;
> if (get_member_overhead(adt, entry, evsel) < 0) {
> @@ -113,6 +130,7 @@ static void annotated_data_browser__delete_entries(struct annotated_data_browser
>
> list_for_each_entry_safe(pos, tmp, &browser->entries, node) {
> list_del_init(&pos->node);
> + free(pos->hists);
> free(pos);
> }
> }
> @@ -126,6 +144,7 @@ static int browser__show(struct ui_browser *uib)
> {
> struct hist_entry *he = uib->priv;
> struct annotated_data_type *adt = he->mem_type;
> + struct annotated_data_browser *browser = get_browser(uib);
> const char *help = "Press 'h' for help on key bindings";
> char title[256];
>
> @@ -146,7 +165,8 @@ static int browser__show(struct ui_browser *uib)
> else
> strcpy(title, "Percent");
>
> - ui_browser__printf(uib, " %10s %10s %10s %s",
> + ui_browser__printf(uib, "%*s %10s %10s %10s %s",
> + 11 * (browser->nr_events - 1), "",
> title, "Offset", "Size", "Field");
> ui_browser__write_nstring(uib, "", uib->width);
> return 0;
> @@ -175,18 +195,20 @@ static void browser__write_overhead(struct ui_browser *uib,
>
> static void browser__write(struct ui_browser *uib, void *entry, int row)
> {
> + struct annotated_data_browser *browser = get_browser(uib);
> struct browser_entry *be = entry;
> struct annotated_member *member = be->data;
> struct hist_entry *he = uib->priv;
> struct annotated_data_type *adt = he->mem_type;
> - struct evsel *evsel = hists_to_evsel(he->hists);
> + struct evsel *leader = hists_to_evsel(he->hists);
> + struct evsel *evsel;
>
> if (member == NULL) {
> bool current = ui_browser__is_current_entry(uib, row);
>
> /* print the closing bracket */
> ui_browser__set_percent_color(uib, 0, current);
> - ui_browser__write_nstring(uib, "", 11);
> + ui_browser__write_nstring(uib, "", 11 * browser->nr_events);
> ui_browser__printf(uib, " %10s %10s %*s};",
> "", "", be->indent * 4, "");
> ui_browser__write_nstring(uib, "", uib->width);
> @@ -194,8 +216,12 @@ static void browser__write(struct ui_browser *uib, void *entry, int row)
> }
>
> /* print the number */
> - browser__write_overhead(uib, adt->histograms[evsel->core.idx],
> - &be->hists, row);
> + for_each_group_evsel(evsel, leader) {
> + struct type_hist *h = adt->histograms[evsel->core.idx];
> + int idx = evsel__group_idx(evsel);
> +
> + browser__write_overhead(uib, h, &be->hists[idx], row);
> + }
>
> /* print type info */
> if (be->indent == 0 && !member->var_name) {
> @@ -267,11 +293,15 @@ int hist_entry__annotate_data_tui(struct hist_entry *he, struct evsel *evsel,
> .priv = he,
> .extra_title_lines = 1,
> },
> + .nr_events = 1,
> };
> int ret;
>
> ui_helpline__push("Press ESC to exit");
>
> + if (evsel__is_group_event(evsel))
> + browser.nr_events = evsel->core.nr_members;
> +
> ret = annotated_data_browser__collect_entries(&browser);
> if (ret == 0)
> ret = annotated_data_browser__run(&browser, evsel, hbt);
> --
> 2.44.0.478.gd926399ef9-goog
On Tue, Apr 09, 2024 at 04:49:57PM -0700, Namhyung Kim wrote:
> Support data type profiling output on TUI.
Added the follow to the commit log message, to make reviewing easier.
As followup patches I think having the DSO name together with the type
is important, also I think we could have a first menu with all the pairs
of DSO/type, sorted top down by the types with most samples, wdyt?
Applied.
- Arnaldo
Committer testing:
First make sure that the debug information for your workload binaries
in embedded in them by building it with '-g' or install the debuginfo
packages, since our workload is 'find':
root@number:~# type find
find is hashed (/usr/bin/find)
root@number:~# rpm -qf /usr/bin/find
findutils-4.9.0-5.fc39.x86_64
root@number:~# dnf debuginfo-install findutils
<SNIP>
root@number:~#
Then collect some data:
root@number:~# echo 1 > /proc/sys/vm/drop_caches
root@number:~# perf mem record find / > /dev/null
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.331 MB perf.data (3982 samples) ]
root@number:~#
Finally do data-type annotation with the following command, that will
default, as 'perf report' to the --tui mode, with lines colored to
highlight the hotspots, etc.
root@number:~# perf annotate --data-type
Annotate type: 'struct predicate' (58 samples)
Percent Offset Size Field annotate --data-type
100.00 0 312 struct predicate {
0.00 0 8 PRED_FUNC pred_func;
0.00 8 8 char* p_name;
0.00 16 4 enum predicate_type p_type;
0.00 20 4 enum predicate_precedence p_prec;
0.00 24 1 _Bool side_effects;
0.00 25 1 _Bool no_default_print;
0.00 26 1 _Bool need_stat;
0.00 27 1 _Bool need_type;
0.00 28 1 _Bool need_inum;
0.00 32 4 enum EvaluationCost p_cost;
0.00 36 4 float est_success_rate;
0.00 40 1 _Bool literal_control_chars;
0.00 41 1 _Bool artificial;
0.00 48 8 char* arg_text;
<SNIP>
Reviewed-by: Ian Rogers <[email protected]>
Signed-off-by: Namhyung Kim <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
> Signed-off-by: Namhyung Kim <[email protected]>
> ---
> tools/perf/builtin-annotate.c | 30 ++-
> tools/perf/ui/browsers/Build | 1 +
> tools/perf/ui/browsers/annotate-data.c | 282 +++++++++++++++++++++++++
> tools/perf/util/annotate-data.c | 5 +-
> tools/perf/util/annotate-data.h | 5 +-
> 5 files changed, 317 insertions(+), 6 deletions(-)
> create mode 100644 tools/perf/ui/browsers/annotate-data.c
>
> diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
> index 0812664faa54..6f7104f06c42 100644
> --- a/tools/perf/builtin-annotate.c
> +++ b/tools/perf/builtin-annotate.c
> @@ -469,8 +469,32 @@ static void hists__find_annotations(struct hists *hists,
> goto find_next;
> }
>
> - hist_entry__annotate_data_tty(he, evsel);
> - goto find_next;
> + if (use_browser == 1)
> + key = hist_entry__annotate_data_tui(he, evsel, NULL);
> + else
> + key = hist_entry__annotate_data_tty(he, evsel);
> +
> + 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 (next != NULL)
> + nd = next;
> +
> + continue;
> }
>
> if (use_browser == 2) {
> @@ -873,9 +897,7 @@ int cmd_annotate(int argc, const char **argv)
> use_browser = 2;
> #endif
>
> - /* FIXME: only support stdio for now */
> if (annotate.data_type) {
> - use_browser = 0;
> annotate_opts.annotate_src = false;
> symbol_conf.annotate_data_member = true;
> symbol_conf.annotate_data_sample = true;
> diff --git a/tools/perf/ui/browsers/Build b/tools/perf/ui/browsers/Build
> index 7a1d5ddaf688..2608b5da3167 100644
> --- a/tools/perf/ui/browsers/Build
> +++ b/tools/perf/ui/browsers/Build
> @@ -1,4 +1,5 @@
> perf-y += annotate.o
> +perf-y += annotate-data.o
> perf-y += hists.o
> perf-y += map.o
> perf-y += scripts.o
> diff --git a/tools/perf/ui/browsers/annotate-data.c b/tools/perf/ui/browsers/annotate-data.c
> new file mode 100644
> index 000000000000..fefacaaf16db
> --- /dev/null
> +++ b/tools/perf/ui/browsers/annotate-data.c
> @@ -0,0 +1,282 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#include <inttypes.h>
> +#include <string.h>
> +#include <sys/ttydefaults.h>
> +
> +#include "ui/browser.h"
> +#include "ui/helpline.h"
> +#include "ui/keysyms.h"
> +#include "ui/ui.h"
> +#include "util/annotate.h"
> +#include "util/annotate-data.h"
> +#include "util/evsel.h"
> +#include "util/sort.h"
> +
> +struct annotated_data_browser {
> + struct ui_browser b;
> + struct list_head entries;
> +};
> +
> +struct browser_entry {
> + struct list_head node;
> + struct annotated_member *data;
> + struct type_hist_entry hists;
> + int indent;
> +};
> +
> +static void update_hist_entry(struct type_hist_entry *dst,
> + struct type_hist_entry *src)
> +{
> + dst->nr_samples += src->nr_samples;
> + dst->period += src->period;
> +}
> +
> +static int get_member_overhead(struct annotated_data_type *adt,
> + struct browser_entry *entry,
> + struct evsel *evsel)
> +{
> + struct annotated_member *member = entry->data;
> + int i;
> +
> + for (i = 0; i < member->size; i++) {
> + struct type_hist *h;
> + int offset = member->offset + i;
> +
> + h = adt->histograms[evsel->core.idx];
> + update_hist_entry(&entry->hists, &h->addr[offset]);
> + }
> + return 0;
> +}
> +
> +static int add_child_entries(struct annotated_data_browser *browser,
> + struct annotated_data_type *adt,
> + struct annotated_member *member,
> + struct evsel *evsel, int indent)
> +{
> + struct annotated_member *pos;
> + struct browser_entry *entry;
> + int nr_entries = 0;
> +
> + entry = zalloc(sizeof(*entry));
> + if (entry == NULL)
> + return -1;
> +
> + entry->data = member;
> + entry->indent = indent;
> + if (get_member_overhead(adt, entry, evsel) < 0) {
> + free(entry);
> + return -1;
> + }
> +
> + list_add_tail(&entry->node, &browser->entries);
> + nr_entries++;
> +
> + list_for_each_entry(pos, &member->children, node) {
> + int nr = add_child_entries(browser, adt, pos, evsel, indent + 1);
> +
> + if (nr < 0)
> + return nr;
> +
> + nr_entries += nr;
> + }
> +
> + /* add an entry for the closing bracket ("}") */
> + if (!list_empty(&member->children)) {
> + entry = zalloc(sizeof(*entry));
> + if (entry == NULL)
> + return -1;
> +
> + entry->indent = indent;
> + list_add_tail(&entry->node, &browser->entries);
> + nr_entries++;
> + }
> +
> + return nr_entries;
> +}
> +
> +static int annotated_data_browser__collect_entries(struct annotated_data_browser *browser)
> +{
> + struct hist_entry *he = browser->b.priv;
> + struct annotated_data_type *adt = he->mem_type;
> + struct evsel *evsel = hists_to_evsel(he->hists);
> +
> + INIT_LIST_HEAD(&browser->entries);
> + browser->b.entries = &browser->entries;
> + browser->b.nr_entries = add_child_entries(browser, adt, &adt->self,
> + evsel, /*indent=*/0);
> + return 0;
> +}
> +
> +static void annotated_data_browser__delete_entries(struct annotated_data_browser *browser)
> +{
> + struct browser_entry *pos, *tmp;
> +
> + list_for_each_entry_safe(pos, tmp, &browser->entries, node) {
> + list_del_init(&pos->node);
> + free(pos);
> + }
> +}
> +
> +static unsigned int browser__refresh(struct ui_browser *uib)
> +{
> + return ui_browser__list_head_refresh(uib);
> +}
> +
> +static int browser__show(struct ui_browser *uib)
> +{
> + struct hist_entry *he = uib->priv;
> + struct annotated_data_type *adt = he->mem_type;
> + const char *help = "Press 'h' for help on key bindings";
> + char title[256];
> +
> + snprintf(title, sizeof(title), "Annotate type: '%s' (%d samples)",
> + adt->self.type_name, he->stat.nr_events);
> +
> + if (ui_browser__show(uib, title, help) < 0)
> + return -1;
> +
> + /* second line header */
> + ui_browser__gotorc_title(uib, 0, 0);
> + ui_browser__set_color(uib, HE_COLORSET_ROOT);
> +
> + if (symbol_conf.show_total_period)
> + strcpy(title, "Period");
> + else if (symbol_conf.show_nr_samples)
> + strcpy(title, "Samples");
> + else
> + strcpy(title, "Percent");
> +
> + ui_browser__printf(uib, " %10s %10s %10s %s",
> + title, "Offset", "Size", "Field");
> + ui_browser__write_nstring(uib, "", uib->width);
> + return 0;
> +}
> +
> +static void browser__write_overhead(struct ui_browser *uib,
> + struct type_hist *total,
> + struct type_hist_entry *hist, int row)
> +{
> + u64 period = hist->period;
> + double percent = total->period ? (100.0 * period / total->period) : 0;
> + bool current = ui_browser__is_current_entry(uib, row);
> + int nr_samples = 0;
> +
> + ui_browser__set_percent_color(uib, percent, current);
> +
> + if (symbol_conf.show_total_period)
> + ui_browser__printf(uib, " %10" PRIu64, period);
> + else if (symbol_conf.show_nr_samples)
> + ui_browser__printf(uib, " %10d", nr_samples);
> + else
> + ui_browser__printf(uib, " %10.2f", percent);
> +
> + ui_browser__set_percent_color(uib, 0, current);
> +}
> +
> +static void browser__write(struct ui_browser *uib, void *entry, int row)
> +{
> + struct browser_entry *be = entry;
> + struct annotated_member *member = be->data;
> + struct hist_entry *he = uib->priv;
> + struct annotated_data_type *adt = he->mem_type;
> + struct evsel *evsel = hists_to_evsel(he->hists);
> +
> + if (member == NULL) {
> + bool current = ui_browser__is_current_entry(uib, row);
> +
> + /* print the closing bracket */
> + ui_browser__set_percent_color(uib, 0, current);
> + ui_browser__write_nstring(uib, "", 11);
> + ui_browser__printf(uib, " %10s %10s %*s};",
> + "", "", be->indent * 4, "");
> + ui_browser__write_nstring(uib, "", uib->width);
> + return;
> + }
> +
> + /* print the number */
> + browser__write_overhead(uib, adt->histograms[evsel->core.idx],
> + &be->hists, row);
> +
> + /* print type info */
> + if (be->indent == 0 && !member->var_name) {
> + ui_browser__printf(uib, " %10d %10d %s%s",
> + member->offset, member->size,
> + member->type_name,
> + list_empty(&member->children) ? ";" : " {");
> + } else {
> + ui_browser__printf(uib, " %10d %10d %*s%s\t%s%s",
> + member->offset, member->size,
> + be->indent * 4, "", member->type_name,
> + member->var_name ?: "",
> + list_empty(&member->children) ? ";" : " {");
> + }
> + /* fill the rest */
> + ui_browser__write_nstring(uib, "", uib->width);
> +}
> +
> +static int annotated_data_browser__run(struct annotated_data_browser *browser,
> + struct evsel *evsel __maybe_unused,
> + struct hist_browser_timer *hbt)
> +{
> + int delay_secs = hbt ? hbt->refresh : 0;
> + int key;
> +
> + if (browser__show(&browser->b) < 0)
> + return -1;
> +
> + while (1) {
> + key = ui_browser__run(&browser->b, delay_secs);
> +
> + switch (key) {
> + case K_TIMER:
> + if (hbt)
> + hbt->timer(hbt->arg);
> + continue;
> + case K_F1:
> + case 'h':
> + ui_browser__help_window(&browser->b,
> + "UP/DOWN/PGUP\n"
> + "PGDN/SPACE Navigate\n"
> + "</> Move to prev/next symbol\n"
> + "q/ESC/CTRL+C Exit\n\n");
> + continue;
> + case K_LEFT:
> + case '<':
> + case '>':
> + case K_ESC:
> + case 'q':
> + case CTRL('c'):
> + goto out;
> + default:
> + continue;
> + }
> + }
> +out:
> + ui_browser__hide(&browser->b);
> + return key;
> +}
> +
> +int hist_entry__annotate_data_tui(struct hist_entry *he, struct evsel *evsel,
> + struct hist_browser_timer *hbt)
> +{
> + struct annotated_data_browser browser = {
> + .b = {
> + .refresh = browser__refresh,
> + .seek = ui_browser__list_head_seek,
> + .write = browser__write,
> + .priv = he,
> + .extra_title_lines = 1,
> + },
> + };
> + int ret;
> +
> + ui_helpline__push("Press ESC to exit");
> +
> + ret = annotated_data_browser__collect_entries(&browser);
> + if (ret == 0)
> + ret = annotated_data_browser__run(&browser, evsel, hbt);
> +
> + annotated_data_browser__delete_entries(&browser);
> +
> + return ret;
> +}
> diff --git a/tools/perf/util/annotate-data.c b/tools/perf/util/annotate-data.c
> index 99c5dcdfc9df..1cd857400038 100644
> --- a/tools/perf/util/annotate-data.c
> +++ b/tools/perf/util/annotate-data.c
> @@ -1814,9 +1814,12 @@ static void print_annotated_data_type(struct annotated_data_type *mem_type,
> printf(";\n");
> }
>
> -void hist_entry__annotate_data_tty(struct hist_entry *he, struct evsel *evsel)
> +int hist_entry__annotate_data_tty(struct hist_entry *he, struct evsel *evsel)
> {
> print_annotated_data_header(he, evsel);
> print_annotated_data_type(he->mem_type, &he->mem_type->self, evsel, 0);
> printf("\n");
> +
> + /* move to the next entry */
> + return '>';
> }
> diff --git a/tools/perf/util/annotate-data.h b/tools/perf/util/annotate-data.h
> index 037e2622b7a3..9a6d9b519724 100644
> --- a/tools/perf/util/annotate-data.h
> +++ b/tools/perf/util/annotate-data.h
> @@ -11,6 +11,7 @@ struct annotated_op_loc;
> struct debuginfo;
> struct evsel;
> struct hist_entry;
> +struct hist_browser_timer;
> struct map_symbol;
> struct thread;
>
> @@ -141,7 +142,9 @@ struct annotated_data_stat {
> };
> extern struct annotated_data_stat ann_data_stat;
>
> -void hist_entry__annotate_data_tty(struct hist_entry *he, struct evsel *evsel);
> +int hist_entry__annotate_data_tty(struct hist_entry *he, struct evsel *evsel);
> +int hist_entry__annotate_data_tui(struct hist_entry *he, struct evsel *evsel,
> + struct hist_browser_timer *hbt);
>
> #ifdef HAVE_DWARF_SUPPORT
>
> --
> 2.44.0.478.gd926399ef9-goog
>
On Tue, Apr 09, 2024 at 04:49:58PM -0700, Namhyung Kim wrote:
> Like in stdio, it should print all events in a group together.
How to test this?
You mean something like:
root@number:~# perf record -a -e '{cpu_core/mem-loads,ldlat=30/P,cpu_core/mem-stores/P}'
^C[ perf record: Woken up 8 times to write data ]
[ perf record: Captured and wrote 4.980 MB perf.data (55825 samples) ]
root@number:~#
root@number:~# perf annotate --stdio --data-type
And then having the same output in the TUI?
Trying this...
- Arnaldo
> Signed-off-by: Namhyung Kim <[email protected]>
> ---
> tools/perf/ui/browsers/annotate-data.c | 50 ++++++++++++++++++++------
> 1 file changed, 40 insertions(+), 10 deletions(-)
>
> diff --git a/tools/perf/ui/browsers/annotate-data.c b/tools/perf/ui/browsers/annotate-data.c
> index fefacaaf16db..a4a0f042f201 100644
> --- a/tools/perf/ui/browsers/annotate-data.c
> +++ b/tools/perf/ui/browsers/annotate-data.c
> @@ -10,20 +10,27 @@
> #include "util/annotate.h"
> #include "util/annotate-data.h"
> #include "util/evsel.h"
> +#include "util/evlist.h"
> #include "util/sort.h"
>
> struct annotated_data_browser {
> struct ui_browser b;
> struct list_head entries;
> + int nr_events;
> };
>
> struct browser_entry {
> struct list_head node;
> struct annotated_member *data;
> - struct type_hist_entry hists;
> + struct type_hist_entry *hists;
> int indent;
> };
>
> +static struct annotated_data_browser *get_browser(struct ui_browser *uib)
> +{
> + return container_of(uib, struct annotated_data_browser, b);
> +}
> +
> static void update_hist_entry(struct type_hist_entry *dst,
> struct type_hist_entry *src)
> {
> @@ -33,17 +40,21 @@ static void update_hist_entry(struct type_hist_entry *dst,
>
> static int get_member_overhead(struct annotated_data_type *adt,
> struct browser_entry *entry,
> - struct evsel *evsel)
> + struct evsel *leader)
> {
> struct annotated_member *member = entry->data;
> - int i;
> + int i, k;
>
> for (i = 0; i < member->size; i++) {
> struct type_hist *h;
> + struct evsel *evsel;
> int offset = member->offset + i;
>
> - h = adt->histograms[evsel->core.idx];
> - update_hist_entry(&entry->hists, &h->addr[offset]);
> + for_each_group_evsel(evsel, leader) {
> + h = adt->histograms[evsel->core.idx];
> + k = evsel__group_idx(evsel);
> + update_hist_entry(&entry->hists[k], &h->addr[offset]);
> + }
> }
> return 0;
> }
> @@ -61,6 +72,12 @@ static int add_child_entries(struct annotated_data_browser *browser,
> if (entry == NULL)
> return -1;
>
> + entry->hists = calloc(browser->nr_events, sizeof(*entry->hists));
> + if (entry->hists == NULL) {
> + free(entry);
> + return -1;
> + }
> +
> entry->data = member;
> entry->indent = indent;
> if (get_member_overhead(adt, entry, evsel) < 0) {
> @@ -113,6 +130,7 @@ static void annotated_data_browser__delete_entries(struct annotated_data_browser
>
> list_for_each_entry_safe(pos, tmp, &browser->entries, node) {
> list_del_init(&pos->node);
> + free(pos->hists);
> free(pos);
> }
> }
> @@ -126,6 +144,7 @@ static int browser__show(struct ui_browser *uib)
> {
> struct hist_entry *he = uib->priv;
> struct annotated_data_type *adt = he->mem_type;
> + struct annotated_data_browser *browser = get_browser(uib);
> const char *help = "Press 'h' for help on key bindings";
> char title[256];
>
> @@ -146,7 +165,8 @@ static int browser__show(struct ui_browser *uib)
> else
> strcpy(title, "Percent");
>
> - ui_browser__printf(uib, " %10s %10s %10s %s",
> + ui_browser__printf(uib, "%*s %10s %10s %10s %s",
> + 11 * (browser->nr_events - 1), "",
> title, "Offset", "Size", "Field");
> ui_browser__write_nstring(uib, "", uib->width);
> return 0;
> @@ -175,18 +195,20 @@ static void browser__write_overhead(struct ui_browser *uib,
>
> static void browser__write(struct ui_browser *uib, void *entry, int row)
> {
> + struct annotated_data_browser *browser = get_browser(uib);
> struct browser_entry *be = entry;
> struct annotated_member *member = be->data;
> struct hist_entry *he = uib->priv;
> struct annotated_data_type *adt = he->mem_type;
> - struct evsel *evsel = hists_to_evsel(he->hists);
> + struct evsel *leader = hists_to_evsel(he->hists);
> + struct evsel *evsel;
>
> if (member == NULL) {
> bool current = ui_browser__is_current_entry(uib, row);
>
> /* print the closing bracket */
> ui_browser__set_percent_color(uib, 0, current);
> - ui_browser__write_nstring(uib, "", 11);
> + ui_browser__write_nstring(uib, "", 11 * browser->nr_events);
> ui_browser__printf(uib, " %10s %10s %*s};",
> "", "", be->indent * 4, "");
> ui_browser__write_nstring(uib, "", uib->width);
> @@ -194,8 +216,12 @@ static void browser__write(struct ui_browser *uib, void *entry, int row)
> }
>
> /* print the number */
> - browser__write_overhead(uib, adt->histograms[evsel->core.idx],
> - &be->hists, row);
> + for_each_group_evsel(evsel, leader) {
> + struct type_hist *h = adt->histograms[evsel->core.idx];
> + int idx = evsel__group_idx(evsel);
> +
> + browser__write_overhead(uib, h, &be->hists[idx], row);
> + }
>
> /* print type info */
> if (be->indent == 0 && !member->var_name) {
> @@ -267,11 +293,15 @@ int hist_entry__annotate_data_tui(struct hist_entry *he, struct evsel *evsel,
> .priv = he,
> .extra_title_lines = 1,
> },
> + .nr_events = 1,
> };
> int ret;
>
> ui_helpline__push("Press ESC to exit");
>
> + if (evsel__is_group_event(evsel))
> + browser.nr_events = evsel->core.nr_members;
> +
> ret = annotated_data_browser__collect_entries(&browser);
> if (ret == 0)
> ret = annotated_data_browser__run(&browser, evsel, hbt);
> --
> 2.44.0.478.gd926399ef9-goog
On Wed, Apr 10, 2024 at 05:24:56PM -0300, Arnaldo Carvalho de Melo wrote:
> On Tue, Apr 09, 2024 at 04:49:58PM -0700, Namhyung Kim wrote:
> > Like in stdio, it should print all events in a group together.
>
> How to test this?
>
> You mean something like:
>
> root@number:~# perf record -a -e '{cpu_core/mem-loads,ldlat=30/P,cpu_core/mem-stores/P}'
> ^C[ perf record: Woken up 8 times to write data ]
> [ perf record: Captured and wrote 4.980 MB perf.data (55825 samples) ]
>
> root@number:~#
>
> root@number:~# perf annotate --stdio --data-type
>
> And then having the same output in the TUI?
>
> Trying this...
Added, the following, ok?
And the --stdio has all the missing info in TUI:
Annotate type: 'union ' in /usr/lib64/libc.so.6 (1131 samples):
event[0] = cpu_core/mem-loads,ldlat=30/P
event[1] = cpu_core/mem-stores/P
Committer notes:
Collect it:
root@number:~# perf record -a -e '{cpu_core/mem-loads,ldlat=30/P,cpu_core/mem-stores/P}'
^C[ perf record: Woken up 8 times to write data ]
[ perf record: Captured and wrote 4.980 MB perf.data (55825 samples) ]
root@number:~#
Then do it in stdio:
root@number:~# perf annotate --stdio --data-type
Annotate type: 'union ' in /usr/lib64/libc.so.6 (1131 samples):
event[0] = cpu_core/mem-loads,ldlat=30/P
event[1] = cpu_core/mem-stores/P
============================================================================
Percent offset size field
100.00 100.00 0 40 union {
100.00 100.00 0 40 struct __pthread_mutex_s __data {
48.61 23.46 0 4 int __lock;
0.00 0.48 4 4 unsigned int __count;
6.38 41.32 8 4 int __owner;
8.74 34.02 12 4 unsigned int __nusers;
35.66 0.26 16 4 int __kind;
0.61 0.45 20 2 short int __spins;
0.00 0.00 22 2 short int __elision;
0.00 0.00 24 16 __pthread_list_t __list {
0.00 0.00 24 8 struct __pthread_internal_list* __prev;
0.00 0.00 32 8 struct __pthread_internal_list* __next;
};
};
0.00 0.00 0 0 char* __size;
48.61 23.94 0 8 long int __align;
};
Now with TUI before this patch:
root@number:~# perf annotate --tui --data-type
Annotate type: 'union ' (790 samples)
Percent Offset Size Field
100.00 0 40 union {
100.00 0 40 struct __pthread_mutex_s __data {
48.61 0 4 int __lock;
0.00 4 4 unsigned int __count;
6.38 8 4 int __owner;
8.74 12 4 unsigned int __nusers;
35.66 16 4 int __kind;
0.61 20 2 short int __spins;
0.00 22 2 short int __elision;
0.00 24 16 __pthread_list_t __list {
0.00 24 8 struct __pthread_internal_list* __prev;
0.00 32 8 struct __pthread_internal_list* __next;
0.00 0 0 char* __size;
48.61 0 8 long int __align;
};
And now after this patch:
Annotate type: 'union ' (790 samples)
Percent Offset Size Field
100.00 100.00 0 40 union {
100.00 100.00 0 40 struct __pthread_mutex_s __data {
48.61 23.46 0 4 int __lock;
0.00 0.48 4 4 unsigned int __count;
6.38 41.32 8 4 int __owner;
8.74 34.02 12 4 unsigned int __nusers;
35.66 0.26 16 4 int __kind;
0.61 0.45 20 2 short int __spins;
0.00 0.00 22 2 short int __elision;
0.00 0.00 24 16 __pthread_list_t __list {
0.00 0.00 24 8 struct __pthread_internal_list* __prev;
0.00 0.00 32 8 struct __pthread_internal_list* __next;
};
};
0.00 0.00 0 0 char* __size;
48.61 23.94 0 8 long int __align;
};
Reviewed-by: Ian Rogers <[email protected]>
Signed-off-by: Namhyung Kim <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
On Tue, Apr 09, 2024 at 04:49:59PM -0700, Namhyung Kim wrote:
> When the hist entry has the type info, it should be able to display the
> annotation browser for the type like in `perf annotate --data-type`.
Trying to test this with:
root@number:~# perf report --header-only |& grep "perf record"
# cmdline : /home/acme/bin/perf record -a -e {cpu_core/mem-loads,ldlat=30/P,cpu_core/mem-stores/P}
root@number:~# perf evlist -v
cpu_core/mem-loads,ldlat=30/P: type: 4 (cpu_core), size: 136, config: 0x1cd (mem-loads), { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|CPU|PERIOD|IDENTIFIER, read_format: ID|LOST, disabled: 1, inherit: 1, freq: 1, precise_ip: 2, sample_id_all: 1, { bp_addr, config1 }: 0x1f
cpu_core/mem-stores/P: type: 4 (cpu_core), size: 136, config: 0x2cd (mem-stores), { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|CPU|PERIOD|IDENTIFIER, read_format: ID|LOST, inherit: 1, freq: 1, precise_ip: 3, sample_id_all: 1
dummy:u: type: 1 (software), size: 136, config: 0x9 (PERF_COUNT_SW_DUMMY), { sample_period, sample_freq }: 1, sample_type: IP|TID|TIME|CPU|IDENTIFIER, read_format: ID|LOST, inherit: 1, exclude_kernel: 1, exclude_hv: 1, mmap: 1, comm: 1, task: 1, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1, ksymbol: 1, bpf_event: 1
root@number:~# perf report -s type
And when I press ESC to exit:
root@number:~# perf report -s type
perf: Segmentation fault
-------- backtrace --------
perf[0x61326b]
/lib64/libc.so.6(+0x3e9a0)[0x7f7173a5c9a0]
/lib64/libc.so.6(free+0x25)[0x7f7173abd385]
perf[0x5d5002]
perf[0x4fd007]
perf[0x523ce0]
perf[0x525ad4]
perf[0x503f43]
perf[0x557ad4]
perf[0x557eeb]
perf[0x4e5355]
perf[0x4dea42]
perf[0x528aad]
perf[0x42b559]
perf[0x4c39e9]
perf[0x4c3cf9]
perf[0x410e47]
/lib64/libc.so.6(+0x2814a)[0x7f7173a4614a]
/lib64/libc.so.6(__libc_start_main+0x8b)[0x7f7173a4620b]
perf[0x4113e5]
root@number:~#
Trying to build with debug info...
- Arnaldo
> Signed-off-by: Namhyung Kim <[email protected]>
> ---
> tools/perf/builtin-report.c | 5 +++++
> tools/perf/ui/browsers/hists.c | 31 +++++++++++++++++++++++++++++++
> 2 files changed, 36 insertions(+)
>
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index dcd93ee5fc24..aaa6427a1224 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -1694,6 +1694,11 @@ int cmd_report(int argc, const char **argv)
> else
> use_browser = 0;
>
> + if (report.data_type && use_browser == 1) {
> + symbol_conf.annotate_data_member = true;
> + symbol_conf.annotate_data_sample = true;
> + }
> +
> if (sort_order && strstr(sort_order, "ipc")) {
> parse_options_usage(report_usage, options, "s", 1);
> goto error;
> diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
> index 0c02b3a8e121..71b32591d61a 100644
> --- a/tools/perf/ui/browsers/hists.c
> +++ b/tools/perf/ui/browsers/hists.c
> @@ -38,6 +38,7 @@
> #include "../ui.h"
> #include "map.h"
> #include "annotate.h"
> +#include "annotate-data.h"
> #include "srcline.h"
> #include "string2.h"
> #include "units.h"
> @@ -2505,6 +2506,32 @@ add_annotate_opt(struct hist_browser *browser __maybe_unused,
> return 1;
> }
>
> +static int
> +do_annotate_type(struct hist_browser *browser, struct popup_action *act)
> +{
> + struct hist_entry *he = browser->he_selection;
> +
> + hist_entry__annotate_data_tui(he, act->evsel, browser->hbt);
> + ui_browser__handle_resize(&browser->b);
> + return 0;
> +}
> +
> +static int
> +add_annotate_type_opt(struct hist_browser *browser,
> + struct popup_action *act, char **optstr,
> + struct hist_entry *he)
> +{
> + if (he == NULL || he->mem_type == NULL || he->mem_type->histograms == NULL)
> + return 0;
> +
> + if (asprintf(optstr, "Annotate type %s", he->mem_type->self.type_name) < 0)
> + return 0;
> +
> + act->evsel = hists_to_evsel(browser->hists);
> + act->fn = do_annotate_type;
> + return 1;
> +}
> +
> static int
> do_zoom_thread(struct hist_browser *browser, struct popup_action *act)
> {
> @@ -3307,6 +3334,10 @@ static int evsel__hists_browse(struct evsel *evsel, int nr_events, const char *h
> browser->he_selection->ip);
> }
> skip_annotation:
> + nr_options += add_annotate_type_opt(browser,
> + &actions[nr_options],
> + &options[nr_options],
> + browser->he_selection);
> nr_options += add_thread_opt(browser, &actions[nr_options],
> &options[nr_options], thread);
> nr_options += add_dso_opt(browser, &actions[nr_options],
> --
> 2.44.0.478.gd926399ef9-goog
On Wed, Apr 10, 2024 at 05:46:04PM -0300, Arnaldo Carvalho de Melo wrote:
> On Tue, Apr 09, 2024 at 04:49:59PM -0700, Namhyung Kim wrote:
> > When the hist entry has the type info, it should be able to display the
> > annotation browser for the type like in `perf annotate --data-type`.
>
> Trying to test this with:
>
> root@number:~# perf report --header-only |& grep "perf record"
> # cmdline : /home/acme/bin/perf record -a -e {cpu_core/mem-loads,ldlat=30/P,cpu_core/mem-stores/P}
> root@number:~# perf evlist -v
> cpu_core/mem-loads,ldlat=30/P: type: 4 (cpu_core), size: 136, config: 0x1cd (mem-loads), { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|CPU|PERIOD|IDENTIFIER, read_format: ID|LOST, disabled: 1, inherit: 1, freq: 1, precise_ip: 2, sample_id_all: 1, { bp_addr, config1 }: 0x1f
> cpu_core/mem-stores/P: type: 4 (cpu_core), size: 136, config: 0x2cd (mem-stores), { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|CPU|PERIOD|IDENTIFIER, read_format: ID|LOST, inherit: 1, freq: 1, precise_ip: 3, sample_id_all: 1
> dummy:u: type: 1 (software), size: 136, config: 0x9 (PERF_COUNT_SW_DUMMY), { sample_period, sample_freq }: 1, sample_type: IP|TID|TIME|CPU|IDENTIFIER, read_format: ID|LOST, inherit: 1, exclude_kernel: 1, exclude_hv: 1, mmap: 1, comm: 1, task: 1, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1, ksymbol: 1, bpf_event: 1
> root@number:~# perf report -s type
>
> And when I press ESC to exit:
>
> root@number:~# perf report -s type
> perf: Segmentation fault
> -------- backtrace --------
> perf[0x61326b]
> /lib64/libc.so.6(+0x3e9a0)[0x7f7173a5c9a0]
> /lib64/libc.so.6(free+0x25)[0x7f7173abd385]
> perf[0x5d5002]
> perf[0x4fd007]
> perf[0x523ce0]
> perf[0x525ad4]
> perf[0x503f43]
> perf[0x557ad4]
> perf[0x557eeb]
> perf[0x4e5355]
> perf[0x4dea42]
> perf[0x528aad]
> perf[0x42b559]
> perf[0x4c39e9]
> perf[0x4c3cf9]
> perf[0x410e47]
> /lib64/libc.so.6(+0x2814a)[0x7f7173a4614a]
> /lib64/libc.so.6(__libc_start_main+0x8b)[0x7f7173a4620b]
> perf[0x4113e5]
> root@number:~#
>
> Trying to build with debug info...
Removing the O= dir and then trying with:
⬢[acme@toolbox perf-tools-next]$ alias m
alias m='rm -rf ~/libexec/perf-core/ ; make -k DEBUG=1 CORESIGHT=1 O=/tmp/build/$(basename $PWD)/ -C tools/perf install-bin && perf test python'
⬢[acme@toolbox perf-tools-next]$
I don't get a backtrace :-\ Ooops, sometimes I get it, but again without
resolving symbols:
root@number:~# perf report -s type
perf: Segmentation fault
-------- backtrace --------
perf[0x6b1087]
/lib64/libc.so.6(+0x3e9a0)[0x7fc15fa5c9a0]
/lib64/libc.so.6(free+0x25)[0x7fc15fabd385]
perf[0x66c2c0]
perf[0x66c363]
perf[0x553bc5]
perf[0x553d63]
perf[0x57ed76]
perf[0x58027e]
perf[0x5802bc]
perf[0x580325]
perf[0x5818aa]
perf[0x582241]
perf[0x58233c]
perf[0x5823fd]
perf[0x55c4ca]
perf[0x55c55f]
perf[0x5c36bf]
perf[0x5c1049]
perf[0x5c1197]
perf[0x5c7a4d]
perf[0x5c7ac7]
perf[0x531928]
perf[0x53196d]
perf[0x526a70]
perf[0x526b7d]
perf[0x585fd8]
perf[0x434503]
perf[0x5062c3]
perf[0x506532]
perf[0x506681]
perf[0x506978]
root@number:~#
Will try with gdb:
Lots of forks:
┌Merging related events...────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ [ [ from child process 2278982] │
[Detaching after fork from child process 2278983]─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
[Detaching after fork from child process 2278984]
[Detaching after fork from child process 2278985]
[Detaching after fork from child process 2278986]
[Detaching after fork from child process 2278987]
[Detaching after fork from child process 2278988]
[Detaching after fork from child process 2278989]
┌───────────────────────────┐ ▒
│Do you really want to exit?│ ▒
│ │ ▒
│Enter: Yes, ESC: No │ ▒
└───────────────────────────Program received signal SIGSEGV, Segmentation fault. ▒
0x00007ffff6ebd385 in __GI___libc_free (mem=0x69647225202c3866) at malloc.c:3368 ▒
Downloading source file /usr/src/debug/glibc-2.38-17.fc39.x86_64/malloc/malloc.c ▒
3368 if (chunk_is_mmapped (p)) /* release mmapped memory. */
(gdb)
and:
(gdb) bt
#0 0x00007ffff6ebd385 in __GI___libc_free (mem=0x69647225202c3866) at malloc.c:3368 ▒
#1 0x000000000066c2c0 in delete_data_type_histograms (adt=0x8dedf0c0) at util/annotate-data.c:1655 ▒
#2 0x000000000066c363 in annotated_data_type__tree_delete (root=0xe6bc68) at util/annotate-data.c:1669 ▒
#3 0x0000000000553bc5 in dso__delete (dso=0xe6bbd0) at util/dso.c:1376 ▒
#4 0x0000000000553d63 in dso__put (dso=0xe6bbd0) at util/dso.c:1409 ▒
#5 0x000000000057ed76 in __dso__zput (dso=0xf5b540) at util/dso.h:262 ▒
#6 0x000000000058027e in map__exit (map=0xf5b520) at util/map.c:300 ▒
#7 0x00000000005802bc in map__delete (map=0xf5b520) at util/map.c:305cord -b ... ; perf report --total-cycles ▒
#8 0x0000000000580325 in map__put (map=0xf5b520) at util/map.c:312
#9 0x00000000005818aa in __map__zput (map=0xf3e300) at util/map.h:196
#10 0x0000000000582241 in maps__exit (maps=0xf5aee0) at util/maps.c:246
#11 0x000000000058233c in maps__delete (maps=0xf5aee0) at util/maps.c:268
#12 0x00000000005823fd in maps__put (maps=0xf5aee0) at util/maps.c:285
#13 0x000000000055c4ca in __maps__zput (map=0x47856d8) at util/maps.h:32
#14 0x000000000055c55f in map_symbol__exit (ms=0x47856d8) at util/map_symbol.c:8
#15 0x00000000005c36bf in hist_entry__delete (he=0x4785660) at util/hist.c:1319
#16 0x00000000005c1049 in hists__delete_entry (hists=0xe68fe0, he=0x4785660) at util/hist.c:382
#17 0x00000000005c1197 in hists__delete_entries (hists=0xe68fe0) at util/hist.c:410
#18 0x00000000005c7a4d in hists__delete_all_entries (hists=0xe68fe0) at util/hist.c:2872
#19 0x00000000005c7ac7 in hists_evsel__exit (evsel=0xe68d70) at util/hist.c:2884
#20 0x0000000000531928 in evsel__exit (evsel=0xe68d70) at util/evsel.c:1489
#21 0x000000000053196d in evsel__delete (evsel=0xe68d70) at util/evsel.c:1497
#22 0x0000000000526a70 in evlist__purge (evlist=0xe67a00) at util/evlist.c:163
#23 0x0000000000526b7d in evlist__delete (evlist=0xe67a00) at util/evlist.c:185
#24 0x0000000000585fd8 in perf_session__delete (session=0xe670a0) at util/session.c:313
#25 0x0000000000434503 in cmd_report (argc=0, argv=0x7fffffffe430) at builtin-report.c:1828
#26 0x00000000005062c3 in run_builtin (p=0xe3f160 <commands+288>, argc=3, argv=0x7fffffffe430) at perf.c:350
#27 0x0000000000506532 in handle_internal_command (argc=3, argv=0x7fffffffe430) at perf.c:403
#28 0x0000000000506681 in run_argv (argcp=0x7fffffffe21c, argv=0x7fffffffe210) at perf.c:447
#29 0x0000000000506978 in main (argc=3, argv=0x7fffffffe430) at perf.c:561
(gdb)
Continuing...
On Wed, Apr 10, 2024 at 05:21:01PM -0300, Arnaldo Carvalho de Melo wrote:
> On Tue, Apr 09, 2024 at 04:49:57PM -0700, Namhyung Kim wrote:
> > Support data type profiling output on TUI.
>
> Added the follow to the commit log message, to make reviewing easier.
>
> As followup patches I think having the DSO name together with the type
> is important, also I think we could have a first menu with all the pairs
> of DSO/type, sorted top down by the types with most samples, wdyt?
>
> Applied.
>
There is something else here with the static build, checking...
[acme@toolbox perf-tools-next]$ git log --oneline -1 ; time make -C tools/perf build-test
4876ac6ab208b470 (HEAD -> perf-tools-next) perf tests: Remove dependency on lscpu
make: Entering directory '/home/acme/git/perf-tools-next/tools/perf'
- tarpkg: ./tests/perf-targz-src-pkg .
make_static: cd . && make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 NO_LIBTRACEEVENT=1 NO_LIBELF=1 -j28 DESTDIR=/tmp/tmp.jEtl6s5Npt
cd . && make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 NO_LIBTRACEEVENT=1 NO_LIBELF=1 -j28 DESTDIR=/tmp/tmp.jEtl6s5Npt
BUILD: Doing 'make -j28' parallel build
HOSTCC fixdep.o
HOSTLD fixdep-in.o
LINK fixdep
Warning: Kernel ABI header differences:
diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h
diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
diff -u tools/include/linux/bits.h include/linux/bits.h
diff -u tools/arch/x86/include/asm/disabled-features.h arch/x86/include/asm/disabled-features.h
diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h
diff -u tools/arch/powerpc/include/uapi/asm/kvm.h arch/powerpc/include/uapi/asm/kvm.h
diff -u tools/arch/s390/include/uapi/asm/kvm.h arch/s390/include/uapi/asm/kvm.h
diff -u tools/arch/arm64/include/uapi/asm/kvm.h arch/arm64/include/uapi/asm/kvm.h
diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h
diff -u tools/perf/trace/beauty/arch/x86/include/asm/irq_vectors.h arch/x86/include/asm/irq_vectors.h
diff -u tools/perf/trace/beauty/include/uapi/linux/fs.h include/uapi/linux/fs.h
diff -u tools/perf/trace/beauty/include/uapi/linux/vhost.h include/uapi/linux/vhost.h
diff -u tools/perf/trace/beauty/include/uapi/sound/asound.h include/uapi/sound/asound.h
Makefile.config:689: Warning: Disabled BPF skeletons as libelf is required by bpftool
Makefile.config:730: Disabling post unwind, no support found.
Makefile.config:798: No libcrypto.h found, disables jitted code injection, please install openssl-devel or libssl-dev
Makefile.config:810: slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev
Makefile.config:857: Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev
Makefile.config:897: No 'Python.h' was found: disables Python support - please install python-devel/python-dev
Makefile.config:997: No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev
Makefile.config:1010: No libzstd found, disables trace compression, please install libzstd-dev[el] and/or set LIBZSTD_DIR
Makefile.config:1021: No libcap found, disables capability support, please install libcap-devel/libcap-dev
Makefile.config:1034: No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev
Makefile.config:1093: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
Makefile.config:1105: No libcapstone found, disables disasm engine support for 'perf script', please install libcapstone-dev/capstone-devel
Makefile.config:1170: libpfm4 not found, disables libpfm4 support. Please install libpfm4-dev
Auto-detecting system features:
.. dwarf: [ OFF ]
.. dwarf_getlocations: [ OFF ]
.. glibc: [ on ]
.. libbfd: [ OFF ]
.. libbfd-buildid: [ OFF ]
.. libcap: [ OFF ]
.. libelf: [ OFF ]
.. libnuma: [ OFF ]
.. numa_num_possible_cpus: [ OFF ]
.. libperl: [ OFF ]
.. libpython: [ OFF ]
.. libcrypto: [ OFF ]
.. libunwind: [ OFF ]
.. libdw-dwarf-unwind: [ OFF ]
.. libcapstone: [ OFF ]
.. zlib: [ OFF ]
.. lzma: [ OFF ]
.. get_cpuid: [ on ]
.. bpf: [ on ]
.. libaio: [ on ]
.. libzstd: [ OFF ]
GEN common-cmds.h
CC dlfilters/dlfilter-test-api-v0.o
CC dlfilters/dlfilter-test-api-v2.o
CC dlfilters/dlfilter-show-cycles.o
LINK dlfilters/dlfilter-show-cycles.so
GEN /home/acme/git/perf-tools-next/tools/perf/arch/arm64/include/generated/asm/sysreg-defs.h
LINK dlfilters/dlfilter-test-api-v0.so
LINK dlfilters/dlfilter-test-api-v2.so
PERF_VERSION = 6.8.g4876ac6ab208
GEN perf-archive
GEN perf-iostat
INSTALL /home/acme/git/perf-tools-next/tools/perf/libsubcmd/include/subcmd/exec-cmd.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libsubcmd/include/subcmd/help.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libsubcmd/include/subcmd/pager.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libsubcmd/include/subcmd/parse-options.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libsubcmd/include/subcmd/run-command.h
CC /home/acme/git/perf-tools-next/tools/perf/libsubcmd/help.o
CC /home/acme/git/perf-tools-next/tools/perf/libsubcmd/exec-cmd.o
CC /home/acme/git/perf-tools-next/tools/perf/libsubcmd/pager.o
CC /home/acme/git/perf-tools-next/tools/perf/libsubcmd/parse-options.o
CC /home/acme/git/perf-tools-next/tools/perf/libsubcmd/run-command.o
CC /home/acme/git/perf-tools-next/tools/perf/libsubcmd/sigchain.o
CC /home/acme/git/perf-tools-next/tools/perf/libsubcmd/subcmd-config.o
INSTALL libsubcmd_headers
LD /home/acme/git/perf-tools-next/tools/perf/libsubcmd/libsubcmd-in.o
INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/perf/bpf_perf.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/perf/cpumap.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/perf/core.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libapi/include/api/cpu.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/perf/threadmap.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/perf/evlist.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/perf/event.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/perf/mmap.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/perf/evsel.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/internal/cpumap.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libapi/include/api/debug.h
CC /home/acme/git/perf-tools-next/tools/perf/libperf/core.o
INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/internal/evlist.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/internal/evsel.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libapi/include/api/fd/array.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libapi/include/api/io.h
CC /home/acme/git/perf-tools-next/tools/perf/libperf/cpumap.o
INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/internal/lib.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/internal/mmap.h
CC /home/acme/git/perf-tools-next/tools/perf/libperf/threadmap.o
INSTALL /home/acme/git/perf-tools-next/tools/perf/libapi/include/api/fs/fs.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libapi/include/api/fs/tracing_path.h
CC /home/acme/git/perf-tools-next/tools/perf/libperf/evsel.o
CC /home/acme/git/perf-tools-next/tools/perf/libperf/evlist.o
INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/internal/rc_check.h
INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/internal/threadmap.h
MKDIR /home/acme/git/perf-tools-next/tools/perf/libapi/fd/
INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/internal/xyarray.h
CC /home/acme/git/perf-tools-next/tools/perf/libperf/mmap.o
CC /home/acme/git/perf-tools-next/tools/perf/libapi/cpu.o
CC /home/acme/git/perf-tools-next/tools/perf/libperf/zalloc.o
CC /home/acme/git/perf-tools-next/tools/perf/libperf/xyarray.o
MKDIR /home/acme/git/perf-tools-next/tools/perf/libapi/fs/
CC /home/acme/git/perf-tools-next/tools/perf/libperf/lib.o
MKDIR /home/acme/git/perf-tools-next/tools/perf/libapi/fs/
INSTALL libapi_headers
CC /home/acme/git/perf-tools-next/tools/perf/libapi/fd/array.o
MKDIR /home/acme/git/perf-tools-next/tools/perf/libapi/fs/
INSTALL libperf_headers
CC /home/acme/git/perf-tools-next/tools/perf/libapi/debug.o
CC /home/acme/git/perf-tools-next/tools/perf/libapi/str_error_r.o
CC /home/acme/git/perf-tools-next/tools/perf/libapi/fs/fs.o
AR /home/acme/git/perf-tools-next/tools/perf/libsubcmd/libsubcmd.a
CC /home/acme/git/perf-tools-next/tools/perf/libapi/fs/tracing_path.o
CC /home/acme/git/perf-tools-next/tools/perf/libapi/fs/cgroup.o
INSTALL /home/acme/git/perf-tools-next/tools/perf/libsymbol/include/symbol/kallsyms.h
CC /home/acme/git/perf-tools-next/tools/perf/libsymbol/kallsyms.o
LD /home/acme/git/perf-tools-next/tools/perf/libperf/libperf-in.o
LD /home/acme/git/perf-tools-next/tools/perf/libapi/fd/libapi-in.o
INSTALL libsymbol_headers
LD /home/acme/git/perf-tools-next/tools/perf/libapi/fs/libapi-in.o
AR /home/acme/git/perf-tools-next/tools/perf/libperf/libperf.a
LD /home/acme/git/perf-tools-next/tools/perf/libsymbol/libsymbol-in.o
LD /home/acme/git/perf-tools-next/tools/perf/libapi/libapi-in.o
AR /home/acme/git/perf-tools-next/tools/perf/libsymbol/libsymbol.a
AR /home/acme/git/perf-tools-next/tools/perf/libapi/libapi.a
CC builtin-bench.o
CC builtin-annotate.o
CC builtin-config.o
CC builtin-diff.o
CC builtin-evlist.o
CC builtin-ftrace.o
CC builtin-help.o
CC builtin-buildid-list.o
CC builtin-buildid-cache.o
CC builtin-kallsyms.o
CC builtin-list.o
CC builtin-record.o
CC builtin-report.o
CC builtin-stat.o
CC builtin-top.o
CC builtin-script.o
CC builtin-kvm.o
CC builtin-inject.o
CC builtin-mem.o
TEST pmu-events/metric_test.log
CC builtin-data.o
CC builtin-version.o
CC builtin-c2c.o
CC builtin-daemon.o
CC bench/sched-messaging.o
CC arch/common.o
CC tests/builtin-test.o
CC perf.o
CC ui/setup.o
LD scripts/perf-in.o
CC tests/tests-scripts.o
CC bench/sched-pipe.o
CC tests/parse-events.o
CC ui/helpline.o
CC tests/dso-data.o
CC bench/sched-seccomp-notify.o
CC tests/attr.o
CC tests/vmlinux-kallsyms.o
CC ui/progress.o
CC bench/syscall.o
CC tests/perf-record.o
CC arch/x86/util/header.o
CC ui/util.o
CC bench/mem-functions.o
CC tests/evsel-roundtrip-name.o
CC tests/fdarray.o
CC tests/pmu.o
CC arch/x86/tests/arch-tests.o
CC ui/hist.o
CC bench/futex-hash.o
CC bench/futex-wake.o
CC bench/futex-wake-parallel.o
CC arch/x86/tests/sample-parsing.o
CC arch/x86/tests/hybrid.o
CC tests/pmu-events.o
CC arch/x86/tests/intel-pt-test.o
CC arch/x86/util/tsc.o
CC ui/stdio/hist.o
CC bench/futex-requeue.o
CC bench/futex-lock-pi.o
CC arch/x86/util/pmu.o
CC tests/hists_common.o
CC arch/x86/tests/bp-modify.o
CC arch/x86/util/perf_regs.o
CC arch/x86/util/topdown.o
CC bench/epoll-wait.o
CC arch/x86/tests/amd-ibs-via-core-pmu.o
CC arch/x86/util/machine.o
CC tests/hists_link.o
CC bench/epoll-ctl.o
CC arch/x86/util/event.o
CC bench/synthesize.o
CC tests/hists_filter.o
CC arch/x86/util/evlist.o
CC bench/kallsyms-parse.o
CC arch/x86/util/mem-events.o
CC bench/find-bit-bench.o
CC tests/hists_output.o
CC bench/inject-buildid.o
CC bench/evlist-open-close.o
CC tests/hists_cumulate.o
CC tests/python-use.o
CC bench/breakpoint.o
CC arch/x86/util/evsel.o
LD ui/perf-in.o
CC tests/bp_signal.o
CC arch/x86/util/iostat.o
CC bench/pmu-scan.o
CC bench/uprobe.o
CC arch/x86/util/env.o
CC util/arm64-frame-pointer-unwind-support.o
CC util/addr_location.o
CC bench/mem-memcpy-x86-64-asm.o
LD arch/x86/tests/perf-in.o
CC tests/bp_signal_overflow.o
CC arch/x86/util/auxtrace.o
CC bench/mem-memset-x86-64-asm.o
CC arch/x86/util/archinsn.o
CC tests/bp_account.o
CC arch/x86/util/intel-pt.o
CC util/annotate.o
CC arch/x86/util/intel-bts.o
CC util/block-info.o
CC tests/wp.o
CC util/block-range.o
CC util/build-id.o
CC tests/task-exit.o
CC util/cacheline.o
CC util/config.o
CC tests/sw-clock.o
CC util/copyfile.o
CC tests/mmap-thread-lookup.o
CC util/ctype.o
CC tests/thread-maps-share.o
CC tests/keep-tracking.o
CC util/db-export.o
CC tests/code-reading.o
CC util/disasm.o
LD bench/perf-in.o
CC util/env.o
CC tests/sample-parsing.o
CC util/event.o
CC tests/parse-no-sample-id-all.o
CC tests/kmod-path.o
CC tests/thread-map.o
CC util/evlist.o
CC tests/topology.o
CC util/sideband_evlist.o
LD arch/x86/util/perf-in.o
CC util/evsel.o
CC tests/mem.o
CC util/evsel_fprintf.o
CC tests/cpumap.o
CC tests/stat.o
CC util/perf_event_attr_fprintf.o
CC tests/event_update.o
CC util/evswitch.o
CC tests/event-times.o
CC util/find_bit.o
CC tests/expr.o
CC util/get_current_dir_name.o
CC tests/backward-ring-buffer.o
CC util/levenshtein.o
CC tests/sdt.o
CC tests/is_printable_array.o
CC util/mmap.o
LD arch/x86/perf-in.o
CC util/memswap.o
CC tests/bitmap.o
BISON util/parse-events-bison.c
CC tests/perf-hooks.o
CC util/print-events.o
CC tests/unit_number__scnprintf.o
CC util/tracepoint.o
CC util/perf_regs.o
CC tests/mem2node.o
CC util/perf-regs-arch/perf_regs_aarch64.o
LD arch/perf-in.o
CC tests/maps.o
CC util/perf-regs-arch/perf_regs_arm.o
CC tests/time-utils-test.o
CC util/arm-spe-decoder/arm-spe-pkt-decoder.o
CC util/intel-pt-decoder/intel-pt-pkt-decoder.o
CC util/arm-spe-decoder/arm-spe-decoder.o
CC tests/genelf.o
CC util/perf-regs-arch/perf_regs_csky.o
CC tests/api-io.o
GEN util/intel-pt-decoder/inat-tables.c
CC tests/demangle-java-test.o
CC util/perf-regs-arch/perf_regs_loongarch.o
CC util/path.o
CC util/perf-regs-arch/perf_regs_mips.o
CC tests/demangle-ocaml-test.o
CC util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.o
LD util/scripting-engines/perf-in.o
CC util/perf-regs-arch/perf_regs_powerpc.o
CC util/print_binary.o
CC tests/pfm.o
CC util/perf-regs-arch/perf_regs_riscv.o
CC util/intel-pt-decoder/intel-pt-log.o
CC util/intel-pt-decoder/intel-pt-decoder.o
CC util/perf-regs-arch/perf_regs_s390.o
CC util/print_insn.o
CC tests/parse-metric.o
CC util/perf-regs-arch/perf_regs_x86.o
CC tests/pe-file-parsing.o
CC tests/expand-cgroup.o
CC util/rlimit.o
CC tests/perf-time-to-tsc.o
CC tests/dlfilter-test.o
CC util/argv_split.o
LD util/arm-spe-decoder/perf-in.o
CC tests/sigtrap.o
CC util/rbtree.o
CC util/libstring.o
CC tests/event_groups.o
CC util/bitmap.o
LD util/hisi-ptt-decoder/perf-in.o
CC util/hweight.o
CC util/smt.o
CC tests/symbols.o
CC tests/util.o
LD util/perf-regs-arch/perf-in.o
CC util/strbuf.o
CC util/string.o
CC util/strlist.o
CC util/strfilter.o
CC util/top.o
CC util/usage.o
CC tests/workloads/noploop.o
GEN pmu-events/pmu-events.c
CC util/dso.o
CC tests/workloads/thloop.o
CC util/dsos.o
CC tests/workloads/leafloop.o
CC tests/workloads/sqrtloop.o
CC tests/workloads/brstack.o
CC util/symbol.o
CC tests/workloads/datasym.o
CC util/symbol_fprintf.o
CC util/map_symbol.o
CC util/color.o
CC util/color_config.o
CC util/intel-pt-decoder/intel-pt-insn-decoder.o
CC util/metricgroup.o
CC util/header.o
CC util/callchain.o
CC util/values.o
CC util/debug.o
CC util/fncache.o
CC util/machine.o
LD tests/workloads/perf-in.o
CC util/map.o
CC util/maps.o
CC util/pstack.o
CC util/session.o
LD util/intel-pt-decoder/perf-in.o
CC util/sample-raw.o
CC util/s390-sample-raw.o
CC util/amd-sample-raw.o
LD tests/perf-in.o
CC util/ordered-events.o
CC util/namespaces.o
CC util/comm.o
CC util/threads.o
CC util/thread.o
CC util/thread_map.o
BISON util/pmu-bison.c
CC util/pmus.o
CC util/svghelper.o
CC util/trace-event-scripting.o
CC util/sort.o
CC util/hist.o
CC util/util.o
CC util/cpumap.o
CC util/affinity.o
CC util/cputopo.o
CC util/cgroup.o
CC util/target.o
CC util/rblist.o
CC util/intlist.o
CC util/vdso.o
CC util/counts.o
CC util/stat.o
CC util/stat-shadow.o
CC util/stat-display.o
CC util/perf_api_probe.o
CC util/record.o
CC util/srcline.o
CC util/srccode.o
CC util/synthetic-events.o
CC util/data.o
CC util/tsc.o
CC util/cloexec.o
CC util/call-path.o
CC util/rwsem.o
CC util/thread-stack.o
CC util/spark.o
CC util/topdown.o
CC util/iostat.o
CC util/stream.o
CC util/auxtrace.o
CC util/intel-pt.o
CC util/intel-bts.o
CC util/arm-spe.o
CC util/hisi-ptt.o
CC util/s390-cpumsf.o
CC util/cs-etm-base.o
CC util/parse-branch-options.o
CC util/dump-insn.o
CC util/parse-regs-options.o
CC util/parse-sublevel-options.o
CC util/term.o
CC util/help-unknown-cmd.o
CC util/dlfilter.o
CC util/mem-events.o
CC util/vsprintf.o
CC util/units.o
CC util/time-utils.o
BISON util/expr-bison.c
CC util/branch.o
CC util/mem2node.o
CC util/clockid.o
CC util/list_sort.o
CC util/mutex.o
CC util/sharded_mutex.o
CC util/hashmap.o
CC util/symbol-minimal.o
CC util/data-convert-json.o
CC util/demangle-ocaml.o
CC util/demangle-java.o
CC util/demangle-rust.o
CC util/perf-hooks.o
FLEX util/parse-events-flex.c
FLEX util/pmu-flex.c
CC util/parse-events-bison.o
CC util/pmu-bison.o
CC util/pmu.o
CC util/pmu-flex.o
CC util/parse-events.o
CC util/parse-events-flex.o
FLEX util/expr-flex.c
CC util/expr-bison.o
CC util/expr-flex.o
CC util/expr.o
LD util/perf-in.o
LD perf-in.o
CC pmu-events/pmu-events.o
LD pmu-events/pmu-events-in.o
LINK perf
/usr/bin/ld: perf-in.o: in function `dlfilter__new':
(.text+0x145617): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: perf-in.o: in function `target__parse_uid':
(.text+0x108cfe): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: (.text+0x108d7b): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: perf-in.o: in function `hists__find_annotations':
builtin-annotate.c:(.text+0x95f): undefined reference to `hist_entry__annotate_data_tty'
/usr/bin/ld: builtin-annotate.c:(.text+0xad3): undefined reference to `hist_entry__annotate_data_tui'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile.perf:733: perf] Error 1
make[3]: *** [Makefile.perf:264: sub-make] Error 2
make[2]: *** [Makefile:70: all] Error 2
test: test -x ./perf
make[1]: *** [tests/make:330: make_static] Error 1
make: *** [Makefile:103: build-test] Error 2
make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf'
real 0m21.481s
user 1m35.872s
sys 0m22.854s
⬢[acme@toolbox perf-tools-next]$
On Wed, Apr 10, 2024 at 06:04:26PM -0300, Arnaldo Carvalho de Melo wrote:
> On Wed, Apr 10, 2024 at 05:21:01PM -0300, Arnaldo Carvalho de Melo wrote:
> > On Tue, Apr 09, 2024 at 04:49:57PM -0700, Namhyung Kim wrote:
> > > Support data type profiling output on TUI.
> >
> > Added the follow to the commit log message, to make reviewing easier.
> >
> > As followup patches I think having the DSO name together with the type
> > is important, also I think we could have a first menu with all the pairs
> > of DSO/type, sorted top down by the types with most samples, wdyt?
> >
> > Applied.
> >
>
> There is something else here with the static build, checking...
Probably because of:
Makefile.config:810: slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev
Fixing...
- Arnaldo
> [acme@toolbox perf-tools-next]$ git log --oneline -1 ; time make -C tools/perf build-test
> 4876ac6ab208b470 (HEAD -> perf-tools-next) perf tests: Remove dependency on lscpu
> make: Entering directory '/home/acme/git/perf-tools-next/tools/perf'
> - tarpkg: ./tests/perf-targz-src-pkg .
> make_static: cd . && make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 NO_LIBTRACEEVENT=1 NO_LIBELF=1 -j28 DESTDIR=/tmp/tmp.jEtl6s5Npt
> cd . && make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 NO_LIBTRACEEVENT=1 NO_LIBELF=1 -j28 DESTDIR=/tmp/tmp.jEtl6s5Npt
> BUILD: Doing 'make -j28' parallel build
> HOSTCC fixdep.o
> HOSTLD fixdep-in.o
> LINK fixdep
> Warning: Kernel ABI header differences:
> diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h
> diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
> diff -u tools/include/linux/bits.h include/linux/bits.h
> diff -u tools/arch/x86/include/asm/disabled-features.h arch/x86/include/asm/disabled-features.h
> diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
> diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
> diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h
> diff -u tools/arch/powerpc/include/uapi/asm/kvm.h arch/powerpc/include/uapi/asm/kvm.h
> diff -u tools/arch/s390/include/uapi/asm/kvm.h arch/s390/include/uapi/asm/kvm.h
> diff -u tools/arch/arm64/include/uapi/asm/kvm.h arch/arm64/include/uapi/asm/kvm.h
> diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h
> diff -u tools/perf/trace/beauty/arch/x86/include/asm/irq_vectors.h arch/x86/include/asm/irq_vectors.h
> diff -u tools/perf/trace/beauty/include/uapi/linux/fs.h include/uapi/linux/fs.h
> diff -u tools/perf/trace/beauty/include/uapi/linux/vhost.h include/uapi/linux/vhost.h
> diff -u tools/perf/trace/beauty/include/uapi/sound/asound.h include/uapi/sound/asound.h
> Makefile.config:689: Warning: Disabled BPF skeletons as libelf is required by bpftool
> Makefile.config:730: Disabling post unwind, no support found.
> Makefile.config:798: No libcrypto.h found, disables jitted code injection, please install openssl-devel or libssl-dev
> Makefile.config:810: slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev
> Makefile.config:857: Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev
> Makefile.config:897: No 'Python.h' was found: disables Python support - please install python-devel/python-dev
> Makefile.config:997: No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev
> Makefile.config:1010: No libzstd found, disables trace compression, please install libzstd-dev[el] and/or set LIBZSTD_DIR
> Makefile.config:1021: No libcap found, disables capability support, please install libcap-devel/libcap-dev
> Makefile.config:1034: No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev
> Makefile.config:1093: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
> Makefile.config:1105: No libcapstone found, disables disasm engine support for 'perf script', please install libcapstone-dev/capstone-devel
> Makefile.config:1170: libpfm4 not found, disables libpfm4 support. Please install libpfm4-dev
>
> Auto-detecting system features:
> ... dwarf: [ OFF ]
> ... dwarf_getlocations: [ OFF ]
> ... glibc: [ on ]
> ... libbfd: [ OFF ]
> ... libbfd-buildid: [ OFF ]
> ... libcap: [ OFF ]
> ... libelf: [ OFF ]
> ... libnuma: [ OFF ]
> ... numa_num_possible_cpus: [ OFF ]
> ... libperl: [ OFF ]
> ... libpython: [ OFF ]
> ... libcrypto: [ OFF ]
> ... libunwind: [ OFF ]
> ... libdw-dwarf-unwind: [ OFF ]
> ... libcapstone: [ OFF ]
> ... zlib: [ OFF ]
> ... lzma: [ OFF ]
> ... get_cpuid: [ on ]
> ... bpf: [ on ]
> ... libaio: [ on ]
> ... libzstd: [ OFF ]
>
> GEN common-cmds.h
> CC dlfilters/dlfilter-test-api-v0.o
> CC dlfilters/dlfilter-test-api-v2.o
> CC dlfilters/dlfilter-show-cycles.o
> LINK dlfilters/dlfilter-show-cycles.so
> GEN /home/acme/git/perf-tools-next/tools/perf/arch/arm64/include/generated/asm/sysreg-defs.h
> LINK dlfilters/dlfilter-test-api-v0.so
> LINK dlfilters/dlfilter-test-api-v2.so
> PERF_VERSION = 6.8.g4876ac6ab208
> GEN perf-archive
> GEN perf-iostat
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libsubcmd/include/subcmd/exec-cmd.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libsubcmd/include/subcmd/help.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libsubcmd/include/subcmd/pager.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libsubcmd/include/subcmd/parse-options.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libsubcmd/include/subcmd/run-command.h
> CC /home/acme/git/perf-tools-next/tools/perf/libsubcmd/help.o
> CC /home/acme/git/perf-tools-next/tools/perf/libsubcmd/exec-cmd.o
> CC /home/acme/git/perf-tools-next/tools/perf/libsubcmd/pager.o
> CC /home/acme/git/perf-tools-next/tools/perf/libsubcmd/parse-options.o
> CC /home/acme/git/perf-tools-next/tools/perf/libsubcmd/run-command.o
> CC /home/acme/git/perf-tools-next/tools/perf/libsubcmd/sigchain.o
> CC /home/acme/git/perf-tools-next/tools/perf/libsubcmd/subcmd-config.o
> INSTALL libsubcmd_headers
> LD /home/acme/git/perf-tools-next/tools/perf/libsubcmd/libsubcmd-in.o
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/perf/bpf_perf.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/perf/cpumap.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/perf/core.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libapi/include/api/cpu.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/perf/threadmap.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/perf/evlist.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/perf/event.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/perf/mmap.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/perf/evsel.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/internal/cpumap.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libapi/include/api/debug.h
> CC /home/acme/git/perf-tools-next/tools/perf/libperf/core.o
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/internal/evlist.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/internal/evsel.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libapi/include/api/fd/array.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libapi/include/api/io.h
> CC /home/acme/git/perf-tools-next/tools/perf/libperf/cpumap.o
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/internal/lib.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/internal/mmap.h
> CC /home/acme/git/perf-tools-next/tools/perf/libperf/threadmap.o
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libapi/include/api/fs/fs.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libapi/include/api/fs/tracing_path.h
> CC /home/acme/git/perf-tools-next/tools/perf/libperf/evsel.o
> CC /home/acme/git/perf-tools-next/tools/perf/libperf/evlist.o
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/internal/rc_check.h
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/internal/threadmap.h
> MKDIR /home/acme/git/perf-tools-next/tools/perf/libapi/fd/
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libperf/include/internal/xyarray.h
> CC /home/acme/git/perf-tools-next/tools/perf/libperf/mmap.o
> CC /home/acme/git/perf-tools-next/tools/perf/libapi/cpu.o
> CC /home/acme/git/perf-tools-next/tools/perf/libperf/zalloc.o
> CC /home/acme/git/perf-tools-next/tools/perf/libperf/xyarray.o
> MKDIR /home/acme/git/perf-tools-next/tools/perf/libapi/fs/
> CC /home/acme/git/perf-tools-next/tools/perf/libperf/lib.o
> MKDIR /home/acme/git/perf-tools-next/tools/perf/libapi/fs/
> INSTALL libapi_headers
> CC /home/acme/git/perf-tools-next/tools/perf/libapi/fd/array.o
> MKDIR /home/acme/git/perf-tools-next/tools/perf/libapi/fs/
> INSTALL libperf_headers
> CC /home/acme/git/perf-tools-next/tools/perf/libapi/debug.o
> CC /home/acme/git/perf-tools-next/tools/perf/libapi/str_error_r.o
> CC /home/acme/git/perf-tools-next/tools/perf/libapi/fs/fs.o
> AR /home/acme/git/perf-tools-next/tools/perf/libsubcmd/libsubcmd.a
> CC /home/acme/git/perf-tools-next/tools/perf/libapi/fs/tracing_path.o
> CC /home/acme/git/perf-tools-next/tools/perf/libapi/fs/cgroup.o
> INSTALL /home/acme/git/perf-tools-next/tools/perf/libsymbol/include/symbol/kallsyms.h
> CC /home/acme/git/perf-tools-next/tools/perf/libsymbol/kallsyms.o
> LD /home/acme/git/perf-tools-next/tools/perf/libperf/libperf-in.o
> LD /home/acme/git/perf-tools-next/tools/perf/libapi/fd/libapi-in.o
> INSTALL libsymbol_headers
> LD /home/acme/git/perf-tools-next/tools/perf/libapi/fs/libapi-in.o
> AR /home/acme/git/perf-tools-next/tools/perf/libperf/libperf.a
> LD /home/acme/git/perf-tools-next/tools/perf/libsymbol/libsymbol-in.o
> LD /home/acme/git/perf-tools-next/tools/perf/libapi/libapi-in.o
> AR /home/acme/git/perf-tools-next/tools/perf/libsymbol/libsymbol.a
> AR /home/acme/git/perf-tools-next/tools/perf/libapi/libapi.a
> CC builtin-bench.o
> CC builtin-annotate.o
> CC builtin-config.o
> CC builtin-diff.o
> CC builtin-evlist.o
> CC builtin-ftrace.o
> CC builtin-help.o
> CC builtin-buildid-list.o
> CC builtin-buildid-cache.o
> CC builtin-kallsyms.o
> CC builtin-list.o
> CC builtin-record.o
> CC builtin-report.o
> CC builtin-stat.o
> CC builtin-top.o
> CC builtin-script.o
> CC builtin-kvm.o
> CC builtin-inject.o
> CC builtin-mem.o
> TEST pmu-events/metric_test.log
> CC builtin-data.o
> CC builtin-version.o
> CC builtin-c2c.o
> CC builtin-daemon.o
> CC bench/sched-messaging.o
> CC arch/common.o
> CC tests/builtin-test.o
> CC perf.o
> CC ui/setup.o
> LD scripts/perf-in.o
> CC tests/tests-scripts.o
> CC bench/sched-pipe.o
> CC tests/parse-events.o
> CC ui/helpline.o
> CC tests/dso-data.o
> CC bench/sched-seccomp-notify.o
> CC tests/attr.o
> CC tests/vmlinux-kallsyms.o
> CC ui/progress.o
> CC bench/syscall.o
> CC tests/perf-record.o
> CC arch/x86/util/header.o
> CC ui/util.o
> CC bench/mem-functions.o
> CC tests/evsel-roundtrip-name.o
> CC tests/fdarray.o
> CC tests/pmu.o
> CC arch/x86/tests/arch-tests.o
> CC ui/hist.o
> CC bench/futex-hash.o
> CC bench/futex-wake.o
> CC bench/futex-wake-parallel.o
> CC arch/x86/tests/sample-parsing.o
> CC arch/x86/tests/hybrid.o
> CC tests/pmu-events.o
> CC arch/x86/tests/intel-pt-test.o
> CC arch/x86/util/tsc.o
> CC ui/stdio/hist.o
> CC bench/futex-requeue.o
> CC bench/futex-lock-pi.o
> CC arch/x86/util/pmu.o
> CC tests/hists_common.o
> CC arch/x86/tests/bp-modify.o
> CC arch/x86/util/perf_regs.o
> CC arch/x86/util/topdown.o
> CC bench/epoll-wait.o
> CC arch/x86/tests/amd-ibs-via-core-pmu.o
> CC arch/x86/util/machine.o
> CC tests/hists_link.o
> CC bench/epoll-ctl.o
> CC arch/x86/util/event.o
> CC bench/synthesize.o
> CC tests/hists_filter.o
> CC arch/x86/util/evlist.o
> CC bench/kallsyms-parse.o
> CC arch/x86/util/mem-events.o
> CC bench/find-bit-bench.o
> CC tests/hists_output.o
> CC bench/inject-buildid.o
> CC bench/evlist-open-close.o
> CC tests/hists_cumulate.o
> CC tests/python-use.o
> CC bench/breakpoint.o
> CC arch/x86/util/evsel.o
> LD ui/perf-in.o
> CC tests/bp_signal.o
> CC arch/x86/util/iostat.o
> CC bench/pmu-scan.o
> CC bench/uprobe.o
> CC arch/x86/util/env.o
> CC util/arm64-frame-pointer-unwind-support.o
> CC util/addr_location.o
> CC bench/mem-memcpy-x86-64-asm.o
> LD arch/x86/tests/perf-in.o
> CC tests/bp_signal_overflow.o
> CC arch/x86/util/auxtrace.o
> CC bench/mem-memset-x86-64-asm.o
> CC arch/x86/util/archinsn.o
> CC tests/bp_account.o
> CC arch/x86/util/intel-pt.o
> CC util/annotate.o
> CC arch/x86/util/intel-bts.o
> CC util/block-info.o
> CC tests/wp.o
> CC util/block-range.o
> CC util/build-id.o
> CC tests/task-exit.o
> CC util/cacheline.o
> CC util/config.o
> CC tests/sw-clock.o
> CC util/copyfile.o
> CC tests/mmap-thread-lookup.o
> CC util/ctype.o
> CC tests/thread-maps-share.o
> CC tests/keep-tracking.o
> CC util/db-export.o
> CC tests/code-reading.o
> CC util/disasm.o
> LD bench/perf-in.o
> CC util/env.o
> CC tests/sample-parsing.o
> CC util/event.o
> CC tests/parse-no-sample-id-all.o
> CC tests/kmod-path.o
> CC tests/thread-map.o
> CC util/evlist.o
> CC tests/topology.o
> CC util/sideband_evlist.o
> LD arch/x86/util/perf-in.o
> CC util/evsel.o
> CC tests/mem.o
> CC util/evsel_fprintf.o
> CC tests/cpumap.o
> CC tests/stat.o
> CC util/perf_event_attr_fprintf.o
> CC tests/event_update.o
> CC util/evswitch.o
> CC tests/event-times.o
> CC util/find_bit.o
> CC tests/expr.o
> CC util/get_current_dir_name.o
> CC tests/backward-ring-buffer.o
> CC util/levenshtein.o
> CC tests/sdt.o
> CC tests/is_printable_array.o
> CC util/mmap.o
> LD arch/x86/perf-in.o
> CC util/memswap.o
> CC tests/bitmap.o
> BISON util/parse-events-bison.c
> CC tests/perf-hooks.o
> CC util/print-events.o
> CC tests/unit_number__scnprintf.o
> CC util/tracepoint.o
> CC util/perf_regs.o
> CC tests/mem2node.o
> CC util/perf-regs-arch/perf_regs_aarch64.o
> LD arch/perf-in.o
> CC tests/maps.o
> CC util/perf-regs-arch/perf_regs_arm.o
> CC tests/time-utils-test.o
> CC util/arm-spe-decoder/arm-spe-pkt-decoder.o
> CC util/intel-pt-decoder/intel-pt-pkt-decoder.o
> CC util/arm-spe-decoder/arm-spe-decoder.o
> CC tests/genelf.o
> CC util/perf-regs-arch/perf_regs_csky.o
> CC tests/api-io.o
> GEN util/intel-pt-decoder/inat-tables.c
> CC tests/demangle-java-test.o
> CC util/perf-regs-arch/perf_regs_loongarch.o
> CC util/path.o
> CC util/perf-regs-arch/perf_regs_mips.o
> CC tests/demangle-ocaml-test.o
> CC util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.o
> LD util/scripting-engines/perf-in.o
> CC util/perf-regs-arch/perf_regs_powerpc.o
> CC util/print_binary.o
> CC tests/pfm.o
> CC util/perf-regs-arch/perf_regs_riscv.o
> CC util/intel-pt-decoder/intel-pt-log.o
> CC util/intel-pt-decoder/intel-pt-decoder.o
> CC util/perf-regs-arch/perf_regs_s390.o
> CC util/print_insn.o
> CC tests/parse-metric.o
> CC util/perf-regs-arch/perf_regs_x86.o
> CC tests/pe-file-parsing.o
> CC tests/expand-cgroup.o
> CC util/rlimit.o
> CC tests/perf-time-to-tsc.o
> CC tests/dlfilter-test.o
> CC util/argv_split.o
> LD util/arm-spe-decoder/perf-in.o
> CC tests/sigtrap.o
> CC util/rbtree.o
> CC util/libstring.o
> CC tests/event_groups.o
> CC util/bitmap.o
> LD util/hisi-ptt-decoder/perf-in.o
> CC util/hweight.o
> CC util/smt.o
> CC tests/symbols.o
> CC tests/util.o
> LD util/perf-regs-arch/perf-in.o
> CC util/strbuf.o
> CC util/string.o
> CC util/strlist.o
> CC util/strfilter.o
> CC util/top.o
> CC util/usage.o
> CC tests/workloads/noploop.o
> GEN pmu-events/pmu-events.c
> CC util/dso.o
> CC tests/workloads/thloop.o
> CC util/dsos.o
> CC tests/workloads/leafloop.o
> CC tests/workloads/sqrtloop.o
> CC tests/workloads/brstack.o
> CC util/symbol.o
> CC tests/workloads/datasym.o
> CC util/symbol_fprintf.o
> CC util/map_symbol.o
> CC util/color.o
> CC util/color_config.o
> CC util/intel-pt-decoder/intel-pt-insn-decoder.o
> CC util/metricgroup.o
> CC util/header.o
> CC util/callchain.o
> CC util/values.o
> CC util/debug.o
> CC util/fncache.o
> CC util/machine.o
> LD tests/workloads/perf-in.o
> CC util/map.o
> CC util/maps.o
> CC util/pstack.o
> CC util/session.o
> LD util/intel-pt-decoder/perf-in.o
> CC util/sample-raw.o
> CC util/s390-sample-raw.o
> CC util/amd-sample-raw.o
> LD tests/perf-in.o
> CC util/ordered-events.o
> CC util/namespaces.o
> CC util/comm.o
> CC util/threads.o
> CC util/thread.o
> CC util/thread_map.o
> BISON util/pmu-bison.c
> CC util/pmus.o
> CC util/svghelper.o
> CC util/trace-event-scripting.o
> CC util/sort.o
> CC util/hist.o
> CC util/util.o
> CC util/cpumap.o
> CC util/affinity.o
> CC util/cputopo.o
> CC util/cgroup.o
> CC util/target.o
> CC util/rblist.o
> CC util/intlist.o
> CC util/vdso.o
> CC util/counts.o
> CC util/stat.o
> CC util/stat-shadow.o
> CC util/stat-display.o
> CC util/perf_api_probe.o
> CC util/record.o
> CC util/srcline.o
> CC util/srccode.o
> CC util/synthetic-events.o
> CC util/data.o
> CC util/tsc.o
> CC util/cloexec.o
> CC util/call-path.o
> CC util/rwsem.o
> CC util/thread-stack.o
> CC util/spark.o
> CC util/topdown.o
> CC util/iostat.o
> CC util/stream.o
> CC util/auxtrace.o
> CC util/intel-pt.o
> CC util/intel-bts.o
> CC util/arm-spe.o
> CC util/hisi-ptt.o
> CC util/s390-cpumsf.o
> CC util/cs-etm-base.o
> CC util/parse-branch-options.o
> CC util/dump-insn.o
> CC util/parse-regs-options.o
> CC util/parse-sublevel-options.o
> CC util/term.o
> CC util/help-unknown-cmd.o
> CC util/dlfilter.o
> CC util/mem-events.o
> CC util/vsprintf.o
> CC util/units.o
> CC util/time-utils.o
> BISON util/expr-bison.c
> CC util/branch.o
> CC util/mem2node.o
> CC util/clockid.o
> CC util/list_sort.o
> CC util/mutex.o
> CC util/sharded_mutex.o
> CC util/hashmap.o
> CC util/symbol-minimal.o
> CC util/data-convert-json.o
> CC util/demangle-ocaml.o
> CC util/demangle-java.o
> CC util/demangle-rust.o
> CC util/perf-hooks.o
> FLEX util/parse-events-flex.c
> FLEX util/pmu-flex.c
> CC util/parse-events-bison.o
> CC util/pmu-bison.o
> CC util/pmu.o
> CC util/pmu-flex.o
> CC util/parse-events.o
> CC util/parse-events-flex.o
> FLEX util/expr-flex.c
> CC util/expr-bison.o
> CC util/expr-flex.o
> CC util/expr.o
> LD util/perf-in.o
> LD perf-in.o
> CC pmu-events/pmu-events.o
> LD pmu-events/pmu-events-in.o
> LINK perf
> /usr/bin/ld: perf-in.o: in function `dlfilter__new':
> (.text+0x145617): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
> /usr/bin/ld: perf-in.o: in function `target__parse_uid':
> (.text+0x108cfe): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
> /usr/bin/ld: (.text+0x108d7b): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
> /usr/bin/ld: perf-in.o: in function `hists__find_annotations':
> builtin-annotate.c:(.text+0x95f): undefined reference to `hist_entry__annotate_data_tty'
> /usr/bin/ld: builtin-annotate.c:(.text+0xad3): undefined reference to `hist_entry__annotate_data_tui'
> collect2: error: ld returned 1 exit status
> make[4]: *** [Makefile.perf:733: perf] Error 1
> make[3]: *** [Makefile.perf:264: sub-make] Error 2
> make[2]: *** [Makefile:70: all] Error 2
> test: test -x ./perf
> make[1]: *** [tests/make:330: make_static] Error 1
> make: *** [Makefile:103: build-test] Error 2
> make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf'
>
> real 0m21.481s
> user 1m35.872s
> sys 0m22.854s
> ⬢[acme@toolbox perf-tools-next]$
>
>
On Wed, Apr 10, 2024 at 06:05:27PM -0300, Arnaldo Carvalho de Melo wrote:
> On Wed, Apr 10, 2024 at 06:04:26PM -0300, Arnaldo Carvalho de Melo wrote:
> > On Wed, Apr 10, 2024 at 05:21:01PM -0300, Arnaldo Carvalho de Melo wrote:
> > > On Tue, Apr 09, 2024 at 04:49:57PM -0700, Namhyung Kim wrote:
> > > > Support data type profiling output on TUI.
> > >
> > > Added the follow to the commit log message, to make reviewing easier.
> > >
> > > As followup patches I think having the DSO name together with the type
> > > is important, also I think we could have a first menu with all the pairs
> > > of DSO/type, sorted top down by the types with most samples, wdyt?
> > >
> > > Applied.
> > >
> >
> > There is something else here with the static build, checking...
>
> Probably because of:
>
> Makefile.config:810: slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev
>
> Fixing...
Trying with:
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 6f7104f06c42d98a..458eafe65e4aa16f 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -469,9 +469,11 @@ static void hists__find_annotations(struct hists *hists,
goto find_next;
}
+#ifdef HAVE_SLANG_SUPPORT
if (use_browser == 1)
key = hist_entry__annotate_data_tui(he, evsel, NULL);
else
+#endif
key = hist_entry__annotate_data_tty(he, evsel);
switch (key) {
On Wed, Apr 10, 2024 at 06:12:32PM -0300, Arnaldo Carvalho de Melo wrote:
> On Wed, Apr 10, 2024 at 06:05:27PM -0300, Arnaldo Carvalho de Melo wrote:
> > On Wed, Apr 10, 2024 at 06:04:26PM -0300, Arnaldo Carvalho de Melo wrote:
> > > On Wed, Apr 10, 2024 at 05:21:01PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > On Tue, Apr 09, 2024 at 04:49:57PM -0700, Namhyung Kim wrote:
> > > > > Support data type profiling output on TUI.
> > > >
> > > > Added the follow to the commit log message, to make reviewing easier.
> > > >
> > > > As followup patches I think having the DSO name together with the type
> > > > is important, also I think we could have a first menu with all the pairs
> > > > of DSO/type, sorted top down by the types with most samples, wdyt?
> > > >
> > > > Applied.
> > > >
> > >
> > > There is something else here with the static build, checking...
> >
> > Probably because of:
> >
> > Makefile.config:810: slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev
> >
> > Fixing...
>
> Trying with:
Not really, I need to check for HAVE_DWARF_SUPPORT as well? Doing that
- Arnaldo
> diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
> index 6f7104f06c42d98a..458eafe65e4aa16f 100644
> --- a/tools/perf/builtin-annotate.c
> +++ b/tools/perf/builtin-annotate.c
> @@ -469,9 +469,11 @@ static void hists__find_annotations(struct hists *hists,
> goto find_next;
> }
>
> +#ifdef HAVE_SLANG_SUPPORT
> if (use_browser == 1)
> key = hist_entry__annotate_data_tui(he, evsel, NULL);
> else
> +#endif
> key = hist_entry__annotate_data_tty(he, evsel);
>
> switch (key) {
On Wed, Apr 10, 2024 at 06:17:16PM -0300, Arnaldo Carvalho de Melo wrote:
> On Wed, Apr 10, 2024 at 06:12:32PM -0300, Arnaldo Carvalho de Melo wrote:
> > On Wed, Apr 10, 2024 at 06:05:27PM -0300, Arnaldo Carvalho de Melo wrote:
> > > On Wed, Apr 10, 2024 at 06:04:26PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > On Wed, Apr 10, 2024 at 05:21:01PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > > On Tue, Apr 09, 2024 at 04:49:57PM -0700, Namhyung Kim wrote:
> > > > > > Support data type profiling output on TUI.
> > > > >
> > > > > Added the follow to the commit log message, to make reviewing easier.
> > > > >
> > > > > As followup patches I think having the DSO name together with the type
> > > > > is important, also I think we could have a first menu with all the pairs
> > > > > of DSO/type, sorted top down by the types with most samples, wdyt?
> > > > >
> > > > > Applied.
> > > > >
> > > >
> > > > There is something else here with the static build, checking...
> > >
> > > Probably because of:
> > >
> > > Makefile.config:810: slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev
> > >
> > > Fixing...
> >
> > Trying with:
>
> Not really, I need to check for HAVE_DWARF_SUPPORT as well? Doing that
Attempting with:
⬢[acme@toolbox perf-tools-next]$ git diff
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 458eafe65e4aa16f..521ec7e226e29e6b 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -469,7 +469,7 @@ static void hists__find_annotations(struct hists *hists,
goto find_next;
}
-#ifdef HAVE_SLANG_SUPPORT
+#if defined(HAVE_SLANG_SUPPORT) && defined(HAVE_DWARF_SUPPORT)
if (use_browser == 1)
key = hist_entry__annotate_data_tui(he, evsel, NULL);
else
⬢[acme@toolbox perf-tools-next]$
On Wed, Apr 10, 2024 at 06:20:06PM -0300, Arnaldo Carvalho de Melo wrote:
> On Wed, Apr 10, 2024 at 06:17:16PM -0300, Arnaldo Carvalho de Melo wrote:
> > On Wed, Apr 10, 2024 at 06:12:32PM -0300, Arnaldo Carvalho de Melo wrote:
> > > On Wed, Apr 10, 2024 at 06:05:27PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > On Wed, Apr 10, 2024 at 06:04:26PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > > On Wed, Apr 10, 2024 at 05:21:01PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > > > On Tue, Apr 09, 2024 at 04:49:57PM -0700, Namhyung Kim wrote:
> > > > > > > Support data type profiling output on TUI.
> > > > > >
> > > > > > Added the follow to the commit log message, to make reviewing easier.
> > > > > >
> > > > > > As followup patches I think having the DSO name together with the type
> > > > > > is important, also I think we could have a first menu with all the pairs
> > > > > > of DSO/type, sorted top down by the types with most samples, wdyt?
> > > > > >
> > > > > > Applied.
> > > > > >
> > > > >
> > > > > There is something else here with the static build, checking...
> > > >
> > > > Probably because of:
> > > >
> > > > Makefile.config:810: slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev
> > > >
> > > > Fixing...
> > >
> > > Trying with:
> >
> > Not really, I need to check for HAVE_DWARF_SUPPORT as well? Doing that
>
> Attempting with:
Nope, the surgery needed is a bit bigger, as you made
hist_entry__annotate_data_tty dependent on DWARF but calls it without
checking HAVE_DWARF_SUPPORT from builtin-annotate.c.
I put what I have in tmp.perf-tools-next, please take a look, I'll
continue tomorrow.
- Arnaldo
> ⬢[acme@toolbox perf-tools-next]$ git diff
> diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
> index 458eafe65e4aa16f..521ec7e226e29e6b 100644
> --- a/tools/perf/builtin-annotate.c
> +++ b/tools/perf/builtin-annotate.c
> @@ -469,7 +469,7 @@ static void hists__find_annotations(struct hists *hists,
> goto find_next;
> }
>
> -#ifdef HAVE_SLANG_SUPPORT
> +#if defined(HAVE_SLANG_SUPPORT) && defined(HAVE_DWARF_SUPPORT)
> if (use_browser == 1)
> key = hist_entry__annotate_data_tui(he, evsel, NULL);
> else
> ⬢[acme@toolbox perf-tools-next]$
On Wed, Apr 10, 2024 at 2:32 PM Arnaldo Carvalho de Melo
<[email protected]> wrote:
>
> On Wed, Apr 10, 2024 at 06:20:06PM -0300, Arnaldo Carvalho de Melo wrote:
> > On Wed, Apr 10, 2024 at 06:17:16PM -0300, Arnaldo Carvalho de Melo wrote:
> > > On Wed, Apr 10, 2024 at 06:12:32PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > On Wed, Apr 10, 2024 at 06:05:27PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > > On Wed, Apr 10, 2024 at 06:04:26PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > > > On Wed, Apr 10, 2024 at 05:21:01PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > > > > On Tue, Apr 09, 2024 at 04:49:57PM -0700, Namhyung Kim wrote:
> > > > > > > > Support data type profiling output on TUI.
> > > > > > >
> > > > > > > Added the follow to the commit log message, to make reviewing easier.
> > > > > > >
> > > > > > > As followup patches I think having the DSO name together with the type
> > > > > > > is important, also I think we could have a first menu with all the pairs
> > > > > > > of DSO/type, sorted top down by the types with most samples, wdyt?
> > > > > > >
> > > > > > > Applied.
> > > > > > >
> > > > > >
> > > > > > There is something else here with the static build, checking...
> > > > >
> > > > > Probably because of:
> > > > >
> > > > > Makefile.config:810: slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev
> > > > >
> > > > > Fixing...
> > > >
> > > > Trying with:
> > >
> > > Not really, I need to check for HAVE_DWARF_SUPPORT as well? Doing that
> >
> > Attempting with:
>
> Nope, the surgery needed is a bit bigger, as you made
> hist_entry__annotate_data_tty dependent on DWARF but calls it without
> checking HAVE_DWARF_SUPPORT from builtin-annotate.c.
>
> I put what I have in tmp.perf-tools-next, please take a look, I'll
> continue tomorrow.
Oops, thanks a lot for fighting with this. I think I can add a
dummy version in case it doesn't have the slang support.
I'll send v2 including all your other improvements.
Thanks,
Namhyung
On Wed, Apr 10, 2024 at 1:50 PM Arnaldo Carvalho de Melo
<[email protected]> wrote:
> (gdb) bt
> #0 0x00007ffff6ebd385 in __GI___libc_free (mem=0x69647225202c3866) at malloc.c:3368 ▒
> #1 0x000000000066c2c0 in delete_data_type_histograms (adt=0x8dedf0c0) at util/annotate-data.c:1655 ▒
> #2 0x000000000066c363 in annotated_data_type__tree_delete (root=0xe6bc68) at util/annotate-data.c:1669 ▒
> #3 0x0000000000553bc5 in dso__delete (dso=0xe6bbd0) at util/dso.c:1376 ▒
> #4 0x0000000000553d63 in dso__put (dso=0xe6bbd0) at util/dso.c:1409 ▒
> #5 0x000000000057ed76 in __dso__zput (dso=0xf5b540) at util/dso.h:262 ▒
> #6 0x000000000058027e in map__exit (map=0xf5b520) at util/map.c:300 ▒
> #7 0x00000000005802bc in map__delete (map=0xf5b520) at util/map.c:305cord -b ... ; perf report --total-cycles ▒
> #8 0x0000000000580325 in map__put (map=0xf5b520) at util/map.c:312
> #9 0x00000000005818aa in __map__zput (map=0xf3e300) at util/map.h:196
> #10 0x0000000000582241 in maps__exit (maps=0xf5aee0) at util/maps.c:246
> #11 0x000000000058233c in maps__delete (maps=0xf5aee0) at util/maps.c:268
> #12 0x00000000005823fd in maps__put (maps=0xf5aee0) at util/maps.c:285
> #13 0x000000000055c4ca in __maps__zput (map=0x47856d8) at util/maps.h:32
> #14 0x000000000055c55f in map_symbol__exit (ms=0x47856d8) at util/map_symbol.c:8
> #15 0x00000000005c36bf in hist_entry__delete (he=0x4785660) at util/hist.c:1319
> #16 0x00000000005c1049 in hists__delete_entry (hists=0xe68fe0, he=0x4785660) at util/hist.c:382
> #17 0x00000000005c1197 in hists__delete_entries (hists=0xe68fe0) at util/hist.c:410
> #18 0x00000000005c7a4d in hists__delete_all_entries (hists=0xe68fe0) at util/hist.c:2872
> #19 0x00000000005c7ac7 in hists_evsel__exit (evsel=0xe68d70) at util/hist.c:2884
> #20 0x0000000000531928 in evsel__exit (evsel=0xe68d70) at util/evsel.c:1489
> #21 0x000000000053196d in evsel__delete (evsel=0xe68d70) at util/evsel.c:1497
> #22 0x0000000000526a70 in evlist__purge (evlist=0xe67a00) at util/evlist.c:163
> #23 0x0000000000526b7d in evlist__delete (evlist=0xe67a00) at util/evlist.c:185
> #24 0x0000000000585fd8 in perf_session__delete (session=0xe670a0) at util/session.c:313
> #25 0x0000000000434503 in cmd_report (argc=0, argv=0x7fffffffe430) at builtin-report.c:1828
> #26 0x00000000005062c3 in run_builtin (p=0xe3f160 <commands+288>, argc=3, argv=0x7fffffffe430) at perf.c:350
> #27 0x0000000000506532 in handle_internal_command (argc=3, argv=0x7fffffffe430) at perf.c:403
> #28 0x0000000000506681 in run_argv (argcp=0x7fffffffe21c, argv=0x7fffffffe210) at perf.c:447
> #29 0x0000000000506978 in main (argc=3, argv=0x7fffffffe430) at perf.c:561
> (gdb)
>
Thanks for the report. I think I missed stack canary not handling
histogram updates. The data file I tested with TUI didn't have an
entry for stack canary so I didn't catch this. For some reason, I
still cannot reproduce it on my box. Anyway I will fix in v2.
For the verification, it'd be nice if you can print the type name
in the delete_data_type__histogram().
(gdb) p adt->self.type_name
Thanks,
Namhyung