perf srcline: Avoid addr2line SIGPIPEs
authorIan Rogers <irogers@google.com>
Mon, 3 Apr 2023 18:40:33 +0000 (11:40 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 4 Apr 2023 16:23:59 +0000 (13:23 -0300)
Ignore SIGPIPEs when addr2line is configured.

Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tom Rix <trix@redhat.com>
Cc: llvm@lists.linux.dev
Link: https://lore.kernel.org/r/20230403184033.1836023-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/srcline.c

index f4fcdad..cfca03a 100644 (file)
@@ -473,6 +473,8 @@ static enum a2l_style addr2line_configure(struct child_process *a2l)
                                ch = io__get_char(&io);
                        } while (ch > 0 && ch != '\n');
                }
+               /* Ignore SIGPIPE in the event addr2line exits. */
+               signal(SIGPIPE, SIG_IGN);
        }
        return style;
 }