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]
Date:	Fri, 21 Sep 2012 01:13:35 +0300
From:	Irina Tirdea <irina.tirdea@...il.com>
To:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Ingo Molnar <mingo@...nel.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Paul Mackerras <paulus@...ba.org>,
	David Ahern <dsahern@...il.com>,
	Namhyung Kim <namhyung@...nel.org>,
	Pekka Enberg <penberg@...nel.org>,
	Jiri Olsa <jolsa@...hat.com>,
	Irina Tirdea <irina.tirdea@...el.com>
Subject: [PATCH 4/4] perf tools: configure addr2line path at compile time

From: Irina Tirdea <irina.tirdea@...el.com>

The default name for addr2line is hardcoded to "addr2line".
When cross-compiling the name of addr2line will be different
(e.g. arm-eabi-addr2line in Android).

Setting the default addr2line name in the Makefile with PERF_ADDR2LINE_PATH.

Signed-off-by: Irina Tirdea <irina.tirdea@...el.com>
---
 tools/perf/Makefile        |    6 +++++-
 tools/perf/util/annotate.c |    3 ++-
 tools/perf/util/sort.c     |    2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 3d28150..1851884 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -141,6 +141,7 @@ endif
 lib = lib
 PERF_TMP_DIR = /tmp
 objdump = objdump
+addr2line = addr2line
 
 export prefix bindir sharedir sysconfdir
 
@@ -885,7 +886,7 @@ $(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS
 		$<
 
 $(OUTPUT)util/annotate.o: util/annotate.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DPERF_OBJDUMP_PATH='"$(objdump)"' $<
+	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DPERF_OBJDUMP_PATH='"$(objdump)"' -DPERF_ADDR2LINE_PATH='"$(addr2line)"' $<
 
 $(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
 	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
@@ -896,6 +897,9 @@ $(OUTPUT)util/dso-test-data.o: util/dso-test-data.c $(OUTPUT)PERF-CFLAGS
 $(OUTPUT)util/map.o: util/map.c $(OUTPUT)PERF-CFLAGS
 	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DPERF_TMP_DIR='"$(PERF_TMP_DIR)"' $<
 
+$(OUTPUT)util/sort.o: util/sort.c $(OUTPUT)PERF-CFLAGS
+	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DPERF_ADDR2LINE_PATH='"$(addr2line)"' $<
+
 $(OUTPUT)util/symbol.o: util/symbol.c $(OUTPUT)PERF-CFLAGS
 	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DPERF_TMP_DIR='"$(PERF_TMP_DIR)"' $<
 
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index a45ac77..b20b418 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -915,7 +915,8 @@ static int symbol__get_source_line(struct symbol *sym, struct map *map,
 			continue;
 
 		offset = start + i;
-		sprintf(cmd, "addr2line -e %s %016" PRIx64, filename, offset);
+		sprintf(cmd, PERF_ADDR2LINE_PATH " -e %s %016" PRIx64, filename,
+			offset);
 		fp = popen(cmd, "r");
 		if (!fp)
 			continue;
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index b5b1b92..f00619c 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -260,7 +260,7 @@ static int hist_entry__srcline_snprintf(struct hist_entry *self, char *bf,
 	if (path != NULL)
 		goto out_path;
 
-	snprintf(cmd, sizeof(cmd), "addr2line -e %s %016" PRIx64,
+	snprintf(cmd, sizeof(cmd), PERF_ADDR2LINE_PATH" -e %s %016" PRIx64,
 		 self->ms.map->dso->long_name, self->ip);
 	fp = popen(cmd, "r");
 	if (!fp)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ