Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965280AbbKDKtf (ORCPT ); Wed, 4 Nov 2015 05:49:35 -0500 Received: from ud10.udmedia.de ([194.117.254.50]:52634 "EHLO mail.ud10.udmedia.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932467AbbKDKtd (ORCPT ); Wed, 4 Nov 2015 05:49:33 -0500 Date: Wed, 4 Nov 2015 11:49:30 +0100 From: Markus Trippelsdorf To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Arnaldo Carvalho de Melo , Thomas Gleixner , Jiri Olsa , Andrew Morton Subject: Re: perf top segfaults on current git Message-ID: <20151104104929.GB332@x4> References: <20151104101533.GA332@x4> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151104101533.GA332@x4> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4004 Lines: 77 On 2015.11.04 at 11:15 +0100, Markus Trippelsdorf wrote: > On 2015.11.03 at 11:02 +0100, Ingo Molnar wrote: > > > > Please pull the latest perf-core-for-linus git tree from: > > Since the current merge "perf top" segfaults on my machine: > > Program received signal SIGSEGV, Segmentation fault. > > __map__is_kernel (map=map@entry=0x1abb7a0) at util/map.c:238 > 238 return __machine__kernel_map(map->groups->machine, map->type) == map; > (gdb) bt > #0 __map__is_kernel (map=map@entry=0x1abb7a0) at util/map.c:238 > #1 0x00000000004393e4 in symbol_filter (map=map@entry=0x1abb7a0, sym=sym@entry=0x1a88560) at builtin-top.c:658 > #2 0x00000000004fcd4d in dso__load_sym (dso=dso@entry=0x166dae0, map=map@entry=0x1abb7a0, syms_ss=0x7fffffff7680, runtime_ss=runtime_ss@entry=0x7fffffff7680, > filter=filter@entry=0x4393c0 , kmodule=0) at util/symbol-elf.c:1082 > #3 0x00000000004a64e0 in dso__load (dso=0x166dae0, map=map@entry=0x1abb7a0, filter=filter@entry=0x4393c0 ) at util/symbol.c:1530 > #4 0x00000000004b941f in map__load (filter=0x4393c0 , map=) at util/map.c:289 > #5 map__find_symbol (map=0x1abb7a0, addr=40188, filter=0x4393c0 ) at util/map.c:333 > #6 0x00000000004803b1 in perf_event__preprocess_sample (event=event@entry=0x7ffff6a7a5f0, machine=machine@entry=0x164c7b8, al=al@entry=0x7fffffff8a90, > sample=sample@entry=0x7fffffff8b20) at util/event.c:1045 > #7 0x0000000000439837 in perf_event__process_sample (machine=0x164c7b8, sample=0x7fffffff8b20, evsel=0x164c320, event=0x7ffff6a7a5f0, tool=0x7fffffff8ef0) > at builtin-top.c:737 > #8 perf_top__mmap_read_idx (top=top@entry=0x7fffffff8ef0, idx=idx@entry=0) at builtin-top.c:870 > #9 0x000000000043b9ef in perf_top__mmap_read (top=0x7fffffff8ef0) at builtin-top.c:887 > #10 __cmd_top (top=0x7fffffff8ef0) at builtin-top.c:1000 > #11 cmd_top (argc=, argv=, prefix=) at builtin-top.c:1329 > #12 0x00000000004756b3 in run_builtin (p=p@entry=0x5b0608 , argc=argc@entry=2, argv=argv@entry=0x7fffffffe500) at perf.c:386 > #13 0x00000000004203e2 in handle_internal_command (argv=0x7fffffffe500, argc=2) at perf.c:447 > #14 run_argv (argv=0x7fffffffe290, argcp=0x7fffffffe29c) at perf.c:491 > #15 main (argc=2, argv=0x7fffffffe500) at perf.c:608 > > It only happens occasionally (~every third or fourth run). Apparently it started with: commit cfc5acd4c80b875d2f739d6a93562034aee5563f Author: Arnaldo Carvalho de Melo Date: Wed Sep 23 15:15:54 2015 -0300 perf top: Filter symbols based on __map__is_kernel(map) Instead of using dso->kernel, this is equivalent at the moment, and helps in reducing the accesses to dso->kernel. Cc: Adrian Hunter Cc: Borislav Petkov Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-1pc2v63iphtifovw3bv0bo1v@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index bdaf44f24d5d..38d4d6cac823 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -655,7 +655,7 @@ static int symbol_filter(struct map *map, struct symbol *sym) { const char *name = sym->name; - if (!map->dso->kernel) + if (!__map__is_kernel(map)) return 0; /* * ppc64 uses function descriptors and appends a '.' to the -- Markus -- 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/