Skip to content

thread context 4/n: interpreter skeleton - #1845

Open
nsavoire wants to merge 2 commits into
open-telemetry:mainfrom
DataDog:nsavoire/threadctx-skeleton
Open

thread context 4/n: interpreter skeleton#1845
nsavoire wants to merge 2 commits into
open-telemetry:mainfrom
DataDog:nsavoire/threadctx-skeleton

Conversation

@nsavoire

@nsavoire nsavoire commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Part of the PR #1229 split.
Adds thread context interpreter skeleton, eBPF map, config wiring, and the eBPF skeleton.

What's here

  • libpf.ThreadContext interpreter type ID.
  • A threadcontext package whose loader/Attach/Detach are stubs: loader always returns nil, nil, so no interpreter Data is ever created and Attach/Detach never run.
  • ThreadContextProcInfo over TLSVarInfo, the thread_context_procs eBPF map, and a maybe_add_thread_context_info stub wired into unwind_stop that does one bpf_map_lookup_elem and nothing else.
  • Four eBPF metric IDs the real read logic will use once it lands, pre-declared but unwired.
  • Enabled by default: there's currently no mechanism to mark one interpreter disabled by default , so this follows the
    existing default-on pattern instead.

Where this sits in the stack

Locates a thread-local variable at unwind time: TP-relative when module_id is
0, else an offset within that module's TLS block, completed once libc
introspection supplies the DTV layout. resolved is explicit because a zeroed
TLSVarInfo is otherwise a valid static descriptor.

Fields are private to ensure callers go through the constructors: generate.sh
lowercases them after godefs, which exports every field name.
Type ID, config wiring, and eBPF declarations (map, proc info
struct, stub unwind_stop hook) for the thread context interpreter,
mirroring luajit's boilerplate. Enabled by default; -tracers
thread_context warns it's a stub.
@nsavoire nsavoire changed the title thread context 4/9: interpreter skeleton thread context 4/n: interpreter skeleton Sep 9, 2026
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 10, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-09-11 09:38 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@nsavoire
nsavoire marked this pull request as ready for review September 11, 2026 09:33
@nsavoire
nsavoire requested review from a team as code owners September 11, 2026 09:33
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-11T09:37:41.123395Z 45dfaa7 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

1 participant