Skip to content

USDT Extraction#247

Merged
gnurizen merged 2 commits intomainfrom
usdt-extract
Apr 14, 2026
Merged

USDT Extraction#247
gnurizen merged 2 commits intomainfrom
usdt-extract

Conversation

@gnurizen
Copy link
Copy Markdown
Collaborator

@gnurizen gnurizen commented Apr 6, 2026

Refactor now that most of the usdt code has been moved to a separate repo.

@gnurizen gnurizen force-pushed the usdt-extract branch 6 times, most recently from db5b6a1 to b0ebf5b Compare April 8, 2026 08:35
@gnurizen gnurizen marked this pull request as ready for review April 8, 2026 16:05
@gnurizen gnurizen requested a review from umanwizard April 8, 2026 17:06
- pfelf.USDTProbe is now a type alias for usdt.Probe
- pfelf.ParseUSDTProbes() delegates to usdt.ParseProbes() via adapter
- pfelf.ParseUSDTArguments/USDTSpecToBytes delegate to usdt package
- pfelfELFReader adapter implements usdt.ELFReader interface
- All consumers (interpreter, processmanager, gpu, coredump) continue
  working transparently via the type alias
@gnurizen gnurizen force-pushed the usdt-extract branch 7 times, most recently from f4c0dd3 to 3abfe7d Compare April 13, 2026 22:36
The arm64 libparcagpucupti.so (Triton Proton) dropped libcupti.so from
DT_NEEDED and now loads it via runtime dlopen/dlsym. The old empty stub
had no CUPTI symbols, so dlsym("cuptiGetVersion") threw "Failed to load
libcupti.so".

Build mock libcupti.so and libcuda.so from the parcagpu repo's test
sources (test/mock_cupti.c, test/mock_cuda.c) which provide all CUPTI/
CUDA API functions that libparcagpucupti.so resolves at runtime. Minimal
type-definition headers are included so the mocks compile without the
CUDA SDK.

Set TRITON_CUPTI_LIB_PATH in the QEMU init script so the library finds
the mocks via the explicit path it checks first.

Read the registered CUPTI callbacks from the mock library's globals via
dlsym after InitializeInjection, since the mock has its own copy of
these symbols separate from the test binary.

InitializeInjection in libparcagpucupti.so is a singleton — it only
registers CUPTI callbacks on the first call. When TestCUDAEndToEndSingleShot
cleaned up and TestCUDAEndToEndMultiProbe called init_parcagpu again, the
singleton returned 1 without re-registering, leaving callback pointers NULL.

Load the library once in TestMain and clean up once at exit.
@gnurizen gnurizen merged commit b5e3d6e into main Apr 14, 2026
53 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.

2 participants