Largely untested, as we can't really do anything with user probes
without an implementation of fasttrap. However, this is enough to
generate an embedded dtrace program with dtrace -G and link the
generated ELF file.
Details
- Reviewers
markj jrtc27 gnn - Group Reviewers
riscv - Commits
- rGf711d5c3d066: libdtrace: add riscv support
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c | ||
---|---|---|
1004–1007 | The implementation is copied from arm64. I really have no idea if this is true about is-enabled probes, as this file really doesn't give much of a clue as to what that means. | |
1360 | This comment is the best indication of what is going on, and what dt_modtext() is for. |
cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c | ||
---|---|---|
1004–1007 | So with USDT you define one or more providers, each with a set of probes: provider foo { probe bar(int arg1, char *arg); probe baz(); }; dtrace -h takes that and spits out a C header which defines FOO_BAR() and FOO_BAZ() macros, "calls" to which turn into USDT probes. For each probe you also get an _ENABLED macro, e.g., FOO_BAR_ENABLED(). This lets you test whether the corresponding probe is currently enabled. I'm not sure when that's useful, maybe one uses the _ENABLED check to decide whether to take a slow path which contains probes and loads extra data to pass to those probes. Both probes and is-enabled checks expand to function calls. I haven't looked exactly at how these are handled on amd64, but without some ability to test you might just leave an XXX comment to revisit the matter. There are some USDT regression tests which exercise this functionality. |