]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Implement support for boot-time DTrace.
authormarkj <markj@FreeBSD.org>
Sun, 10 Apr 2016 01:25:48 +0000 (01:25 +0000)
committermarkj <markj@FreeBSD.org>
Sun, 10 Apr 2016 01:25:48 +0000 (01:25 +0000)
commit61ede4b2ecba0e7719312562eabb9f52e4d7ecfd
treefd9e73d2a0133421cd4a8af938b3c790bd50e959
parent7a70a2258262a6c228b3b459dfeb426e68e58e32
Implement support for boot-time DTrace.

This allows one to enable DTrace probes relatively early during boot,
during SI_SUB_DTRACE_ANON, before dtrace(1) can invoked. The desired
enabling is created using dtrace -A, which writes a /boot/dtrace.dof
file and uses nextboot(8) to ensure that DTrace kernel modules are loaded
and that the DOF file describing the enabling is loaded by loader(8)
during the subsequent boot. The trace output can then be fetched with
dtrace -a.

With this commit, boot-time DTrace is only functional on i386 and amd64: on
other architectures, the high-resolution timer frequency is initialized
during SI_SUB_CLOCKS and is thus not available when the anonymous
tracing state is initialized. On x86, the TSC is used and is thus available
earlier.

MFC after: 1 month
Relnotes: yes
cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c