summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-12-11 16:43:57 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-12-14 12:08:55 -0300
commit9daddf66a37708ec7182a7058f159166d12c9812 (patch)
tree973fa64aa84aaa12e176cef7fc166adaaf836f7b
parent0d76ded582c178d3cca55c9112eceb5b0f12f558 (diff)
downloadlinux-9daddf66a37708ec7182a7058f159166d12c9812.tar.gz
linux-9daddf66a37708ec7182a7058f159166d12c9812.tar.bz2
linux-9daddf66a37708ec7182a7058f159166d12c9812.zip
perf tools: Use same signal handling strategy as 'record'
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>
-rw-r--r--tools/perf/util/util.c3
1 files changed, 2 insertions, 1 deletions
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)