Skip to content

Refactor symbol caching#635

Merged
fabled merged 10 commits intoopen-telemetry:mainfrom
fabled:tt-refactor-symbolization-cache
Jul 30, 2025
Merged

Refactor symbol caching#635
fabled merged 10 commits intoopen-telemetry:mainfrom
fabled:tt-refactor-symbolization-cache

Conversation

@fabled
Copy link
Copy Markdown
Contributor

@fabled fabled commented Jul 20, 2025

This creates libpf.Frame with the libpf.Trace frame data and the relevant metadata:

  • to not use excessive memory the libpf.Frame is interned using the unique package in most places
  • refactors the data structures and APIs so that proper symbolization data is always available for reporter module
  • remove the now unneeded LRU from reporter
  • removes the internal dependency of synthesized FileID/LineNo (if some reporter needs this always, they should synthesize them when needed)
  • fixes Restructure of symbols information caching #384

Follow up steps:

fabled added 3 commits July 20, 2025 19:38
This joins the Frame metadata to libpf.Frame:
- removes the internal dependency of synthesized FileID/LineNo
  (if some reporter needs to synthesize these still, they need
   to now do it them selves based on the trace/symbol data)
- removes LRU from the base reporter and allows the profiler
  core to always provide symbol information

To not use excessive memory the libpf.Frame is interned using
the unique package.

TODO:
- add caching for ebpf frame -> libpf.Frame and check if
  the tracehandler trace LRU can be removed
@fabled fabled marked this pull request as ready for review July 20, 2025 17:20
@fabled fabled requested review from a team as code owners July 20, 2025 17:20
fabled added 3 commits July 21, 2025 08:34
I removed this as I was planning to include the tracehandler
cache changes making it redundant, but as it is wort a separate PR
lets add this back for now.
Copy link
Copy Markdown
Member

@christos68k christos68k left a comment

Choose a reason for hiding this comment

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

Did a pass, looks good to me. I will do a final pass tomorrow.

Comment thread libpf/trace.go Outdated
Comment thread libpf/trace.go Outdated
Comment thread libpf/trace.go Outdated
Copy link
Copy Markdown
Member

@florianl florianl left a comment

Choose a reason for hiding this comment

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

I like the simplicity and reduction of API functions this work introduces. Thanks for working on this!

Comment thread interpreter/go/go.go
SourceLine: libpf.SourceLineno(lineNo),
frames.Append(&libpf.Frame{
Type: libpf.GoFrame,
//TODO: File: convert the frame.File (host.FileID) to libpf.FileID here
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As Go frames are treated like any other interpreted frame, I think we can skip File here. WDYT?

Suggested change
//TODO: File: convert the frame.File (host.FileID) to libpf.FileID here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it makes sense to provide it here as a follow up as it provides additional information and this is a file backed mapping.

Comment thread interpreter/types.go Outdated
Comment thread processmanager/manager.go
Comment thread processmanager/manager.go
Comment thread interpreter/types.go Outdated
Comment thread interpreter/types.go Outdated
@fabled fabled merged commit 17e31d8 into open-telemetry:main Jul 30, 2025
27 checks passed
nsavoire added a commit to DataDog/dd-otel-host-profiler that referenced this pull request Aug 4, 2025
nsavoire added a commit to DataDog/dd-otel-host-profiler that referenced this pull request Aug 7, 2025
nsavoire added a commit to DataDog/dd-otel-host-profiler that referenced this pull request Aug 8, 2025
florianl added a commit to florianl/opentelemetry-collector-contrib that referenced this pull request Aug 14, 2025
Update go.opentelemetry.io/ebpf-profiler to use a tagged version instead of
a commit.

As open-telemetry/opentelemetry-ebpf-profiler#635
removed libpf.FrameID, also move its functionality to this package as it is
essential for its functionality.

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
nsavoire added a commit to DataDog/dd-otel-host-profiler that referenced this pull request Aug 18, 2025
nsavoire added a commit to DataDog/dd-otel-host-profiler that referenced this pull request Aug 18, 2025
* backport: replace per-fileID LRU with a global LRU

open-telemetry/opentelemetry-ebpf-profiler#529

* backport: interpreters, reporter: intern symbolization strings

open-telemetry/opentelemetry-ebpf-profiler#563

* Disable Go interpreter because we are doing Go symbolization remotely.

* Update opentelemetry-ebpf-profiler with latest changes from upstream.

* Update 3rdparty licenses.

* backport: Refactor symbol caching

open-telemetry/opentelemetry-ebpf-profiler#635

* Use containerID provided by eBPF profiler when available and split by service is enabled.

* Do not collect Go labels by default
andrzej-stencel pushed a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request Aug 22, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Update go.opentelemetry.io/ebpf-profiler to use a tagged version instead
of a commit.

As
open-telemetry/opentelemetry-ebpf-profiler#635
removed libpf.FrameID, also move its functionality to this package as it
is essential for its functionality.



<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
gnurizen pushed a commit to parca-dev/opentelemetry-ebpf-profiler that referenced this pull request Sep 16, 2025
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.

Restructure of symbols information caching

3 participants