From patchwork Thu Jan 22 04:52:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vkamensky X-Patchwork-Id: 43488 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5EF4D218DB for ; Thu, 22 Jan 2015 04:53:53 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id b13sf5494561wgh.1 for ; Wed, 21 Jan 2015 20:53:52 -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=VcxdyGWrRL1/s/d1ZSntUna7e5h36+Nq1hsGG1Rdv58=; b=gmRKroIk1q6CM8cyztqRbnnehAo25+baM2jnZJy4jmGDCySGWu8zPnS1i6OmFxbGIv UR/5owt2WZ+K+sKcD17qq2/qtUsFCrErpbg5oxNSGUdi0YniwRDZtEzrVnef3cCEx9Q5 /T73P3IrvmE4eSg1T5nHA3SMvdAAt0S5X+BKUkJtGfTwj8y0gpo7sKxqvyH01cu7deTW jhPIdRHccuIZAx3WM5W+T5xPB3kFfv9HFgo38kDFRyV7ZMRPveTi32XIYQ5FpWAWVa/g x1IF3qY2ffJ6MWDYWLwc3vtBHIkoNGsTa04Jwo5JzCRkZx6DHKIisCH2LPxjJbKkQxYM G99g== X-Gm-Message-State: ALoCoQkdUJBiaVDkastqrtwyO9Y1FkzT4DVf1xFpPjzz8GKBot2VHDef9KIayVR09xYRdWN/JuC3 X-Received: by 10.180.13.83 with SMTP id f19mr87411wic.7.1421902432692; Wed, 21 Jan 2015 20:53:52 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.179.67 with SMTP id de3ls117290lac.60.gmail; Wed, 21 Jan 2015 20:53:52 -0800 (PST) X-Received: by 10.153.5.1 with SMTP id ci1mr46849946lad.67.1421902432232; Wed, 21 Jan 2015 20:53:52 -0800 (PST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id m13si9891255lbg.32.2015.01.21.20.53.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Jan 2015 20:53:51 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id q1so28795850lam.2 for ; Wed, 21 Jan 2015 20:53:51 -0800 (PST) X-Received: by 10.112.180.135 with SMTP id do7mr47263559lbc.23.1421902431743; Wed, 21 Jan 2015 20:53:51 -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.9.200 with SMTP id c8csp136731lbb; Wed, 21 Jan 2015 20:53:50 -0800 (PST) X-Received: by 10.68.179.165 with SMTP id dh5mr68619777pbc.131.1421902430355; Wed, 21 Jan 2015 20:53:50 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zc4si1841922pbb.135.2015.01.21.20.53.48; Wed, 21 Jan 2015 20:53:50 -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 S1754433AbbAVExp (ORCPT + 28 others); Wed, 21 Jan 2015 23:53:45 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:37955 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753741AbbAVExa (ORCPT ); Wed, 21 Jan 2015 23:53:30 -0500 Received: by mail-pa0-f47.google.com with SMTP id lj1so13316322pab.6 for ; Wed, 21 Jan 2015 20:53:30 -0800 (PST) X-Received: by 10.66.252.67 with SMTP id zq3mr62883696pac.60.1421902410029; Wed, 21 Jan 2015 20:53:30 -0800 (PST) Received: from kamensky-w530.hsd1.ca.comcast.net ([24.6.73.122]) by mx.google.com with ESMTPSA id or4sm7800278pab.30.2015.01.21.20.53.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jan 2015 20:53:29 -0800 (PST) From: Victor Kamensky To: Arnaldo Carvalho de Melo , Namhyung Kim , David Ahern , Will Deacon Cc: Russell King , Peter Zijlstra , Paul Mackerras , Ingo Molnar , Adrian Hunter , Jiri Olsa , Avi Kivity , Masami Hiramatsu , Anton Blanchard , Dave Martin , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Victor Kamensky , Jiri Olsa , Waiman Long Subject: [PATCH V2 3/3] perf symbols: debuglink should take symfs option into account Date: Wed, 21 Jan 2015 20:52:58 -0800 Message-Id: <1421902378-3634-4-git-send-email-victor.kamensky@linaro.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1421902378-3634-1-git-send-email-victor.kamensky@linaro.org> References: <1421902378-3634-1-git-send-email-victor.kamensky@linaro.org> 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: victor.kamensky@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.215.43 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: , 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 Cc: Peter Zijlstra Cc: Paul Mackerras Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Namhyung Kim Cc: Adrian Hunter Cc: Waiman Long Cc: David Ahern Acked-and-tested-by: David Ahern --- 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 45be944..ca8d8d5 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;