From patchwork Fri Nov 21 10:54:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 41296 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D96E123C27 for ; Fri, 21 Nov 2014 10:55:17 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id q1sf2885921lam.9 for ; Fri, 21 Nov 2014 02:55:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=loR0hZg2BQuytxjdmV2EBJ3ZP2JfgvSWNNgSx0ICkh0=; b=fznqcYgx6OxT9XQX1Aw7aEYp1+5EmGHylSdhE79fhlcCIyoZsNkg1TdbnhwGc6qLp4 B2Dm4GUTtmJrRtVu+2RoeVsODXyeHh+FixOFYTXnPPDeaN9DZhzkj2TQVbhTYf0T3qaS X3LbB1xdTQ2U6yiI/dPceLJBLaPRAUJr68h5qUSLj1AZ5hv2Esqq49cXZ/XT+qeAwjIw ELFpPE/RsGYSnFK8CPyScKJooxRudhMBYUpdX1BSr0EV4NunfFxGxriD1PQJwHx3Ffl7 fXB3T0cR+6qV+r8OYJ4fidAMWuHuKrln4f90hN0Z5PesatnW11Z4uKYTZKy2t37LKkRL p/CA== X-Gm-Message-State: ALoCoQmIwm9WhaBgA0+P+QiBi8qjsojpFZQqInk3yU4A4J4+PmeWmBSlFiDUS4T5d6HG0PGBHcna X-Received: by 10.152.88.98 with SMTP id bf2mr1320691lab.1.1416567316711; Fri, 21 Nov 2014 02:55:16 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.227 with SMTP id ap3ls175220lac.60.gmail; Fri, 21 Nov 2014 02:55:16 -0800 (PST) X-Received: by 10.112.144.228 with SMTP id sp4mr3556339lbb.58.1416567316435; Fri, 21 Nov 2014 02:55:16 -0800 (PST) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id uj9si4778747lbb.97.2014.11.21.02.55.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 02:55:16 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by mail-lb0-f175.google.com with SMTP id u10so900880lbd.20 for ; Fri, 21 Nov 2014 02:55:16 -0800 (PST) X-Received: by 10.152.6.228 with SMTP id e4mr3542632laa.71.1416567316298; Fri, 21 Nov 2014 02:55:16 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp63913lbc; Fri, 21 Nov 2014 02:55:15 -0800 (PST) X-Received: by 10.68.91.66 with SMTP id cc2mr5748780pbb.156.1416567314819; Fri, 21 Nov 2014 02:55:14 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fn4si7592062pab.166.2014.11.21.02.55.14 for ; Fri, 21 Nov 2014 02:55:14 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757908AbaKUKzL (ORCPT + 26 others); Fri, 21 Nov 2014 05:55:11 -0500 Received: from mail-wg0-f51.google.com ([74.125.82.51]:34969 "EHLO mail-wg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751175AbaKUKzJ (ORCPT ); Fri, 21 Nov 2014 05:55:09 -0500 Received: by mail-wg0-f51.google.com with SMTP id k14so6092111wgh.38 for ; Fri, 21 Nov 2014 02:55:08 -0800 (PST) X-Received: by 10.194.250.105 with SMTP id zb9mr6048617wjc.123.1416567308725; Fri, 21 Nov 2014 02:55:08 -0800 (PST) Received: from marmot.wormnet.eu (marmot.wormnet.eu. [188.246.204.87]) by mx.google.com with ESMTPSA id w4sm7520683wjw.39.2014.11.21.02.55.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Nov 2014 02:55:07 -0800 (PST) From: Steve Capper To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , will.deacon@arm.com, Paul Mackerras , Ingo Molnar , Arnaldo Carvalho de Melo , Steve Capper Subject: [PATCH] perf symbols: Consider the syms_ss in dso__load_sym Date: Fri, 21 Nov 2014 10:54:57 +0000 Message-Id: <1416567297-9000-1-git-send-email-steve.capper@linaro.org> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: steve.capper@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In dso__load_sym we only try to load the .debug_frame section from the runtime image. For distros, the debug symbols are generally in a separate file. As a result, running perf report on arm64 can give errors such as: "$file with build id $id not found, continuing without symbols" Even when the debug symbols have been correctly installed (and loaded by perf). This patch adds logic to dso__load_sym to query syms_ss for the .debug_frame section if it can't be found in the elf file pointed to by runtime_ss. Signed-off-by: Steve Capper --- This patch is against 3.18-rc5. --- tools/perf/util/symbol-elf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 1e23a5b..1336392 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -830,8 +830,11 @@ int dso__load_sym(struct dso *dso, struct map *map, continue; sec = elf_getscn(runtime_ss->elf, sym.st_shndx); - if (!sec) - goto out_elf_end; + if (!sec) { + sec = elf_getscn(syms_ss->elf, sym.st_shndx); + if (!sec) + goto out_elf_end; + } gelf_getshdr(sec, &shdr);