Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
6d545a63 ebf2d268

+3 -5
+3 -5
tools/perf/util/vdso.c
··· 236 236 const char *file_name; 237 237 struct dso *dso; 238 238 239 - pthread_rwlock_wrlock(&machine->dsos.lock); 240 239 dso = __dsos__find(&machine->dsos, vdso_file->dso_name, true); 241 240 if (dso) 242 - goto out_unlock; 241 + goto out; 243 242 244 243 file_name = vdso__get_compat_file(vdso_file); 245 244 if (!file_name) 246 - goto out_unlock; 245 + goto out; 247 246 248 247 dso = __machine__addnew_vdso(machine, vdso_file->dso_name, file_name); 249 - out_unlock: 250 - pthread_rwlock_unlock(&machine->dsos.lock); 248 + out: 251 249 return dso; 252 250 } 253 251