From patchwork Tue Jan 27 06:34:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vkamensky X-Patchwork-Id: 43812 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 C597F20D5D for ; Tue, 27 Jan 2015 06:34:49 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id b13sf6501925wgh.1 for ; Mon, 26 Jan 2015 22:34:49 -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=bqj/BS18HT0LOH4bRosPAeLmypR6cy7p5rm9Xf9jqQheqzrvEv8RqwMqeUu0Yj0VWm IhZFSOFaCS5NYSyKiWLS7fCl4Q/SIt2Z880PFOQ3gFoL+jcYcO1Ob3OtaGpLcrh8Y1cP c7PFsQ+6FkS/aWOSZy8Uj+EKuDlhi/JaTcogfUVR3PgSjy8JOv9/BcsBUJqXuDpphN+5 oQmT8BpebKckeHSHWn9niHgq6v6ps+xuLqgqsS9KopTUg2NDbVEw6DniUNw98HsLQW99 Q9koXZTG+LwfyU9obACbDTUhZP5lIj/semWE2j9h5thM5lPanU6EIE9Neq0vXoWAmLG4 fxtQ== X-Gm-Message-State: ALoCoQnjiwoMnd1vMXGp/UreGBrta1AyqVucw28Zo4yG4uaBwNNhi5HF7F2GNPiZsaPM4tS/Z+AQ X-Received: by 10.180.105.97 with SMTP id gl1mr2311230wib.7.1422340489104; Mon, 26 Jan 2015 22:34:49 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.196 with SMTP id ba4ls610354lab.40.gmail; Mon, 26 Jan 2015 22:34:48 -0800 (PST) X-Received: by 10.112.220.36 with SMTP id pt4mr2138508lbc.15.1422340488920; Mon, 26 Jan 2015 22:34:48 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id uc2si271251lac.80.2015.01.26.22.34.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 26 Jan 2015 22:34:48 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id p9so11420894lbv.8 for ; Mon, 26 Jan 2015 22:34:48 -0800 (PST) X-Received: by 10.112.98.99 with SMTP id eh3mr2170458lbb.32.1422340488601; Mon, 26 Jan 2015 22:34:48 -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 h5csp1001041lbj; Mon, 26 Jan 2015 22:34:47 -0800 (PST) X-Received: by 10.66.132.44 with SMTP id or12mr40673983pab.42.1422340486424; Mon, 26 Jan 2015 22:34:46 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ot4si458534pab.22.2015.01.26.22.34.45; Mon, 26 Jan 2015 22:34:46 -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 S1754079AbbA0Gel (ORCPT + 28 others); Tue, 27 Jan 2015 01:34:41 -0500 Received: from mail-pd0-f169.google.com ([209.85.192.169]:62779 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753082AbbA0GeW (ORCPT ); Tue, 27 Jan 2015 01:34:22 -0500 Received: by mail-pd0-f169.google.com with SMTP id g10so17017519pdj.0 for ; Mon, 26 Jan 2015 22:34:22 -0800 (PST) X-Received: by 10.68.134.234 with SMTP id pn10mr38355394pbb.150.1422340462543; Mon, 26 Jan 2015 22:34:22 -0800 (PST) Received: from kamensky-w530.hsd1.ca.comcast.net ([24.6.73.122]) by mx.google.com with ESMTPSA id vk4sm410289pbc.74.2015.01.26.22.34.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Jan 2015 22:34:21 -0800 (PST) From: Victor Kamensky To: Arnaldo Carvalho de Melo , Russell King , Namhyung Kim , David Ahern , Will Deacon Cc: 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 V3 2/2] perf symbols: debuglink should take symfs option into account Date: Mon, 26 Jan 2015 22:34:02 -0800 Message-Id: <1422340442-4673-3-git-send-email-victor.kamensky@linaro.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1422340442-4673-1-git-send-email-victor.kamensky@linaro.org> References: <1422340442-4673-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.217.177 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;