From 75a616c6d332342291c45b0381abe00bd597036c Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Mon, 3 Apr 2023 11:40:33 -0700 Subject: [PATCH] perf srcline: Avoid addr2line SIGPIPEs Ignore SIGPIPEs when addr2line is configured. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Peter Zijlstra Cc: Tom Rix Cc: llvm@lists.linux.dev Link: https://lore.kernel.org/r/20230403184033.1836023-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/srcline.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c index f4fcdada821b..cfca03abd6f8 100644 --- a/tools/perf/util/srcline.c +++ b/tools/perf/util/srcline.c @@ -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; }