Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp23664lqb; Tue, 16 Apr 2024 07:51:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWL+i2uA86rjzIyAaGlzCctFgMLGKi4P8g7pp26SvoqXSsBoSstKwA8kxDxivzCdBUOBXfc01pH62KI4XbA5ypR5y7bDyn0mg3olfHRiQ== X-Google-Smtp-Source: AGHT+IEF5Ngov8sKdluqVOCeUHyykKVp0E6uV5eidiQiN0mh/5zmNFUiotgXKcyUuVd8jh4JldCd X-Received: by 2002:a17:903:2b10:b0:1e6:622c:7bb4 with SMTP id mc16-20020a1709032b1000b001e6622c7bb4mr7809626plb.19.1713279104015; Tue, 16 Apr 2024 07:51:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713279104; cv=pass; d=google.com; s=arc-20160816; b=szambqBzMRICBLv+s3SPDg6TG7KTztqi0r6FdeUGtNyMczne2L7+erE0QiTuLg5VxC xlUOLiB2YHudgK3KFodJ8DSJCqQrhSHNjsIONWhygM6kflGEps5OaGoymysWXYz2bbgV FJzUYPnea1+BXbflnIiVkojVGxp0JlkK01VM4DXZnGaqw8h1zGQ/qyqJc+0Hh2cTgGhe jkQLKIBO8H9nFQfJwfN5xXAur0nx8fIclgrszVyHKT+Hz/4zbX9rN06wxhnm3nSP1GRL Z0Mvb5GsLQ5wzX4kvWs7aPQNGjAF93dWsHLwBk6Eyw/R7WVMa9QbOsS7ejsQWfP2C34O MBhw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=R6zPi7XjJn+v2OS0fnJ9yY9cgWsFK/WwPSTzsHSb4k8=; fh=49GrrO/H3LiGmymuFnNd59pBYHHWBS2xk/6Ejg0rn8E=; b=0ZqOIgaR2wuA9d1xj1g6jJcxStWIx+p8LSRCeABNbfsvn2ePAxu1XG2sr9nn6QQr9l 8V0HNMJ2C+Om8Wz+Zyqnq2WY2ArmtbOMgj5QjqKIfglSDUOADM5kUu0u+LE9p2JiuGG9 r+BfoknlLLkh/0Su0TY7r9/LyLSpxCCtfNryvkbZBzdRXRZkkcGfD+jLPnaWc5pKXr8Y dsKD4t9BYnHOi6D0jtlcJV/6nC/zwLGZFgALwUslxtfpIOMAe/aKutlyr/MqWohok2n9 bsnCEyoUkcAD9Bp/aOQRfQHQn79nfGbRd0yKFryis98U9zS2QgiOZqzgJP7KDEcKVlPq Wadg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dHFs35ra; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-147006-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147006-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id p6-20020a170902780600b001e6765cf0c9si3512170pll.437.2024.04.16.07.51.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 07:51:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147006-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dHFs35ra; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-147006-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147006-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 00964B24A45 for ; Tue, 16 Apr 2024 14:27:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D946D1E507; Tue, 16 Apr 2024 14:23:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dHFs35ra" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A7D1128805; Tue, 16 Apr 2024 14:23:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713277406; cv=none; b=CgF+FesKF4J4LRL0x3zh6QuQeFSKbwyQT97K+KALjtuZdLAv6L2a3XHd6gNTGiZ0FR/ocM/U1YIyhdYCriSN9ZCUsb/F8lHeNsFwvMNDdnK8MOMZ8g0zkLb7EiaPdC2HRNU6WLNkuf3XwKc2IHrnvpUeruSvHxOVqGsd8DvjoHw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713277406; c=relaxed/simple; bh=58RkNN441ASwLnkSEKiz2PfX3QCesXCmqb6Tn1mJXoo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=J0DTgvcoAX9VrfzFcc4CUv9z1IXkn56FKDE6Kv04YhI4guEMZGWLVlna4OV9YN5GUuc5c9bYxKv457ueJ291njFeaf5CH4lGRtulaOiT4aQv3tc0YzO67+1feOt7XuFm554sO4jD96U87XlvlWwFjQ+2FNqjzNRPMwsXkUDKfxg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dHFs35ra; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30198C113CE; Tue, 16 Apr 2024 14:23:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713277404; bh=58RkNN441ASwLnkSEKiz2PfX3QCesXCmqb6Tn1mJXoo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dHFs35rafTRXGYB4DLjWfm2CAQJyChKJAeupgqZBMrcpVrfd1mltGOXTkkgC/Ekkd vHH9B8qVs07tISfP3i4gZ/Gnv30Mi5XEHVkxznVlyjsPPbMUerEFWkAoKZSws5kIzT 5T7Q+JYK9EIeVxhkclIE53jfTRsyzFtZcZWLrHV9MaQaER4b2kz+5gkjCKr/h2P4ur VZ8Xr04JSd9Ay+sqPosrNrrnEYXPvt5Ycu/i4cCDTLEcc7pg2LgKezFw2x4HWdbzAf WgYU9vl8Gm7lkb3hF3Qpxhl+L3Xfw0mp+F6QsgvJ14kXOXj7o3HWhyjlykx99u2KoR fjUU/7zEuJJJA== Date: Tue, 16 Apr 2024 11:23:21 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Ian Rogers , Kan Liang , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Subject: Re: [PATCH 1/4] perf annotate-data: Improve debug message with location info Message-ID: References: <20240412183310.2518474-1-namhyung@kernel.org> <20240412183310.2518474-2-namhyung@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240412183310.2518474-2-namhyung@kernel.org> On Fri, Apr 12, 2024 at 11:33:07AM -0700, Namhyung Kim wrote: > To verify it found the correct variable, let's add the location > expression to the debug message. Added the patch below, following your existing convention of casting Dwarf_Offset/Darf_Word to long. - Arnaldo diff --git a/tools/perf/util/annotate-data.c b/tools/perf/util/annotate-data.c index c6eb5b2cc4d50d79..e53d66c46c540b75 100644 --- a/tools/perf/util/annotate-data.c +++ b/tools/perf/util/annotate-data.c @@ -110,24 +110,24 @@ static void pr_debug_location(Dwarf_Die *die, u64 pc, int reg) break; case DW_OP_breg0 ...DW_OP_breg31: pr_info("base=reg%d, offset=%#lx\n", - ops->atom - DW_OP_breg0, ops->number); + ops->atom - DW_OP_breg0, (long)ops->number); break; case DW_OP_regx: - pr_info("reg%ld\n", ops->number); + pr_info("reg%ld\n", (long)ops->number); break; case DW_OP_bregx: pr_info("base=reg%ld, offset=%#lx\n", - ops->number, ops->number2); + (long)ops->number, (long)ops->number2); break; case DW_OP_fbreg: - pr_info("use frame base, offset=%#lx\n", ops->number); + pr_info("use frame base, offset=%#lx\n", (long)ops->number); break; case DW_OP_addr: - pr_info("address=%#lx\n", ops->number); + pr_info("address=%#lx\n", (long)ops->number); break; default: pr_info("unknown: code=%#x, number=%#lx\n", - ops->atom, ops->number); + ops->atom, (long)ops->number); break; } break;