]> asedeno.scripts.mit.edu Git - linux.git/commit
perf tools: Use scandir() to replace readdir()
authorKan Liang <kan.liang@intel.com>
Thu, 7 Sep 2017 17:55:46 +0000 (10:55 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 13 Sep 2017 12:49:15 +0000 (09:49 -0300)
commitecdad24d7a4480c9af0ff6dbe00ac8bbae720d19
treef30ce066f4f7e135123e8cf81197a0dad1f238f0
parent8233822f403b67bbaa1d58e8fa6b8f821fe7626d
perf tools: Use scandir() to replace readdir()

In perf_event__synthesize_threads() perf goes through all proc files
serially by readdir.

scandir() does a snapshoot of /proc, which is multithreading friendly.

It's possible that some threads which are added during event synthesize.
But the number of lost threads should be small.  They should not impact
the final analysis.

Signed-off-by: Kan Liang <kan.liang@intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Lukasz Odzioba <lukasz.odzioba@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1504806954-150842-3-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/event.c