lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zh6J2WHVBHV7fXE6@x1>
Date: Tue, 16 Apr 2024 11:23:21 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Ian Rogers <irogers@...gle.com>, Kan Liang <kan.liang@...ux.intel.com>,
	Jiri Olsa <jolsa@...nel.org>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
	linux-perf-users@...r.kernel.org
Subject: Re: [PATCH 1/4] perf annotate-data: Improve debug message with
 location info

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;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ