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.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 aa7cc2ae
...@@ -111,7 +111,7 @@ void machine__exit(struct machine *machine) ...@@ -111,7 +111,7 @@ void machine__exit(struct machine *machine)
{ {
map_groups__exit(&machine->kmaps); map_groups__exit(&machine->kmaps);
dsos__delete(&machine->dsos); dsos__delete(&machine->dsos);
vdso__exit(machine); machine__exit_vdso(machine);
zfree(&machine->root_dir); zfree(&machine->root_dir);
zfree(&machine->current_tid); zfree(&machine->current_tid);
pthread_rwlock_destroy(&machine->threads_lock); pthread_rwlock_destroy(&machine->threads_lock);
......
...@@ -178,7 +178,7 @@ struct map *map__new(struct machine *machine, u64 start, u64 len, ...@@ -178,7 +178,7 @@ struct map *map__new(struct machine *machine, u64 start, u64 len,
if (vdso) { if (vdso) {
pgoff = 0; pgoff = 0;
dso = vdso__dso_findnew(machine, thread); dso = machine__findnew_vdso(machine, thread);
} else } else
dso = machine__findnew_dso(machine, filename); dso = machine__findnew_dso(machine, filename);
......
...@@ -101,7 +101,7 @@ static char *get_file(struct vdso_file *vdso_file) ...@@ -101,7 +101,7 @@ static char *get_file(struct vdso_file *vdso_file)
return vdso; return vdso;
} }
void vdso__exit(struct machine *machine) void machine__exit_vdso(struct machine *machine)
{ {
struct vdso_info *vdso_info = machine->vdso_info; struct vdso_info *vdso_info = machine->vdso_info;
...@@ -120,8 +120,8 @@ void vdso__exit(struct machine *machine) ...@@ -120,8 +120,8 @@ void vdso__exit(struct machine *machine)
zfree(&machine->vdso_info); zfree(&machine->vdso_info);
} }
static struct dso *vdso__new(struct machine *machine, const char *short_name, static struct dso *machine__addnew_vdso(struct machine *machine, const char *short_name,
const char *long_name) const char *long_name)
{ {
struct dso *dso; struct dso *dso;
...@@ -244,10 +244,10 @@ static struct dso *vdso__findnew_compat(struct machine *machine, ...@@ -244,10 +244,10 @@ static struct dso *vdso__findnew_compat(struct machine *machine,
if (!file_name) if (!file_name)
return NULL; return NULL;
return vdso__new(machine, vdso_file->dso_name, file_name); return machine__addnew_vdso(machine, vdso_file->dso_name, file_name);
} }
static int vdso__dso_findnew_compat(struct machine *machine, static int machine__findnew_vdso_compat(struct machine *machine,
struct thread *thread, struct thread *thread,
struct vdso_info *vdso_info, struct vdso_info *vdso_info,
struct dso **dso) struct dso **dso)
...@@ -281,8 +281,8 @@ static int vdso__dso_findnew_compat(struct machine *machine, ...@@ -281,8 +281,8 @@ static int vdso__dso_findnew_compat(struct machine *machine,
#endif #endif
struct dso *vdso__dso_findnew(struct machine *machine, struct dso *machine__findnew_vdso(struct machine *machine,
struct thread *thread __maybe_unused) struct thread *thread __maybe_unused)
{ {
struct vdso_info *vdso_info; struct vdso_info *vdso_info;
struct dso *dso; struct dso *dso;
...@@ -295,7 +295,7 @@ struct dso *vdso__dso_findnew(struct machine *machine, ...@@ -295,7 +295,7 @@ struct dso *vdso__dso_findnew(struct machine *machine,
return NULL; return NULL;
#if BITS_PER_LONG == 64 #if BITS_PER_LONG == 64
if (vdso__dso_findnew_compat(machine, thread, vdso_info, &dso)) if (machine__findnew_vdso_compat(machine, thread, vdso_info, &dso))
return dso; return dso;
#endif #endif
...@@ -307,7 +307,7 @@ struct dso *vdso__dso_findnew(struct machine *machine, ...@@ -307,7 +307,7 @@ struct dso *vdso__dso_findnew(struct machine *machine,
if (!file) if (!file)
return NULL; return NULL;
dso = vdso__new(machine, DSO__NAME_VDSO, file); dso = machine__addnew_vdso(machine, DSO__NAME_VDSO, file);
} }
return dso; return dso;
......
...@@ -23,7 +23,7 @@ bool dso__is_vdso(struct dso *dso); ...@@ -23,7 +23,7 @@ bool dso__is_vdso(struct dso *dso);
struct machine; struct machine;
struct thread; struct thread;
struct dso *vdso__dso_findnew(struct machine *machine, struct thread *thread); struct dso *machine__findnew_vdso(struct machine *machine, struct thread *thread);
void vdso__exit(struct machine *machine); void machine__exit_vdso(struct machine *machine);
#endif /* __PERF_VDSO__ */ #endif /* __PERF_VDSO__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册