lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZTatKUD6nS7OlvuC@kernel.org>
Date:   Mon, 23 Oct 2023 14:28:09 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Namhyung Kim <namhyung@...nel.org>
Cc:     Jiri Olsa <jolsa@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ian Rogers <irogers@...gle.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Ingo Molnar <mingo@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        linux-perf-users@...r.kernel.org,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Stephane Eranian <eranian@...gle.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        linux-toolchains@...r.kernel.org, linux-trace-devel@...r.kernel.org
Subject: Re: [PATCH 22/48] perf annotate: Add --type-stat option for debugging

Em Wed, Oct 11, 2023 at 08:50:45PM -0700, Namhyung Kim escreveu:
> The --type-stat option is to be used with --data-type and to print
> detailed failure reasons for the data type annotation.
> 
>   $ perf annotate --data-type --type-stat
>   Annotate data type stats:
>   total 294, ok 116 (39.5%), bad 178 (60.5%)
>   -----------------------------------------------------------
>           30 : no_sym
>           40 : no_insn_ops
>           33 : no_mem_ops
>           63 : no_var
>            4 : no_typeinfo
>            8 : bad_offset

Had to enclose it as well, as:

⬢[acme@...lbox perf-tools-next]$ grep annotate-data tools/perf/util/Build
perf-$(CONFIG_DWARF) += annotate-data.o
⬢[acme@...lbox perf-tools-next]$

/usr/bin/ld: /tmp/build/perf-tools-next/perf-in.o: in function `cmd_annotate':
(.text+0x27b7): undefined reference to `ann_data_stat'
/usr/bin/ld: (.text+0x27bd): undefined reference to `ann_data_stat'
/usr/bin/ld: (.text+0x27c4): undefined reference to `ann_data_stat'
/usr/bin/ld: (.text+0x27cb): undefined reference to `ann_data_stat'
/usr/bin/ld: (.text+0x27d2): undefined reference to `ann_data_stat'
/usr/bin/ld: /tmp/build/perf-tools-next/perf-in.o:(.text+0x27d9): more undefined references to `ann_data_stat' follow
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile.perf:675: /tmp/build/perf-tools-next/perf] Error 1

When building with NO_DWARF=1 or in systems lacking the used DWARF
libraries. I noticed with some of the build containers, will updated
those to have the required libraries so that this feature gets compile
tested there.


diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 645acaba63f1957a..5b534245ddb23294 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -353,6 +353,7 @@ static void print_annotated_data_type(struct annotated_data_type *mem_type,
 	printf(";\n");
 }
 
+#ifdef HAVE_DWARF_SUPPORT
 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)
@@ -389,6 +390,7 @@ static void print_annotate_data_stat(struct annotated_data_stat *s)
 
 #undef PRINT_STAT
 }
+#endif // HAVE_DWARF_SUPPORT
 
 static void hists__find_annotations(struct hists *hists,
 				    struct evsel *evsel,
@@ -396,10 +398,10 @@ static void hists__find_annotations(struct hists *hists,
 {
 	struct rb_node *nd = rb_first_cached(&hists->entries), *next;
 	int key = K_RIGHT;
-
+#ifdef HAVE_DWARF_SUPPORT
 	if (ann->type_stat)
 		print_annotate_data_stat(&ann_data_stat);
-
+#endif
 	while (nd) {
 		struct hist_entry *he = rb_entry(nd, struct hist_entry, rb_node);
 		struct annotation *notes;
@@ -698,8 +700,10 @@ int cmd_annotate(int argc, const char **argv)
 			    itrace_parse_synth_opts),
 	OPT_BOOLEAN(0, "data-type", &annotate.data_type,
 		    "Show data type annotate for the memory accesses"),
+#ifdef HAVE_DWARF_SUPPORT
 	OPT_BOOLEAN(0, "type-stat", &annotate.type_stat,
 		    "Show stats for the data type annotation"),
+#endif
 	OPT_END()
 	};
 	int ret;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ