linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Ian Rogers <irogers@google.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 1/4] perf annotate-data: Improve debug message with location info
Date: Tue, 16 Apr 2024 11:23:21 -0300	[thread overview]
Message-ID: <Zh6J2WHVBHV7fXE6@x1> (raw)
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;

  reply	other threads:[~2024-04-16 14:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12 18:33 [PATCH 0/4] perf annotate-data: A couple of small updates Namhyung Kim
2024-04-12 18:33 ` [PATCH 1/4] perf annotate-data: Improve debug message with location info Namhyung Kim
2024-04-16 14:23   ` Arnaldo Carvalho de Melo [this message]
2024-04-12 18:33 ` [PATCH 2/4] perf dwarf-aux: Check pointer offset when checking variables Namhyung Kim
2024-04-12 18:33 ` [PATCH 3/4] perf dwarf-aux: Check variable address range properly Namhyung Kim
2024-04-12 18:33 ` [PATCH 4/4] perf annotate-data: Handle RSP if it's not the FB register Namhyung Kim
2024-04-16 21:06 ` [PATCH 0/4] perf annotate-data: A couple of small updates Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zh6J2WHVBHV7fXE6@x1 \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).