All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: introduce local DSO path lookup.
@ 2015-01-28 10:15 Martin Liška
  0 siblings, 0 replies; only message in thread
From: Martin Liška @ 2015-01-28 10:15 UTC (permalink / raw)
  To: a.p.zijlstra, paulus, mingo, acme; +Cc: linux-kernel

Hi.

Following simple patch introduces support for a local DSO lookup operation.
Motivation is that if I have a perf.data file which is created on a different
machine (perf record $very_long_path), using perf report with --symfs=$workdir
expects a DSO to be located at: $workdir/$very_long_path.

I think it would be much easier to copy a binary file to the $workdir and
let perf lookup the working directory: $workdir/binary_filename.

Thanks,
Martin

Signed-off-by: Martin Liska <m.liska@suse.cz>

---
  tools/perf/util/dso.c    | 5 +++++
  tools/perf/util/dso.h    | 1 +
  tools/perf/util/symbol.c | 2 ++
  3 files changed, 8 insertions(+)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 45be944..4dc6ea3 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -20,6 +20,7 @@ char dso__symtab_origin(const struct dso *dso)
  		[DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO]	= 'o',
  		[DSO_BINARY_TYPE__BUILDID_DEBUGINFO]		= 'b',
  		[DSO_BINARY_TYPE__SYSTEM_PATH_DSO]		= 'd',
+		[DSO_BINARY_TYPE__LOCAL_PATH_DSO]		= 'c',
  		[DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE]		= 'K',
  		[DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP]	= 'm',
  		[DSO_BINARY_TYPE__GUEST_KALLSYMS]		= 'g',
@@ -113,6 +114,10 @@ int dso__read_binary_type_filename(const struct dso *dso,
  		__symbol__join_symfs(filename, size, dso->long_name);
  		break;
  
+	case DSO_BINARY_TYPE__LOCAL_PATH_DSO:
+		__symbol__join_symfs(filename, size, dso->short_name);
+		break;
+
  	case DSO_BINARY_TYPE__GUEST_KMODULE:
  	case DSO_BINARY_TYPE__GUEST_KMODULE_COMP:
  		path__join3(filename, size, symbol_conf.symfs,
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index 3782c82..2e3b37b 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -21,6 +21,7 @@ enum dso_binary_type {
  	DSO_BINARY_TYPE__UBUNTU_DEBUGINFO,
  	DSO_BINARY_TYPE__BUILDID_DEBUGINFO,
  	DSO_BINARY_TYPE__SYSTEM_PATH_DSO,
+	DSO_BINARY_TYPE__LOCAL_PATH_DSO,
  	DSO_BINARY_TYPE__GUEST_KMODULE,
  	DSO_BINARY_TYPE__GUEST_KMODULE_COMP,
  	DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE,
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index c24c5b8..cb71d3d 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -50,6 +50,7 @@ static enum dso_binary_type binary_type_symtab[] = {
  	DSO_BINARY_TYPE__UBUNTU_DEBUGINFO,
  	DSO_BINARY_TYPE__BUILDID_DEBUGINFO,
  	DSO_BINARY_TYPE__SYSTEM_PATH_DSO,
+	DSO_BINARY_TYPE__LOCAL_PATH_DSO,
  	DSO_BINARY_TYPE__GUEST_KMODULE,
  	DSO_BINARY_TYPE__GUEST_KMODULE_COMP,
  	DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE,
@@ -1285,6 +1286,7 @@ static bool dso__is_compatible_symtab_type(struct dso *dso, bool kmod,
  	case DSO_BINARY_TYPE__JAVA_JIT:
  	case DSO_BINARY_TYPE__DEBUGLINK:
  	case DSO_BINARY_TYPE__SYSTEM_PATH_DSO:
+	case DSO_BINARY_TYPE__LOCAL_PATH_DSO:
  	case DSO_BINARY_TYPE__FEDORA_DEBUGINFO:
  	case DSO_BINARY_TYPE__UBUNTU_DEBUGINFO:
  	case DSO_BINARY_TYPE__BUILDID_DEBUGINFO:
-- 
2.1.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-01-29  1:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-28 10:15 [PATCH] perf: introduce local DSO path lookup Martin Liška

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.