public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Wang Nan <wangnan0@huawei.com>
Subject: [PATCH 02/16] perf test: Dump the stack when test segfaults when in verbose mode
Date: Mon, 14 Dec 2015 14:44:27 -0300	[thread overview]
Message-ID: <1450115081-22962-3-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1450115081-22962-1-git-send-email-acme@kernel.org>

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

E.g.:

  # perf test 26
  26: Test mmap thread lookup                                  : FAILED!
  # perf test -v 26
  26: Test mmap thread lookup                                  :
  --- start ---
  test child forked, pid 9269
  tid = 9269, map = 0x7ff99ff0c000
  tid = 9270, map = 0x7ff99ff0b000
  tid = 9271, map = 0x7ff99ff0a000
  tid = 9272, map = 0x7ff99ff09000
  perf: Segmentation fault
  Obtained 13 stack frames.
  perf(sighandler_dump_stack+0x41) [0x4e3541]
  /lib64/libc.so.6(+0x34960) [0x7ff99d5f6960]
  perf(thread__put+0x5b) [0x4c6f6b]
  perf(machine__process_event+0x14e) [0x4bd37e]
  perf(perf_event__synthesize_threads+0x3aa) [0x48678a]
  perf(test__mmap_thread_lookup+0x20a) [0x474e0a]
  perf() [0x460d56]
  perf(cmd_test+0x589) [0x461319]
  perf() [0x47c641]
  perf(main+0x617) [0x422317]
  /lib64/libc.so.6(__libc_start_main+0xf0) [0x7ff99d5e1fe0]
  perf() [0x422429]
  [(nil)]
  test child interrupted
  ---- end ----
  Test mmap thread lookup: FAILED!
  #

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-sypazzsl4ptctrmlyi2zcmaj@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/builtin-test.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index 2b1ade1aafc3..fa98406c92e2 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -236,6 +236,9 @@ static int run_test(struct test *test, int subtest)
 				dup2(STDOUT_FILENO, STDERR_FILENO);
 				close(nullfd);
 			}
+		} else {
+			signal(SIGSEGV, sighandler_dump_stack);
+			signal(SIGFPE, sighandler_dump_stack);
 		}
 
 		err = test->func(subtest);
-- 
2.1.0


  parent reply	other threads:[~2015-12-14 17:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14 17:44 [GIT PULL 00/16] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 01/16] perf tools: Use same signal handling strategy as 'record' Arnaldo Carvalho de Melo
2015-12-14 17:44 ` Arnaldo Carvalho de Melo [this message]
2015-12-14 17:44 ` [PATCH 03/16] perf thread: Fix reference count initial state Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 04/16] perf evsel: Disable branch flags/cycles for --callgraph lbr Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 05/16] perf test: Fix hist testcases when kptr_restrict is on Arnaldo Carvalho de Melo
2015-12-15  4:03   ` Wangnan (F)
2015-12-14 17:44 ` [PATCH 06/16] perf build: Remove unnecessary line in Makefile.feature Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 07/16] perf test: Add Build file to dependencies for llvm-src-*.c Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 08/16] perf test: Remove tarpkg at end of test Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 09/16] perf build: Fix 'make clean' Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 10/16] perf build: Rename LIB_PATH -> API_PATH Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 11/16] perf tools: Create pager.h Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 12/16] perf tools: Remove check for unused PERF_PAGER_IN_USE Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 13/16] perf tools: Move help_unknown_cmd() to its own file Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 14/16] perf tools: Convert parse-options.c internal functions to static Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 15/16] perf tools: Make options always available, even if required libs not linked Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 16/16] perf record: Support custom vmlinux path Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1450115081-22962-3-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox