perf daemon: Force waipid for all session on SIGCHLD delivery
authorJiri Olsa <jolsa@kernel.org>
Sat, 20 Mar 2021 22:10:12 +0000 (23:10 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 24 Mar 2021 13:23:15 +0000 (10:23 -0300)
commit1833b64fee1032d1f48afaa3956bc0ea6b10d5e0
treeea30e23bb8bd8ac11442f599b9416bd03dadae8c
parent1a096ae46e21b73f83a581e617f76326c1de592d
perf daemon: Force waipid for all session on SIGCHLD delivery

If we don't process SIGCHLD before another comes, we will see just one
SIGCHLD as a result. In this case current code will miss exit
notification for a session and wait forever.

Adding extra waitpid check for all sessions when SIGCHLD is received, to
make sure we don't miss any session exit.

Also fix close condition for signal_fd.

Reported-by: Ian Rogers <irogers@google.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20210320221013.1619613-1-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-daemon.c