Skip to content

Commit 5512853

Browse files
committed
Use new Lidia format insitead of dwarf
1 parent 7834dc4 commit 5512853

18 files changed

+360973
-1316
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ require (
2020
github.com/felixge/fgprof v0.9.4-0.20221116204635-ececf7638e93
2121
github.com/felixge/httpsnoop v1.0.4
2222
github.com/fsnotify/fsnotify v1.7.0
23-
github.com/go-delve/delve v1.23.1
2423
github.com/go-kit/log v0.2.1
2524
github.com/gogo/protobuf v1.3.2
2625
github.com/gogo/status v1.1.1
@@ -37,6 +36,7 @@ require (
3736
github.com/grafana/pyroscope-go/godeltaprof v0.1.8
3837
github.com/grafana/pyroscope-go/x/k6 v0.0.0-20241003203156-a917cea171d3
3938
github.com/grafana/pyroscope/api v0.4.0
39+
github.com/grafana/pyroscope/lidia v0.0.0-20250416154336-a5c33510d5ff
4040
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db
4141
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
4242
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,6 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos
253253
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
254254
github.com/fullstorydev/emulators/storage v0.0.0-20240401123056-edc69752f474 h1:TufioMBjkJ6/Oqmlye/ReuxHFS35HyLmypj/BNy/8GY=
255255
github.com/fullstorydev/emulators/storage v0.0.0-20240401123056-edc69752f474/go.mod h1:PQwxF4UU8wuL+srGxr3BOhIW5zXqgucwVlO/nPZLsxw=
256-
github.com/go-delve/delve v1.23.1 h1:MtZ13ppptttkqSuvVnwJ5CPhIAzDiOwRrYuCk3ES7fU=
257-
github.com/go-delve/delve v1.23.1/go.mod h1:S3SLuEE2mn7wipKilTvk1p9HdTMnXXElcEpiZ+VcuqU=
258256
github.com/go-fonts/dejavu v0.3.4 h1:Qqyx9IOs5CQFxyWTdvddeWzrX0VNwUAvbmAzL0fpjbc=
259257
github.com/go-fonts/dejavu v0.3.4/go.mod h1:D1z0DglIz+lmpeNYMYlxW4r22IhcdOYnt+R3PShU/Kg=
260258
github.com/go-fonts/latin-modern v0.3.3 h1:g2xNgI8yzdNzIVm+qvbMryB6yGPe0pSMss8QT3QwlJ0=
@@ -435,6 +433,8 @@ github.com/grafana/pyroscope-go/godeltaprof v0.1.8 h1:iwOtYXeeVSAeYefJNaxDytgjKt
435433
github.com/grafana/pyroscope-go/godeltaprof v0.1.8/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU=
436434
github.com/grafana/pyroscope-go/x/k6 v0.0.0-20241003203156-a917cea171d3 h1:GtwQDlBz8aJHMy2Ko28UDRGgGzi7v4Vf20+ZyXaGy7M=
437435
github.com/grafana/pyroscope-go/x/k6 v0.0.0-20241003203156-a917cea171d3/go.mod h1:nfbW6/4ke3ywlqLb+Zgr9t1z9Zv3m+2ImUp+vbkzHpc=
436+
github.com/grafana/pyroscope/lidia v0.0.0-20250416154336-a5c33510d5ff h1:9dI8HuAIA5L/EsPXkk3YqA3Pp5i7ECvQkWMwUepLoCY=
437+
github.com/grafana/pyroscope/lidia v0.0.0-20250416154336-a5c33510d5ff/go.mod h1:3f/0/CzhTk1moGlVOp2nJQKCAL+4M5GTnkfDd5hqDIk=
438438
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db h1:7aN5cccjIqCLTzedH7MZzRZt5/lsAHch6Z3L2ZGn5FA=
439439
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A=
440440
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI=

pkg/experiment/symbolizer/addrmapper.go

+1-31
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func CalculateBase(ei *BinaryLayout, m Mapping, addr uint64) (uint64, error) {
9090

9191
switch elf.Type(ei.ElfType) {
9292
case elf.ET_EXEC:
93-
return calculateExecBase(m, segment)
93+
return 0, nil
9494
case elf.ET_DYN:
9595
return calculateDynamicBase(m, segment)
9696
}
@@ -172,29 +172,6 @@ func (ei *BinaryLayout) FindProgramHeader(m Mapping, addr uint64) (*MemoryRegion
172172
return bestHeader, nil
173173
}
174174

175-
func calculateExecBase(m Mapping, h *MemoryRegion) (uint64, error) {
176-
//return 0, nil
177-
if h == nil {
178-
// Check if this is likely a PIE executable or shared library
179-
if m.Start > 0 {
180-
// This is likely a PIE executable or shared library loaded at m.Start
181-
result := m.Start - m.Offset
182-
return result, nil
183-
}
184-
185-
result := m.Start - m.Offset
186-
return result, nil
187-
}
188-
return m.Start - m.Offset + h.Off - h.Vaddr, nil
189-
}
190-
191-
func calculateRelocatableBase(m Mapping) (uint64, error) {
192-
if m.Offset != 0 {
193-
return 0, fmt.Errorf("relocatable files with non-zero offset not supported")
194-
}
195-
return m.Start, nil
196-
}
197-
198175
func calculateDynamicBase(m Mapping, h *MemoryRegion) (uint64, error) {
199176
if h == nil {
200177
return m.Start - m.Offset, nil
@@ -213,10 +190,3 @@ func calculateDynamicBase(m Mapping, h *MemoryRegion) (uint64, error) {
213190

214191
return base, nil
215192
}
216-
217-
func calculateDynamicBaseBACKUP(m Mapping, h *MemoryRegion) (uint64, error) {
218-
if h == nil {
219-
return m.Start - m.Offset, nil
220-
}
221-
return m.Start - m.Offset + h.Off - h.Vaddr, nil
222-
}

0 commit comments

Comments
 (0)