Skip to content

Commit

Permalink
symbolizer: Log addresses in hexadecimal (#2226)
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Javier Honduvilla Coto <javierhonduco@gmail.com>

Signed-off-by: Francisco Javier Honduvilla Coto <javierhonduco@gmail.com>
  • Loading branch information
javierhonduco authored Dec 6, 2022
1 parent f9d9dea commit 6f3dfab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/symbol/addr2line/dwarf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
return nil, err
}
return lines, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/symbol/symbol.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (s *Symbolizer) Symbolize(ctx context.Context, m *pb.Mapping, locations []*

// pcToLines returns the line number of the given PC while keeping the track of symbolization attempts and failures.
func (s *Symbolizer) pcToLines(liner liner, buildID, key string, addr uint64) []profile.LocationLine {
logger := log.With(s.logger, "addr", addr, "buildid", buildID)
logger := log.With(s.logger, "addr", fmt.Sprintf("0x%x", addr), "buildid", buildID)
// Check if we already attempt to symbolize this location and failed.
if _, failedBefore := s.symbolizationFailed[key][addr]; failedBefore {
level.Debug(logger).Log("msg", "location already had been attempted to be symbolized and failed, skipping")
Expand Down

0 comments on commit 6f3dfab

Please sign in to comment.