aboutsummaryrefslogtreecommitdiff
path: root/sys/modules/dtrace/kinst
Commit message (Collapse)AuthorAgeFilesLines
* kinst: accommodate other architectures in MakefileChristos Margiolis2023-07-041-4/+11
| | | | | | | Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40871
* sys: Retire OPENZFS_CWARNFLAGS now that it is empty.John Baldwin2023-03-221-1/+0
| | | | | Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D39217
* kinst: Initial revisionChristos Margiolis2022-10-111-0/+17
This is a new DTrace provider which allows arbitrary kernel instructions to be traced. Currently it is implemented only for amd64. kinst probes are created on demand by libdtrace, and there is a probe for each kernel instruction. Probes are named kinst:<module>:<function>:<offset>, where "offset" is the offset of the target instruction relative to the beginning of the function. Omitting "offset" causes all instructions in the function to be traced. kinst works similarly to FBT in that it places a breakpoint on the target instruction and hooks into the kernel breakpoint handler. Because kinst has to be able to trace arbitrary instructions, it does not emulate most of them in software but rather causes the traced thread to execute a copy of the instruction before returning to the original code. The provider is quite low-level and as-is will be useful mostly only to kernel developers. However, it provides a great deal of visibility into kernel code execution and could be used as a building block for higher-level tooling which can in some sense translate between C sources and generated machine code. In particular, the "regs" variable recently added to D allows the CPU's register file to be accessed from kinst probes. kinst is experimental and should not be used on production systems for now. In collaboration with: markj Sponsored by: Google, Inc. (GSoC 2022) MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D36851