Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1291385

[PATCH 01/16] perf tools: Use same signal handling strategy as 'record'

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 01/16] perf tools: Use same signal handling strategy as 'record'
Date 2015-12-14 18:50 +0100
Message-ID <qFFq4-Q8-43@gated-at.bofh.it> (permalink)
References <qFFq2-Q8-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Arnaldo Carvalho de Melo <acme@redhat.com>

I.e. don't exit with the signal number, instead set the signal handler
to the default one and then raise it again.

Noticed while trying to dump the stack at segfaults in the 'perf test'
forked process used to run each test, that inspects signal info at
each test.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-5x5r176wnoqxi5p6id05wv9w@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/util.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 07da970a62a3..aff0cfd83662 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -352,7 +352,8 @@ void sighandler_dump_stack(int sig)
 {
 	psignal(sig, "perf");
 	dump_stack();
-	exit(sig);
+	signal(sig, SIG_DFL);
+	raise(sig);
 }
 
 int parse_nsec_time(const char *str, u64 *ptime)
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL 00/16] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-14 18:50 +0100
  [PATCH 16/16] perf record: Support custom vmlinux path Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-14 18:50 +0100
  [PATCH 09/16] perf build: Fix 'make clean' Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-14 18:50 +0100
  [PATCH 06/16] perf build: Remove unnecessary line in Makefile.feature Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-14 18:50 +0100
  [PATCH 01/16] perf tools: Use same signal handling strategy as 'record' Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-14 18:50 +0100
  [PATCH 12/16] perf tools: Remove check for unused PERF_PAGER_IN_USE Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-14 18:50 +0100
  [PATCH 15/16] perf tools: Make options always available, even if required libs not linked Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-14 18:50 +0100
  [PATCH 05/16] perf test: Fix hist testcases when kptr_restrict is on Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-14 18:50 +0100
    Re: [PATCH 05/16] perf test: Fix hist testcases when kptr_restrict  is on "Wangnan (F)" <wangnan0@huawei.com> - 2015-12-15 05:10 +0100
  [PATCH 03/16] perf thread: Fix reference count initial state Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-14 18:50 +0100
  [PATCH 14/16] perf tools: Convert parse-options.c internal functions to static Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-14 18:50 +0100
  [PATCH 04/16] perf evsel: Disable branch flags/cycles for --callgraph lbr Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-14 18:50 +0100

csiph-web