Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: USDT tracing #474

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

feat: USDT tracing #474

wants to merge 6 commits into from

Conversation

aapoalas
Copy link
Collaborator

@aapoalas aapoalas commented Dec 1, 2024

USDT tracing is a way for programs to statically define "points of interest" for tracing tools like DTrace, perf, bpftrace, SystemTap, and others to hook into. I've been diving into this world lately with the intention of getting better performance feedback from Nova. I now have a working Linux-based USDT system built forked from Oxide Computer's usdt crate, and this PR is then a showcase of how that can then be utilised.

Examples

Tracing constructor calls:

Attaching 4 probes...
usdt:/home/aapoalas/build/nova/target/debug/nova_cli:nova:start_builtin_constructor: ArrayBuffer (73417456)
usdt:/home/aapoalas/build/nova/target/debug/nova_cli:nova:stop_builtin_constructor: ArrayBuffer (73426856)
usdt:/home/aapoalas/build/nova/target/debug/nova_cli:nova:start_builtin_constructor: DataView (73461236)
usdt:/home/aapoalas/build/nova/target/debug/nova_cli:nova:stop_builtin_constructor: DataView (73467616)
usdt:/home/aapoalas/build/nova/target/debug/nova_cli:nova:start_builtin_constructor: Uint8Array (73510006)
usdt:/home/aapoalas/build/nova/target/debug/nova_cli:nova:stop_builtin_constructor: Uint8Array (73522326)
usdt:/home/aapoalas/build/nova/target/debug/nova_cli:nova:start_ecmascript_constructor: Test262Error (78858905)
usdt:/home/aapoalas/build/nova/target/debug/nova_cli:nova:stop_ecmascript_constructor: Test262Error (78932415)

Linux perf does not understand the probes laid down by the usdt crate.
This mostly makes sense, as usdt is made by oxidecomputer folks and they
mainly target illumos and linux distributions with DTrace available.

My assumption is that we end up with the no-action register_probes() call
and hence we get no probe information. Not sure why that is but so it is.
@nair-sreerag
Copy link

Hi @aapoalas,
What is the reason behind changing the method of provider and probe declaration from an external file to using the #[usdt::provider] attribute?

@aapoalas
Copy link
Collaborator Author

aapoalas commented Dec 3, 2024

Hi @aapoalas, What is the reason behind changing the method of provider and probe declaration from an external file to using the #[usdt::provider] attribute?

Colocation of definition and code: With the attribute macro I can define the probe where it is used, only making changes to a single file and in a single language. If I used the .d D language file then I'd need to change two files and use two languages.

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