FreeBSD has a fair number of tracing facilities. The new tracing(7)
manual page aims to provide a starting point for users to learn about
what is available.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
share/man/man7/tracing.7 | ||
---|---|---|
47 | Despite the similar names, ktr(4) and ktrace(1) are completely unrelated. KTR just a facility for logging strings in the kernel. It's very primitive, there's just a global ring buffer in the kernel that can be dumped with ktrdump(8) or via ddb. It's not compiled into the kernel by default, so not very convenient to use. It's still handy for some niche purposes, but it's really aimed at kernel developers. |
share/man/man7/tracing.7 | ||
---|---|---|
21 | If you combine the whole line it gets to 79 characters. |
share/man/man7/tracing.7 | ||
---|---|---|
33 | I considered that, but decided against that for now because dtrace(1) mentions those now and I'd like to avoid bit rot in this manual page by having an outdated list in the future. |
- Add dwatch
- Add subsections
- Start paragraphs with an Xr
- Fix descriptions of KTR and ktrace
- Typos?
share/man/man7/tracing.7 | ||
---|---|---|
19 | I might add a hedge, like "and potentially on production systems"--some of these features have high overhead. | |
35 | ||
43 | It's a bit odd to describe truss as an alternative to dtrace when dtrace is in the "kernel tracing" section while here we're in "userland tracing". I would just explain directly what it does: it traces system calls and pretty-prints arguments. It uses sysdecode(3) for the latter purpose, which would be nice to reference here. ktrace also belongs here, it's mostly for debugging user programs. Like truss, it mainly traces system calls, but 1) it doesn't use ptrace(2), it asynchronously logs entries to a file (typically ktrace.out), configured with ktrace(2) 2) it can log other types of events, e.g., page faults, name lookups, etc. (see the documentation for -t in the ktrace(1) docs). | |
46 | I would argue that "one of the classic interfaces" is a bit unclear here: what are the other classic interfaces? What does "classic" mean here? I think this can be phrased more simply. | |
49 | I think this is supposed to be, "The domain of kernel tracing does not belong solely to dtrace"? I'm not sure this sentence is very useful. | |
53 | Let's maybe be more specific? "It lets kernel programmers log events to a global ring buffer, which can later be dumped using ktrdump(8)." |
- Drop unnecessary mentions of DTrace from Kernel Tracing
- Move ktrace out of Kernel Tracing
- Do a better job of explaining what truss is and how it works
share/man/man7/tracing.7 | ||
---|---|---|
43 | Thanks a lot, Mark. It clarifies a lot. I've incorporated your notes into the manual. | |
49 | Good point. I'll just drop that. I wanted to note here that DTrace can be used for kernel tracing but considering that this manual page is just a short intro to available tracers, there is no need to create those little notes for users. If someone ends up reading tracing(7), they will surely not miss the DTrace section that says DTrace is useful for both kernel and userland tracing. |