From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753098AbcAGJSq (ORCPT ); Thu, 7 Jan 2016 04:18:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54322 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752969AbcAGJOX (ORCPT ); Thu, 7 Jan 2016 04:14:23 -0500 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , David Ahern , Ingo Molnar , Namhyung Kim , Peter Zijlstra , Noel Grandin , Adrian Hunter Subject: [PATCH 04/13] perf tools libunwind: Check for mmaps also in MAP__VARIABLE tree Date: Thu, 7 Jan 2016 10:14:01 +0100 Message-Id: <1452158050-28061-5-git-send-email-jolsa@kernel.org> In-Reply-To: <1452158050-28061-1-git-send-email-jolsa@kernel.org> References: <1452158050-28061-1-git-send-email-jolsa@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We've seen cases (softice) where DWARF unwinder went through non executable mmaps, which we need to lookup in MAP__VARIABLE tree. Reported-by: Noel Grandin Tested-by: Noel Grandin Link: http://lkml.kernel.org/n/tip-@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/util/unwind-libunwind.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c index f37859c04317..ee7e372297e5 100644 --- a/tools/perf/util/unwind-libunwind.c +++ b/tools/perf/util/unwind-libunwind.c @@ -319,6 +319,15 @@ static struct map *find_map(unw_word_t ip, struct unwind_info *ui) thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER, MAP__FUNCTION, ip, &al); + if (!al.map) { + /* + * We've seen cases (softice) where DWARF unwinder went + * through non executable mmaps, which we need to lookup + * in MAP__VARIABLE tree. + */ + thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER, + MAP__VARIABLE, ip, &al); + } return al.map; } -- 2.4.3