lkml.org 
[lkml]   [2014]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 47/52] perf tools: Add vdso__new()
Date
This is preparation for adding support for
compat VDSOs.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
tools/perf/util/vdso.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/vdso.c b/tools/perf/util/vdso.c
index fdaccaf..946d927 100644
--- a/tools/perf/util/vdso.c
+++ b/tools/perf/util/vdso.c
@@ -121,6 +121,20 @@ void vdso__exit(struct machine *machine)
zfree(&machine->vdso_info);
}

+static struct dso *vdso__new(struct machine *machine, const char *short_name,
+ const char *long_name)
+{
+ struct dso *dso;
+
+ dso = dso__new(short_name);
+ if (dso != NULL) {
+ dsos__add(&machine->user_dsos, dso);
+ dso__set_long_name(dso, long_name, false);
+ }
+
+ return dso;
+}
+
struct dso *vdso__dso_findnew(struct machine *machine)
{
struct vdso_info *vdso_info;
@@ -141,11 +155,7 @@ struct dso *vdso__dso_findnew(struct machine *machine)
if (!file)
return NULL;

- dso = dso__new(VDSO__MAP_NAME);
- if (dso != NULL) {
- dsos__add(&machine->user_dsos, dso);
- dso__set_long_name(dso, file, false);
- }
+ dso = vdso__new(machine, VDSO__MAP_NAME, file);
}

return dso;
--
1.8.3.2


\
 
 \ /
  Last update: 2014-07-23 02:41    [W:0.461 / U:1.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site