From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752300AbdGDNLh (ORCPT ); Tue, 4 Jul 2017 09:11:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57424 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752478AbdGDNLf (ORCPT ); Tue, 4 Jul 2017 09:11:35 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 024AB15D9 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=jolsa@kernel.org DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 024AB15D9 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Hekuang , lkml , Ingo Molnar , Peter Zijlstra , Namhyung Kim , David Ahern Subject: [PATCH] perf unwind: Do not fail due to missing unwind support Date: Tue, 4 Jul 2017 15:11:31 +0200 Message-Id: <20170704131131.27508-1-jolsa@kernel.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 04 Jul 2017 13:11:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We currently fail the MMAP event processing if we don't have the MMAP event's specific arch unwind support compiled in. That's wrong and can lead to unresolved mmaps in report output for 32bit binaries on 64bit server, like in this example on x86_64 server: $ cat ex.c int main(int argc, char **argv) { while (1) {} } $ gcc -o ex -m32 ex.c $ perf record ./ex ^C[ perf record: Woken up 2 times to write data ] [ perf record: Captured and wrote 0.371 MB perf.data (9322 samples) ] Before: $ perf report --stdio SNIP # Overhead Command Shared Object Symbol # ........ ....... ................ ...................... # 100.00% ex [unknown] [.] 0x00000000080483de 0.00% ex [unknown] [.] 0x00000000f76dba4f 0.00% ex [unknown] [.] 0x00000000f76e4c11 0.00% ex [unknown] [.] 0x00000000f76daa30 After: $ perf report --stdio SNIP # Overhead Command Shared Object Symbol # ........ ....... ............. ............... # 100.00% ex ex [.] main 0.00% ex ld-2.24.so [.] _dl_start 0.00% ex ld-2.24.so [.] do_lookup_x 0.00% ex ld-2.24.so [.] _start The fix is not to fail, just warn if there's not unwind support compiled in. Cc: Hekuang Link: http://lkml.kernel.org/n/tip-cm8sdv60vroypck9n65rsmo4@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/util/unwind-libunwind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c index 6d542a4e0648..8aef572d0889 100644 --- a/tools/perf/util/unwind-libunwind.c +++ b/tools/perf/util/unwind-libunwind.c @@ -50,7 +50,7 @@ int unwind__prepare_access(struct thread *thread, struct map *map, if (!ops) { pr_err("unwind: target platform=%s is not supported\n", arch); - return -1; + return 0; } out_register: unwind__register_ops(thread, ops); -- 2.9.4