Skip to contentSkip to conversation

perf probe: Add missing 0x prefix for addresses printed in hexadecimal

PATCH In review [email protected] 2 participants 2 messages Apr 19, 2023 – Apr 21, 2023 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf probe: Add missing 0x prefix for addresses printed in hexadecimal

Hi Masami,

I'm carrying this one in my tree, FYI.

- Arnaldo

---

To fix this confusing warning:

  # perf probe -l
  Failed to find debug information for address 798240
    probe_main:prometheus_new_counter__return (on github.com/prometheus/client_golang/prometheus.NewCounter%return in /home/acme/git/prometheus-uprobes/main with counter)
  #

As that 798240 is printed with PRIx64 but has no letters, better print the 0x prefix to disambiguate.

---
 tools/perf/util/probe-finder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/probe-finder.c +1 -1
index 54b49ce85c9f2214..f171360b0ef4db06 100644
@@ -1729,7 +1729,7 @@ int debuginfo__find_probe_point(struct debuginfo *dbg, u64 addr,
 		addr += baseaddr;
 	/* Find cu die */
 	if (!dwarf_addrdie(dbg->dbg, (Dwarf_Addr)addr, &cudie)) {
-		pr_warning("Failed to find debug information for address %" PRIx64 "\n",
+		pr_warning("Failed to find debug information for address %#" PRIx64 "\n",
 			   addr);
 		ret = -EINVAL;
 		goto end;
Signature · 1 line
2.39.2
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · On Wed, 19 Apr 2023 16:36:40 -0300 [email protected] wrote:

Hi Masami,

I'm carrying this one in my tree, FYI.

Thanks! this looks good to me!

Quoted 42 lines

- Arnaldo

---

To fix this confusing warning:

  # perf probe -l
  Failed to find debug information for address 798240
    probe_main:prometheus_new_counter__return (on github.com/prometheus/client_golang/prometheus.NewCounter%return in /home/acme/git/prometheus-uprobes/main with counter)
  #

As that 798240 is printed with PRIx64 but has no letters, better print the 0x prefix to disambiguate.

---
 tools/perf/util/probe-finder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/probe-finder.c +1 -1
index 54b49ce85c9f2214..f171360b0ef4db06 100644
@@ -1729,7 +1729,7 @@ int debuginfo__find_probe_point(struct debuginfo *dbg, u64 addr,
 		addr += baseaddr;
 	/* Find cu die */
 	if (!dwarf_addrdie(dbg->dbg, (Dwarf_Addr)addr, &cudie)) {
-		pr_warning("Failed to find debug information for address %" PRIx64 "\n",
+		pr_warning("Failed to find debug information for address %#" PRIx64 "\n",
 			   addr);
 		ret = -EINVAL;
 		goto end;
Signature · 1 line
2.39.2
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>