Support data type profiling output on TUI.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
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: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 <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
> 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 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 <acme@kernel.org> 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
© 2016 - 2026 Red Hat, Inc.