mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	masami.hiramatsu.pt@hitachi.com, David Ahern <dsahern@gmail.com>
Subject: Re: perf test unwind failing
Date: Fri, 27 Nov 2015 09:21:21 +0100	[thread overview]
Message-ID: <20151127082121.GA24503@krava.brq.redhat.com> (raw)
In-Reply-To: <20151126204559.GM28162@kernel.org>

On Thu, Nov 26, 2015 at 05:45:59PM -0300, Arnaldo Carvalho de Melo wrote:
> Jiri,
> 
> 	Can you take a look at 'perf test unwind'? It is failing in my
> perf/core branch, no time to bisect that now.
> 
> [root@zoo ~]# perf test unwind
> 40: Test dwarf unwind                                        : FAILED!

(gdb) set follow-fork-mode child
(gdb) r test dwarf
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7fd2780 (LWP 29735)]
0x00000000004ac953 in map__kmap (map=map@entry=0x7ffff7ffe4a0) at util/map.c:839
839             if (!map->dso || !map->dso->kernel) {
(gdb) bt
#0  0x00000000004ac953 in map__kmap (map=map@entry=0x7ffff7ffe4a0) at util/map.c:839
#1  0x00000000004a97a2 in machine__destroy_kernel_maps (machine=machine@entry=0x7fffffffdb80) at util/machine.c:807
#2  0x00000000004a9861 in machine__exit (machine=machine@entry=0x7fffffffdb80) at util/machine.c:125
#3  0x0000000000477669 in test__dwarf_unwind (subtest=<optimized out>) at tests/dwarf-unwind.c:197
#4  0x000000000045a128 in run_test (test=test@entry=0x888470 <arch_tests+80>, subtest=subtest@entry=-1) at tests/builtin-test.c:241
#5  0x000000000045a201 in test_and_print (t=t@entry=0x888470 <arch_tests+80>, force_skip=force_skip@entry=false, subtest=subtest@entry=-1)
    at tests/builtin-test.c:268
#6  0x000000000045a42b in __cmd_test (argc=argc@entry=1, argv=argv@entry=0x7fffffffe3d0, skiplist=0x0) at tests/builtin-test.c:324
#7  0x000000000045a707 in cmd_test (argc=1, argv=0x7fffffffe3d0, prefix=<optimized out>) at tests/builtin-test.c:416
#8  0x00000000004782b0 in run_builtin (p=p@entry=0x885d98 <commands+504>, argc=argc@entry=2, argv=argv@entry=0x7fffffffe3d0) at perf.c:387
#9  0x00000000004784ad in handle_internal_command (argc=2, argv=0x7fffffffe3d0) at perf.c:448
#10 0x0000000000478518 in run_argv (argcp=argcp@entry=0x7fffffffe23c, argv=argv@entry=0x7fffffffe230) at perf.c:492
#11 0x0000000000478789 in main (argc=2, argv=0x7fffffffe3d0) at perf.c:609
(gdb) q


it's caused by following commit:
  commit ebe9729c8c3171aa46ad5d7af40acdc29806689d
  Author: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
  Date:   Wed Nov 18 15:40:24 2015 +0900

it kind of assumes that __machine__create_kernel_maps is called on
machine, but we don't do that in the tests/dwarf-unwind.c,
only following initialization:

        machines__init(&machines);

        machine = machines__find(&machines, HOST_KERNEL_ID);
        if (!machine) {
                pr_err("Could not get machine\n");
                return -1;
        }


we could call machine__create_kernel_maps right here to fix the issue,
(please check attached patch), but I wonder what's the proper interface
we want to have for creating machine..

thanks,
jirka


---
diff --git a/tools/perf/tests/dwarf-unwind.c b/tools/perf/tests/dwarf-unwind.c
index b2357e8115a2..3cce13b19cbb 100644
--- a/tools/perf/tests/dwarf-unwind.c
+++ b/tools/perf/tests/dwarf-unwind.c
@@ -173,6 +173,11 @@ int test__dwarf_unwind(int subtest __maybe_unused)
 		return -1;
 	}
 
+	if (machine__create_kernel_maps(machine)) {
+		pr_err("Failed to create kernel maps\n");
+		return -1;
+	}
+
 	callchain_param.record_mode = CALLCHAIN_DWARF;
 
 	if (init_live_machine(machine)) {

  reply	other threads:[~2015-11-27  8:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26 20:45 Arnaldo Carvalho de Melo
2015-11-27  8:21 ` Jiri Olsa [this message]
2015-11-27 16:03   ` Arnaldo Carvalho de Melo
2015-11-27 16:17     ` Arnaldo Carvalho de Melo
2015-11-29 20:13       ` Jiri Olsa
2015-11-29  7:55   ` [tip:perf/core] perf test: 'unwind' test should create kernel maps tip-bot for Jiri Olsa

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=20151127082121.GA24503@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --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

all inboxes | Powered by JetHome®