aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-05-29 10:54:08 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-05-29 11:43:44 -0400
commit9a4388c711d07889217b19eaf63485122dec8817 (patch)
treeee48280f007b3719c19a223ba8f2cf8ba63b89b4
parentaa7cc2ae5ae69aff555793fbfcff514141bb23f3 (diff)
perf machine: Fix up vdso methods names
To make it consistent with the other dso lifetime routines. For instance: struct dso *vdso__new(struct machine *machine, const char *short_name, const char *long_name) Becomes: struct dso *machine__addnew_vdso(struct machine *machine, const char *short_name, const char *long_name) Because: 1) There is no 'struct vdso' for us to have vdso__ prefixed routines. 2) Because it will not really just create a new instance of 'struct dso', it'll call dso__new() but it will also insert it into the DSO's list/rbtree, and we have a method name for that: 'addnew', just like we have dsos__addnew(). 3) So it is really a 'struct machine' operation, it is the first argument, etc. This way the place where this is used gets consistent: if (vdso) { pgoff = 0; - dso = vdso__dso_findnew(machine, thread); + dso = machine__findnew_vdso(machine, thread); } else dso = machine__findnew_dso(machine, filename); Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/n/tip-r3w3tvh8exm9xfz3p4tz9qbz@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/machine.c2
-rw-r--r--tools/perf/util/map.c2
-rw-r--r--tools/perf/util/vdso.c18
-rw-r--r--tools/perf/util/vdso.h4
4 files changed, 13 insertions, 13 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 698da1da5168..2ed61f59d415 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -111,7 +111,7 @@ void machine__exit(struct machine *machine)
111{ 111{
112 map_groups__exit(&machine->kmaps); 112 map_groups__exit(&machine->kmaps);
113 dsos__delete(&machine->dsos); 113 dsos__delete(&machine->dsos);
114 vdso__exit(machine); 114 machine__exit_vdso(machine);
115 zfree(&machine->root_dir); 115 zfree(&machine->root_dir);
116 zfree(&machine->current_tid); 116 zfree(&machine->current_tid);
117 pthread_rwlock_destroy(&machine->threads_lock); 117 pthread_rwlock_destroy(&machine->threads_lock);
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index d15e1e9dd2ae..365011c233a6 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -178,7 +178,7 @@ struct map *map__new(struct machine *machine, u64 start, u64 len,
178 178
179 if (vdso) { 179 if (vdso) {
180 pgoff = 0; 180 pgoff = 0;
181 dso = vdso__dso_findnew(machine, thread); 181 dso = machine__findnew_vdso(machine, thread);
182 } else 182 } else
183 dso = machine__findnew_dso(machine, filename); 183 dso = machine__findnew_dso(machine, filename);
184 184
diff --git a/tools/perf/util/vdso.c b/tools/perf/util/vdso.c
index d3651b43e945..2e8f6886ca72 100644
--- a/tools/perf/util/vdso.c
+++ b/tools/perf/util/vdso.c
@@ -101,7 +101,7 @@ static char *get_file(struct vdso_file *vdso_file)
101 return vdso; 101 return vdso;
102} 102}
103 103
104void vdso__exit(struct machine *machine) 104void machine__exit_vdso(struct machine *machine)
105{ 105{
106 struct vdso_info *vdso_info = machine->vdso_info; 106 struct vdso_info *vdso_info = machine->vdso_info;
107 107
@@ -120,8 +120,8 @@ void vdso__exit(struct machine *machine)
120 zfree(&machine->vdso_info); 120 zfree(&machine->vdso_info);
121} 121}
122 122
123static struct dso *vdso__new(struct machine *machine, const char *short_name, 123static struct dso *machine__addnew_vdso(struct machine *machine, const char *short_name,
124 const char *long_name) 124 const char *long_name)
125{ 125{
126 struct dso *dso; 126 struct dso *dso;
127 127
@@ -244,10 +244,10 @@ static struct dso *vdso__findnew_compat(struct machine *machine,
244 if (!file_name) 244 if (!file_name)
245 return NULL; 245 return NULL;
246 246
247 return vdso__new(machine, vdso_file->dso_name, file_name); 247 return machine__addnew_vdso(machine, vdso_file->dso_name, file_name);
248} 248}
249 249
250static int vdso__dso_findnew_compat(struct machine *machine, 250static int machine__findnew_vdso_compat(struct machine *machine,
251 struct thread *thread, 251 struct thread *thread,
252 struct vdso_info *vdso_info, 252 struct vdso_info *vdso_info,
253 struct dso **dso) 253 struct dso **dso)
@@ -281,8 +281,8 @@ static int vdso__dso_findnew_compat(struct machine *machine,
281 281
282#endif 282#endif
283 283
284struct dso *vdso__dso_findnew(struct machine *machine, 284struct dso *machine__findnew_vdso(struct machine *machine,
285 struct thread *thread __maybe_unused) 285 struct thread *thread __maybe_unused)
286{ 286{
287 struct vdso_info *vdso_info; 287 struct vdso_info *vdso_info;
288 struct dso *dso; 288 struct dso *dso;
@@ -295,7 +295,7 @@ struct dso *vdso__dso_findnew(struct machine *machine,
295 return NULL; 295 return NULL;
296 296
297#if BITS_PER_LONG == 64 297#if BITS_PER_LONG == 64
298 if (vdso__dso_findnew_compat(machine, thread, vdso_info, &dso)) 298 if (machine__findnew_vdso_compat(machine, thread, vdso_info, &dso))
299 return dso; 299 return dso;
300#endif 300#endif
301 301
@@ -307,7 +307,7 @@ struct dso *vdso__dso_findnew(struct machine *machine,
307 if (!file) 307 if (!file)
308 return NULL; 308 return NULL;
309 309
310 dso = vdso__new(machine, DSO__NAME_VDSO, file); 310 dso = machine__addnew_vdso(machine, DSO__NAME_VDSO, file);
311 } 311 }
312 312
313 return dso; 313 return dso;
diff --git a/tools/perf/util/vdso.h b/tools/perf/util/vdso.h
index d97da1616f0c..cdc4fabfc212 100644
--- a/tools/perf/util/vdso.h
+++ b/tools/perf/util/vdso.h
@@ -23,7 +23,7 @@ bool dso__is_vdso(struct dso *dso);
23struct machine; 23struct machine;
24struct thread; 24struct thread;
25 25
26struct dso *vdso__dso_findnew(struct machine *machine, struct thread *thread); 26struct dso *machine__findnew_vdso(struct machine *machine, struct thread *thread);
27void vdso__exit(struct machine *machine); 27void machine__exit_vdso(struct machine *machine);
28 28
29#endif /* __PERF_VDSO__ */ 29#endif /* __PERF_VDSO__ */