linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf: Support for Openembedded/Yocto -dbg packages
@ 2013-09-18  8:43 Ricardo Ribalda Delgado
  2013-09-18  9:24 ` Ingo Molnar
  0 siblings, 1 reply; 11+ messages in thread
From: Ricardo Ribalda Delgado @ 2013-09-18  8:43 UTC (permalink / raw)
  To: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Waiman Long,
	Stephane Eranian, Jiri Olsa, David Ahern, linux-kernel
  Cc: Ricardo Ribalda Delgado

On OpenEmbedded the symbol files are located under a .debug folder on
the same folder as the binary file.

This patch adds support for such files.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
 tools/perf/util/dso.c    | 16 ++++++++++++++++
 tools/perf/util/dso.h    |  1 +
 tools/perf/util/symbol.c |  1 +
 3 files changed, 18 insertions(+)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index c4374f0..bab18b7 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -14,6 +14,7 @@ char dso__symtab_origin(const struct dso *dso)
 		[DSO_BINARY_TYPE__BUILD_ID_CACHE]	= 'B',
 		[DSO_BINARY_TYPE__FEDORA_DEBUGINFO]	= 'f',
 		[DSO_BINARY_TYPE__UBUNTU_DEBUGINFO]	= 'u',
+		[DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO] = 'o',
 		[DSO_BINARY_TYPE__BUILDID_DEBUGINFO]	= 'b',
 		[DSO_BINARY_TYPE__SYSTEM_PATH_DSO]	= 'd',
 		[DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE]	= 'K',
@@ -64,6 +65,21 @@ int dso__binary_type_file(struct dso *dso, enum dso_binary_type type,
 			 symbol_conf.symfs, dso->long_name);
 		break;
 
+	case DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO:{
+		char *last_slash;
+
+		last_slash = dso->long_name + dso->long_name_len;
+		while (last_slash != dso->long_name && *last_slash != '/')
+			last_slash--;
+
+		snprintf(file, MIN(size, strlen(symbol_conf.symfs) +
+				(last_slash - dso->long_name) + 2), "%s%s",
+				symbol_conf.symfs, dso->long_name);
+		snprintf(file + strlen(file), size-strlen(file), ".debug%s",
+				last_slash);
+		}
+		break;
+
 	case DSO_BINARY_TYPE__BUILDID_DEBUGINFO:
 		if (!dso->has_build_id) {
 			ret = -1;
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index d51aaf2..4f78e7b 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -20,6 +20,7 @@ enum dso_binary_type {
 	DSO_BINARY_TYPE__SYSTEM_PATH_DSO,
 	DSO_BINARY_TYPE__GUEST_KMODULE,
 	DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE,
+	DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO,
 	DSO_BINARY_TYPE__NOT_FOUND,
 };
 
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index d5528e1..f69d57b 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -51,6 +51,7 @@ static enum dso_binary_type binary_type_symtab[] = {
 	DSO_BINARY_TYPE__SYSTEM_PATH_DSO,
 	DSO_BINARY_TYPE__GUEST_KMODULE,
 	DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE,
+	DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO,
 	DSO_BINARY_TYPE__NOT_FOUND,
 };
 
-- 
1.8.4.rc3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-10-02  6:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-18  8:43 [PATCH] perf: Support for Openembedded/Yocto -dbg packages Ricardo Ribalda Delgado
2013-09-18  9:24 ` Ingo Molnar
2013-09-18  9:47   ` Ricardo Ribalda Delgado
2013-09-18 10:02     ` Ricardo Ribalda Delgado
2013-09-18 10:18       ` Peter Zijlstra
2013-09-18 13:07         ` Arnaldo Carvalho de Melo
2013-09-18 13:29           ` Ingo Molnar
2013-09-18 13:58             ` Ricardo Ribalda Delgado
2013-09-18 14:08             ` Arnaldo Carvalho de Melo
2013-10-02  0:54             ` Namhyung Kim
2013-10-02  6:13               ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).