public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>,
	Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] perf test 29 crashing
Date: Fri, 1 Jul 2016 09:02:47 +0200	[thread overview]
Message-ID: <20160701070247.GC28965@krava> (raw)
In-Reply-To: <7450cf93-e2dd-ea6e-dfcd-fee2965acab8@gmail.com>

On Thu, Jun 30, 2016 at 01:41:57PM -0600, David Ahern wrote:
> On 6/30/16 10:18 AM, Jiri Olsa wrote:
> > it was the setup in my .perfconfig:
> > 
> > [call-graph]
> > threshold=10
> > 
> > caused some of the callchains to disappear and screw the test,
> 
> Did you find out why it caused a segfault?

yep, the code of tests/hists_cumulate.c::do_test
expects each hist_entry to carry callchain,
and the option above cause only some of the
had it:

  do_test
  {

       root = &he->callchain->node.rb_root;
       cnode = rb_entry(rb_first(root), struct callchain_node, rb_node);

       c = 0;
       list_for_each_entry(clist, &cnode->val, list) {
       ^
       - root is empty, cnode is trash and this itaration segfaults

maybe we could also add check below

jirka


---
diff --git a/tools/perf/tests/hists_cumulate.c b/tools/perf/tests/hists_cumulate.c
index 1208284a7338..9fd54b79a788 100644
--- a/tools/perf/tests/hists_cumulate.c
+++ b/tools/perf/tests/hists_cumulate.c
@@ -216,6 +216,8 @@ static int do_test(struct hists *hists, struct result *expected, size_t nr_expec
 
 		/* check callchain entries */
 		root = &he->callchain->node.rb_root;
+
+		TEST_ASSERT_VAL("callchains expected", !RB_EMPTY_ROOT(root));
 		cnode = rb_entry(rb_first(root), struct callchain_node, rb_node);
 
 		c = 0;

  reply	other threads:[~2016-07-01  7:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-28 12:34 [BUG] perf test 29 crashing Jiri Olsa
2016-06-28 16:59 ` Arnaldo Carvalho de Melo
2016-06-28 17:52   ` David Ahern
2016-06-29  2:20     ` Namhyung Kim
2016-06-30 15:10       ` Jiri Olsa
2016-06-30 16:18         ` Jiri Olsa
2016-06-30 19:41           ` David Ahern
2016-07-01  7:02             ` Jiri Olsa [this message]
2016-06-30 19:56           ` 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=20160701070247.GC28965@krava \
    --to=jolsa@redhat.com \
    --cc=arnaldo.melo@gmail.com \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    /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