From patchwork Wed Feb 11 21:09:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 44576 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1353C21527 for ; Wed, 11 Feb 2015 21:11:47 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id c13sf4348202eek.1 for ; Wed, 11 Feb 2015 13:11:46 -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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=GrjrvH1PTXxl19Cp62CVFxT7VU5Jw+igYCqXABMBVvg=; b=JdWQvkOTMrcyNf57zGwZJVsPWMB6XWZga8q+qfV/A/nVZWmecan15aOwhd4v7uD0Fl usAqDFXxFT5yyijsMGYjLcFuYS3zkN90388Mrjots42KfCRLVEYt9DNAY45qhfz4NtGU VJjsvjAChr7Dbd1laQ8AU//JWWHltRp+AQSJZRfY8Mb2gjwEZuPmCmkQLtPXRi2izYQt 5wvCApV0fvMJqGlvMCLVDvqaZ9IwNM3Te1aLc6Pn8yMJz9T4RlXDvX9I7LPKzlRkdQLz rx5OVLx6DztwtCgyv3FoMoU67ypsDnHlaeNWBp7qTZ6qxf8nkdIsXaUA5mXIMTpYiPiZ zuVA== X-Gm-Message-State: ALoCoQkDeq9sipAGQweJdQZiuEBwd1S6rtPzdGlB16vg2mxRd7VH6RJj49rAJf2diS9Kn1W6uP6X X-Received: by 10.112.163.42 with SMTP id yf10mr80864lbb.8.1423689106084; Wed, 11 Feb 2015 13:11:46 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.199 with SMTP id u7ls119435lau.63.gmail; Wed, 11 Feb 2015 13:11:45 -0800 (PST) X-Received: by 10.112.17.67 with SMTP id m3mr370233lbd.109.1423689105798; Wed, 11 Feb 2015 13:11:45 -0800 (PST) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id ml8si1535643lbc.77.2015.02.11.13.11.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2015 13:11:45 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id p9so5783678lbv.0 for ; Wed, 11 Feb 2015 13:11:45 -0800 (PST) X-Received: by 10.152.6.195 with SMTP id d3mr554377laa.36.1423689105661; Wed, 11 Feb 2015 13:11:45 -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.35.133 with SMTP id h5csp43317lbj; Wed, 11 Feb 2015 13:11:44 -0800 (PST) X-Received: by 10.68.202.194 with SMTP id kk2mr716886pbc.41.1423689093350; Wed, 11 Feb 2015 13:11:33 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fn9si2224943pab.229.2015.02.11.13.11.32; Wed, 11 Feb 2015 13:11:33 -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 S1754635AbbBKVJc (ORCPT + 28 others); Wed, 11 Feb 2015 16:09:32 -0500 Received: from mail.kernel.org ([198.145.29.136]:38640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754483AbbBKVJ2 (ORCPT ); Wed, 11 Feb 2015 16:09:28 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D376A20219; Wed, 11 Feb 2015 21:09:26 +0000 (UTC) Received: from zoo.ghostprotocols.net.ghostprotocols.net (unknown [191.184.42.27]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 48EE72021A; Wed, 11 Feb 2015 21:09:22 +0000 (UTC) From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Victor Kamensky , Adrian Hunter , Anton Blanchard , Avi Kivity , Dave Martin , Jiri Olsa , Masami Hiramatsu , Paul Mackerras , Peter Zijlstra , Russell King , Waiman Long , Will Deacon , linux-arm-kernel@lists.infradead.org, Arnaldo Carvalho de Melo Subject: [PATCH 07/21] perf symbols: debuglink should take symfs option into account Date: Wed, 11 Feb 2015 18:09:01 -0300 Message-Id: <1423688955-8094-8-git-send-email-acme@kernel.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1423688955-8094-1-git-send-email-acme@kernel.org> References: <1423688955-8094-1-git-send-email-acme@kernel.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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: acme@kernel.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.169 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: , From: Victor Kamensky Currently code that tries to read corresponding debug symbol file from .gnu_debuglink section (DSO_BINARY_TYPE__DEBUGLINK) does not take in account symfs option, so filename__read_debuglink function cannot open ELF file, if symfs option is used. Fix is to add proper handling of symfs as it is done in other places: use __symbol__join_symfs function to get real file name of target ELF file. Signed-off-by: Victor Kamensky Tested-by: David Ahern Acked-by: David Ahern Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Anton Blanchard Cc: Avi Kivity Cc: Dave Martin Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Russell King Cc: Waiman Long Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1422340442-4673-3-git-send-email-victor.kamensky@linaro.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/dso.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index a8b3f18db1a5..814554d1b857 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -45,13 +45,13 @@ int dso__read_binary_type_filename(const struct dso *dso, case DSO_BINARY_TYPE__DEBUGLINK: { char *debuglink; - strncpy(filename, dso->long_name, size); - debuglink = filename + dso->long_name_len; + len = __symbol__join_symfs(filename, size, dso->long_name); + debuglink = filename + len; while (debuglink != filename && *debuglink != '/') debuglink--; if (*debuglink == '/') debuglink++; - ret = filename__read_debuglink(dso->long_name, debuglink, + ret = filename__read_debuglink(filename, debuglink, size - (debuglink - filename)); } break;