aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/vdso.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2014-07-22 09:17:56 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-07-23 16:34:47 -0400
commit4f71f2a0abe8b2a76669a4608a62f5020a64205a (patch)
treef4da4950d02259555d7af9ebfce78afab1728ba2 /tools/perf/util/vdso.c
parentd027b64001b21328cc92d35c6444e1a7a926ea76 (diff)
perf tools: Add vdso__new()
This is preparation for adding support for compat VDSOs. Reviewed-by: Jiri Olsa <jolsa@redhat.com> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1406035081-14301-48-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/vdso.c')
-rw-r--r--tools/perf/util/vdso.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/tools/perf/util/vdso.c b/tools/perf/util/vdso.c
index fdaccaf67371..946d927765c6 100644
--- a/tools/perf/util/vdso.c
+++ b/tools/perf/util/vdso.c
@@ -121,6 +121,20 @@ void vdso__exit(struct machine *machine)
121 zfree(&machine->vdso_info); 121 zfree(&machine->vdso_info);
122} 122}
123 123
124static struct dso *vdso__new(struct machine *machine, const char *short_name,
125 const char *long_name)
126{
127 struct dso *dso;
128
129 dso = dso__new(short_name);
130 if (dso != NULL) {
131 dsos__add(&machine->user_dsos, dso);
132 dso__set_long_name(dso, long_name, false);
133 }
134
135 return dso;
136}
137
124struct dso *vdso__dso_findnew(struct machine *machine) 138struct dso *vdso__dso_findnew(struct machine *machine)
125{ 139{
126 struct vdso_info *vdso_info; 140 struct vdso_info *vdso_info;
@@ -141,11 +155,7 @@ struct dso *vdso__dso_findnew(struct machine *machine)
141 if (!file) 155 if (!file)
142 return NULL; 156 return NULL;
143 157
144 dso = dso__new(VDSO__MAP_NAME); 158 dso = vdso__new(machine, VDSO__MAP_NAME, file);
145 if (dso != NULL) {
146 dsos__add(&machine->user_dsos, dso);
147 dso__set_long_name(dso, file, false);
148 }
149 } 159 }
150 160
151 return dso; 161 return dso;