Skip to content

Add GoOffsetLocator that fulfills DwarfReader API. Use as shim for Go Uprobes#2207

Merged
ddelnano merged 10 commits intopixie-io:mainfrom
ddelnano:ddelnano/add-go-offset-locator
Jul 9, 2025
Merged

Add GoOffsetLocator that fulfills DwarfReader API. Use as shim for Go Uprobes#2207
ddelnano merged 10 commits intopixie-io:mainfrom
ddelnano:ddelnano/add-go-offset-locator

Conversation

@ddelnano
Copy link
Copy Markdown
Member

@ddelnano ddelnano commented Jun 4, 2025

Summary: Add GoOffsetLocator that fulfills DwarfReader APIs. Use as shim for Go Uprobes

Our current Go uprobe implementation relies on parsing DWARF information. This is memory intensive and is not ideal if end users want to keep the PEM's memory usage low (results in 100-150MB memory spikes).

In order to support lower memory uprobes and to support Go binaries without DWARF, we can introduce a shim for the existing DwarfReader API that can read the offsets from a file (via openteletrmy-go-instrumentation generated offsets) or from the existing DWARF information.

This PR introduces the GoOffsetLocator and tests that it functions properly while leaving the DWARF based tracing in place. The next set of changes will populate the offsets from pixie-io/opentelemetry-go-instrumentation#1 and provide configuration to choose the desired implementation: solely DWARF, solely static offsets or to use them in tandem.

Relevant Issues: N/A

Type of change: /kind feature

Test Plan: Existing Go bpf trace tests should pass

Comment thread src/stirling/source_connectors/socket_tracer/uprobe_manager.cc Outdated
Comment thread src/stirling/source_connectors/socket_tracer/uprobe_manager.cc
@ddelnano ddelnano force-pushed the ddelnano/add-go-offset-locator branch from f68e5f1 to 933c1e6 Compare July 8, 2025 15:58
ddelnano added 9 commits July 9, 2025 18:02
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
…overhead (memory) Go uprobes

Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
…filing

Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
… multiple times

Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
(cherry picked from commit 7ce56b9)
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
@ddelnano ddelnano force-pushed the ddelnano/add-go-offset-locator branch from 933c1e6 to 5093e7d Compare July 9, 2025 18:02
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
@ddelnano ddelnano force-pushed the ddelnano/add-go-offset-locator branch from 5093e7d to b67f84c Compare July 9, 2025 18:05
@ddelnano ddelnano merged commit 5b20e35 into pixie-io:main Jul 9, 2025
40 of 42 checks passed
@ddelnano ddelnano deleted the ddelnano/add-go-offset-locator branch July 9, 2025 20:04
ddelnano added a commit to k8sstormcenter/pixie that referenced this pull request Feb 25, 2026
… Uprobes (pixie-io#2207)

Summary: Add `GoOffsetLocator` that fulfills DwarfReader APIs. Use as
shim for Go Uprobes

Our current Go uprobe implementation relies on parsing DWARF
information. This is memory intensive and is not ideal if end users want
to keep the PEM's memory usage low (results in 100-150MB memory spikes).

In order to support lower memory uprobes and to support Go binaries
without DWARF, we can introduce a shim for the existing DwarfReader API
that can read the offsets from a file (via
openteletrmy-go-instrumentation generated offsets) or from the existing
DWARF information.

This PR introduces the `GoOffsetLocator` and tests that it functions
properly while leaving the DWARF based tracing in place. The next set of
changes will populate the offsets from
pixie-io/opentelemetry-go-instrumentation#1 and
provide configuration to choose the desired implementation: solely
DWARF, solely static offsets or to use them in tandem.

Relevant Issues: N/A

Type of change: /kind feature

Test Plan: Existing Go bpf trace tests should pass

---------

Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
ddelnano added a commit to k8sstormcenter/pixie that referenced this pull request Feb 25, 2026
… Uprobes (pixie-io#2207)

Summary: Add `GoOffsetLocator` that fulfills DwarfReader APIs. Use as
shim for Go Uprobes

Our current Go uprobe implementation relies on parsing DWARF
information. This is memory intensive and is not ideal if end users want
to keep the PEM's memory usage low (results in 100-150MB memory spikes).

In order to support lower memory uprobes and to support Go binaries
without DWARF, we can introduce a shim for the existing DwarfReader API
that can read the offsets from a file (via
openteletrmy-go-instrumentation generated offsets) or from the existing
DWARF information.

This PR introduces the `GoOffsetLocator` and tests that it functions
properly while leaving the DWARF based tracing in place. The next set of
changes will populate the offsets from
pixie-io/opentelemetry-go-instrumentation#1 and
provide configuration to choose the desired implementation: solely
DWARF, solely static offsets or to use them in tandem.

Relevant Issues: N/A

Type of change: /kind feature

Test Plan: Existing Go bpf trace tests should pass

---------

Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
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.

2 participants