Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symbolizer: Log addresses in hexadecimal #2226

Merged
merged 1 commit into from
Dec 6, 2022

Conversation

javierhonduco
Copy link
Contributor

Found this while taking a look at #1757 (comment)

Signed-off-by: Francisco Javier Honduvilla Coto javierhonduco@gmail.com

Signed-off-by: Francisco Javier Honduvilla Coto <javierhonduco@gmail.com>
@javierhonduco javierhonduco requested a review from a team as a code owner December 6, 2022 11:16
@javierhonduco javierhonduco merged commit 6f3dfab into main Dec 6, 2022
@javierhonduco javierhonduco deleted the dwarf-symbolizer-log-in-hex branch December 6, 2022 12:07
@@ -57,7 +57,7 @@ func (dl *DwarfLiner) PCToLines(addr uint64) (lines []profile.LocationLine, err

lines, err = dl.dbgFile.SourceLines(addr)
if err != nil {
level.Debug(dl.logger).Log("msg", "failed to symbolize location", "addr", addr, "err", err)
level.Debug(dl.logger).Log("msg", "failed to symbolize location", "addr", fmt.Sprintf("0x%x", addr), "err", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI the format %#x adds the 0x

Suggested change
level.Debug(dl.logger).Log("msg", "failed to symbolize location", "addr", fmt.Sprintf("0x%x", addr), "err", err)
level.Debug(dl.logger).Log("msg", "failed to symbolize location", "addr", fmt.Sprintf("%#x", addr), "err", err)

Copy link
Contributor Author

@javierhonduco javierhonduco Dec 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL!! I think I won't change it because I find it a tiny bit less obvious. It's quite cool though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants