Requested by: markj
Obtained from: Mark Johnston, DTrace, FreeBSD Journal, May 2014
Obtained from: https://wiki.freebsd.org/DTrace/One-Liners
MFC after: 2 weeks
Relnotes: yes
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 65401 Build 62284: arc lint + arc unit
Event Timeline
share/man/man4/dtrace_fbt.4 | ||
---|---|---|
15 | name seems to be the right replacement for instruction. Good catch! | |
15 |
I cannot easily split that into two lines without adding an extra space after fbt which would be incorrect. I'll leave it as is. apropos will see other instances of .Nm fbt in this file just fine, so not a big problem. | |
20 | So, I took the _non-leaf_ phrase from John Birrell's email introducing DTrace to FreeBSD: https://lists.freebsd.org/pipermail/freebsd-current/2006-May/063299.html
I understand that John meant the leaf functions as described by Mark in his comment. I'm rewritting this part and moving it to a *Frame Pointer* subsection in IMPLEMENTATION NOTES. | |
24 | https://reviews.freebsd.org/D38825 looks interesting. I'll reference dtrace_kinst in the Frame Pointer subsection. I've reworded this part and referred to the Frame Pointer subsection for more details. | |
25 | Good point. That's a todo. | |
30 | We've got a lot of those in other manual pages where we share intuitions with our users on how to approach a given piece of software. I'd be happy to see a note like this because it sets my expectations right. I'll remove it though as it is perhaps too imprecise and does not really help. Thanks! | |
31 | Great! I'll put that into the Frame Pointer subsection. | |
39 | Historically, fbt's documentation highlighted the instability of the fbt probes. This paragraph follows this tradition and stresses that scripts will likely needed to be modified to run on a newer version of FreeBSD or a different OS. @christos , would you like to see the wording to be less dramatic? | |
49 | I'll think about it and take care of those examples in the next iterations of this patch. TODO | |
57 | Done. I noted that SDTs are a potential solution to a complex fbt script. I'm not sure if that's what you meant. | |
77 | I wanted to keep the dtrace: ... message here. This is on purpose. | |
140 | TODO |
share/man/man4/dtrace_fbt.4 | ||
---|---|---|
65 | Yeah, I was thinking that maybe apropos(1) likes the use of marcos in code examples and so style.mdoc should be updated to reflect that. Perhaps that's a fun project for another time. If you don't like the current style here, I'll just use the one recommended by style.mdoc(7). |
share/man/man4/dtrace_fbt.4 | ||
---|---|---|
15 | It should come up for "fbt" because the document name is "dtrace_fbt". The issue is that it will come up for "name", "function", and "module". | |
65 | Well sir it's not that I don't like it, it's that the maintainers of the language say it's wrong and it should not be done in the link I provided above on the mdoc/mandoc projects homepage. | |
127 | This one also doesn't need to have so much whitespace, it breaks legibility on narrower consoles. |
share/man/man4/dtrace_fbt.4 | ||
---|---|---|
25 | Hmm, any idea why -lv does not mention malloc(9)'s third argument? console # dtrace -n 'fbt::malloc:return' -lv ID PROVIDER MODULE FUNCTION NAME 31954 fbt kernel malloc return Probe Description Attributes Identifier Names: Private Data Semantics: Private Dependency Class: Unknown Argument Attributes Identifier Names: Private Data Semantics: Private Dependency Class: ISA Argument Types args[0]: int args[1]: void * |
share/man/man4/dtrace_fbt.4 | ||
---|---|---|
65 | XXX: I should probably advertise typed args first instead of the untyped argX variables.. |
Presumably this page should be xref'ed from dtrace.1, like the other providers?
share/man/man4/dtrace_fbt.4 | ||
---|---|---|
20 | "Almost every" is misleading. It lets one trace functions which are not inlined, but many functions are inlined. One way to say this would be, "... the entry and return of almost every function corresponding to an ELF symbol in the kernel and loaded kernel modules." | |
21 | ||
25 | In that command you're printing the arguments for the return probe. dtrace -n 'fbt::malloc:entry' -lv should show you the function arguments. | |
36 | Is arg0 supposed to be the D syntax? If so, it should probably be args[0] instead. arg0 is a raw 64-bit integer, while args[0] has the same type as the probe argument. For instance, fbt::malloc:entry {print(*arg1);} won't work, but fbt::malloc:entry {print(*args[1]);} will. | |
39 | ||
43 | ||
45 | ||
58 | ||
63 | If you use args[N] syntax, then the arguments will be typed according to the function's signature, as I noted above. |
share/man/man4/dtrace_fbt.4 | ||
---|---|---|
15 | Okay I've been playing with this: the name of the command is dtrace, the command modifier fbt tells dtrace to use function boundary tracing, : is the delimiter, and the three subsequent arguments are arguments. Right? This renders as: |
Eh, I am the most junior and least authorative, but IMHO please don't do that, commits should be atomic unless we made mistakes (like I do constantly :P), or it's too big to review and has clean chunking points.
Hmm, I usually prefer to commit the new manual pages or programs in one commit and then connect them to other places in the tree in another commit. I'll ask my mentors what they think about that approach.
share/man/man4/dtrace_fbt.4 | ||
---|---|---|
15 | Nice try! :D But you'd need -n for that. So, it'd need to be something like: dtrace -n "fbt:module:function:name { ... }" at the very least. Also, DTrace scripts can live in files as well, so it does not feel right to suggest the intended use of FBT is only for DTrace one-liner on the command line. The synopsis section always feels a bit hacky if it describes something that's not a shell command, a C function, or a kernel module. Also, remember that Dq might render as stylized quotes. Qq would be better here. I still believe that the current synopsis is the most optimal of all we came up so far. |
share/man/man4/dtrace_fbt.4 | ||
---|---|---|
49 | The part about FBT's stability has been moved to CAVEATS. It also added a small example. |
share/man/man4/dtrace_fbt.4 | ||
---|---|---|
60 | We could, but a table is easier to navigate. Also, we explain return probe args in a table as well, so it's consistent. I agree that it is a bit verbose, but I'd like to avoid saying just that "functions arguments are args[0], ...". | |
77 | I kind of like the idea that the paragraph is easy to read and gives some more details and the table provides a quick reference. I'm not sure how I'd golf that into less text without sacrificing readability. |
We can of course fix them later, but I did send a mail asking about how we write the synopsis. These SYNOPSIS(es?) do introduce bugs in apropos results.
I really appreciate these pages. I think dtrace is a killer feature and BSD style manpages are a killer feature and marrying them is very good.