Skip to content

Add process-aware userspace probe targets - #63

Merged
dalehamel merged 2 commits into
dale/hackdays-io-network-basefrom
dale/userspace-probe-targets
Jul 23, 2026
Merged

dalehamel merged 2 commits into
dale/hackdays-io-network-basefrom
dale/userspace-probe-targets

Conversation

@dalehamel

Copy link
Copy Markdown
Member

Summary

Adds a generic, runtime-configured foundation for PID-scoped userspace probes.

  • observes process/mapping lifecycle asynchronously without blocking PID-event processing
  • resolves runtime-supplied ELF symbols or build-ID-scoped file offsets
  • opens mapped objects through namespace-correct, inode/device-verified paths
  • attaches paired PID-scoped uprobes/uretprobes with bounded link ownership
  • reconciles links across late mappings, unmaps, exec, PID reuse, exit, and shutdown
  • exports attachment/reconciliation counters and active-process/link gauges

This change intentionally contains no Yugabyte-, lock-, or pthread-specific symbol knowledge. Lock-wait and lock-held state machines will consume this substrate in follow-up PRs.

Lifecycle and compatibility

  • sched_process_exec invalidates the exact per-PID mapping marker before userspace synchronization.
  • Process identity combines executable identity, start time, address-space data, and an explicit exec generation, including same-image exec.
  • Observer callbacks are asynchronous, PID-coalesced, panic-isolated, and bounded by observed PIDs.
  • Return probes attach before entry probes; cleanup closes entry links before return links.
  • Partial target attachment retries only unresolved offsets.
  • Descriptor validation bounds links, points, and build-ID input before ELF or kernel work.
  • Uses ordinary PID-scoped links; no attach cookies or uprobe_multi requirement (Linux 5.10 compatible).
  • Mapping refresh remains event-driven; this does not add periodic process scans or a dynamic-loader hook.

Stack

Validation

  • make generate
  • make -C support/ebpf lint
  • targeted unit tests for metrics, process access, process manager, tracer, and userspace targets
  • race tests for process manager, tracer, and userspace targets
  • go vet on changed packages
  • repository golangci-lint on changed package trees: 0 issues
  • privileged real-kernel PID-scoped uprobe/uretprobe integration test (5 repeated runs during development)
  • rebuilt amd64 and arm64 embedded eBPF objects
  • git diff --check

Full go test ./... is not runnable in the local container because unrelated suites require nested/rootless Docker and generated test fixtures. The directly changed packages and their race suites pass.

Assisted-By: devx/31bc8216-5597-49cf-9ae0-97361f1b5960
@dalehamel
dalehamel force-pushed the dale/userspace-probe-targets branch from cc90f00 to aee8d9b Compare July 22, 2026 13:46
Base automatically changed from dale/io-network-probes-sync to dale/hackdays-io-network-base July 22, 2026 19:06
@dalehamel
dalehamel marked this pull request as ready for review July 23, 2026 01:34
@dalehamel
dalehamel merged commit fc5637c into dale/hackdays-io-network-base Jul 23, 2026
39 checks passed
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