perf tools: Fix lockup using 32-bit compat vdso

The __machine__findnew_compat() function is called only from
__machine__findnew_vdso_compat() which is called only from
machine__findnew_vdso() which already holds machine->dsos.lock, so
remove locking from __machine__findnew_compat().

This manifests itself tracing 32-bit programs with a 64-bit perf.

Signed-off-by: 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/r/1436267618-20521-1-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Adrian Hunter 2015-07-07 14:13:38 +03:00 committed by Arnaldo Carvalho de Melo
parent ebf2d2689d
commit 6d545a632f

View File

@ -236,18 +236,16 @@ static struct dso *__machine__findnew_compat(struct machine *machine,
const char *file_name; const char *file_name;
struct dso *dso; struct dso *dso;
pthread_rwlock_wrlock(&machine->dsos.lock);
dso = __dsos__find(&machine->dsos, vdso_file->dso_name, true); dso = __dsos__find(&machine->dsos, vdso_file->dso_name, true);
if (dso) if (dso)
goto out_unlock; goto out;
file_name = vdso__get_compat_file(vdso_file); file_name = vdso__get_compat_file(vdso_file);
if (!file_name) if (!file_name)
goto out_unlock; goto out;
dso = __machine__addnew_vdso(machine, vdso_file->dso_name, file_name); dso = __machine__addnew_vdso(machine, vdso_file->dso_name, file_name);
out_unlock: out:
pthread_rwlock_unlock(&machine->dsos.lock);
return dso; return dso;
} }