Skip to content

[off-CPU stack 2/3] Add dynamic ProbeContext runtime foundation - #74

Closed
dalehamel wants to merge 1 commit into
dale/offcpu-omnibus-upstream-syncfrom
dale/offcpu-omnibus-probe-api
Closed

dalehamel wants to merge 1 commit into
dale/offcpu-omnibus-upstream-syncfrom
dale/offcpu-omnibus-probe-api

Conversation

@dalehamel

@dalehamel dalehamel commented Jul 24, 2026 •

Copy link
Copy Markdown
Member

Stack

  1. #73 → #50
  2. This PR — minimal Probe runtime foundation
  3. #75 — duration-filtered off-CPU probe + task-state labels

What

Port the generic Probe / ProbeContext loading API onto the upstream-synced LuaJIT omnibus base, plus only the reusable runtime capabilities explicitly required by off_cpu_time:

  • dynamic origin registration before attachment;
  • isolated .rodata / .rodata.var maps per probe instance;
  • removal of probe-private maps/programs/variables from the main collection via the <configured name>_* convention;
  • shared latency config and owned-resource lifecycle helpers;
  • typed dynamic metrics subscriptions with aggregation, panic isolation, and explicit final counter flushing;
  • label-aware sample identity so equal stacks with different per-sample labels do not merge.

It includes the generic demo probe from Shopify #58, but intentionally excludes every Hack Days I/O, async, process-observer, userspace-target, lock-wait, heap, and off-CPU implementation.

Why these additions to #58

The original #58 API was subsequently hardened by the synchronous probes and process-aware probes. off_cpu_time explicitly depends on isolated RODATA, private-resource unloading, probeutil, metric registration, and label-aware sample keys; extracting these generic pieces avoids depending on #53/#63/#65 wholesale.

Omnibus adaptation

PR #50 had one LuaJIT ProgLoaderHelper literal using the old private field names. This layer ports it to the exported API (ProgID, Name, Enable) without changing behavior.

Validation

  • go build, go test, and go vet across probes, tracer, reporter, traceutil, and controller.
  • New Probe API lifecycle/metrics tests use existing counter/gauge IDs and have no userspace-target dependency.
  • Generic and probeutil tests green.

Port the generic Probe/ProbeContext API onto the upstream-synced LuaJIT
omnibus base. Add isolated per-probe RODATA, private resource removal,
shared latency config/map lifecycle helpers, dynamic metrics collector
registration, and label-aware sample identity. This is the minimal
runtime required by off_cpu_time; it intentionally excludes all I/O,
userspace-target, lock-wait, and process-observer probes.

Assisted-By: devx/2d48a84f-4aab-48eb-9009-5dd68fa593f3
@dalehamel
dalehamel force-pushed the dale/offcpu-omnibus-probe-api branch from 3a279c8 to 30b61c7 Compare July 24, 2026 20:33
@github-actions

Copy link
Copy Markdown

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added the Stale label Aug 22, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions Bot closed this Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant