-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Add a manual / language reference / man page #1711
Conversation
I'd prefer if we only had source files. Less confusion and less stuff to forget to update. Also it looks like most distros have it already: https://pkgs.org/search/?q=asciidoctor
One seems fine to me
I'd really rather not write raw man pages. That sounds too painful. adoc seems appealing b/c it can generate reasonable .htmls and man pages. |
1ca2291
to
7325e19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will review some more later
man/adoc/bpftrace.adoc
Outdated
|
||
Make this larger if you wish to read bigger strings with str(). | ||
|
||
Beware that the BPF stack is small (512 bytes), and that you pay the toll again inside printf() (whilst |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what "and that you pay the toll again inside printf() (whilst it ....)". Is this referring to the string constant or the scratch space needed for submitting an event to the perf event buffer?
If it's the latter, not sure we need to describe implementation details (as it might change later)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is copy/pasta from the refguide, ill just leave it out :)
Yes, the reference guide is intended to be brief. As a general rule, I don't like to see a wall of text anywhere: there should be at least one heading visible on the screen at all times. This forces all sections to be less than one screenful. I wouldn't delete things entirely from the reference guide, as it'll still be the number one place people do searches on. So things like BPFTRACE_STRLEN should still be mentioned, even if it's just a list of keywords and a reference. E.g., "For environment variables BPFTRACE_STRLEN, ..., ..., ..., see the xxx.doc". Then people can still search on it. I don't understand bpftrace.adoc: it says its a man page. I think that's the right place for man page things, but not "all technical details." Right now we have:
So if we have a bunch of technical details including code snippits or command outputs that doesn't fit into those locations, then we can create another file for it. I hope we can come up with a name that makes sense. I'm not sure what though. The "bpftrace Appendix?" The "bpftrace Encyclopedia"? It could also be a more of a community developed wiki, where people are free to dump stuff in there that might be useful for searching later on. Whereas we carefully review what goes into the official reference guide. |
Yes i want to link to the env section of the manpage
The manpage I wrote documents:
It doesn't say anything about the internals or about the tools we ship, we have separate docs for it.
Sounds good |
thanks @danobi |
7cba092
to
82f06a4
Compare
|
||
The second action block uses two probes, one for `open` and one for `openat`, and defines an action that prints the file being `open`ed as well as the `pid` and `comm` of the process that execute the syscall. | ||
See the <<Probe types>> section for details on the available probe types. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel like more words describing actions should go here, but i lack inspration
Took a while but I think im almost there. I still need to do the details of a few probe types but other than that I think its good enough for a first version. |
Added the int syntax from #1900 |
I fixed the section naming thing so linking is easier now. I uploaded a html version as well http://dump.madhax.nl/bpftrace.html#functions-reg , this is what it would look like if we put it on bpftrace.org |
Ready for review @danobi @viktormalik @brendangregg . There is always more to add but I think its good enough for a first man page
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a bunch of formatting/spelling suggestions. The content itself looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I think we need a cmake rule to generate man page using asciidoctor + install it
man/adoc/bpftrace.adoc
Outdated
|
||
== Supported architectures | ||
|
||
x86_64, arm64 and s390x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make these bullet points instead?
Addressed the comments.
If there are no objections im hoping to merge this as is. CI integration etc can be done in a follow up. Once this is in we can update it as part of PRs instead of having to sync this PR the whole time :) |
Yeah, let's get this in now so we can all commit changes to it. Looks fairly complete already |
The reference_guide was meant to be a short guide to quickly see how a feature works. It was never meant to be the place where all technical details are discussed but as there was no better place that is where it ended up. This introduces a new place for all the technical details. It is written in asciidoc as that, improves plain text readability (slighly personal) and it is easy exportable to a lot of other formats which makes it possible to use this for our man-page and website.
The reference_guide was meant to be a short guide to quickly see how a
feature works. It was never meant to be the place where all technical
details are discussed but as there was no better place that is where it
ended up.
This introduces a new place for all the technical details. It is
written in asciidoc as that, improves plain text readability (slighly
personal) and it is easy exportable to a lot of other formats which
makes it possible to use this for our man-page and website.
This is still work in progress but hoping to get some feedback on it.
Open questions:
bpftrace
andbpftrace-language
(i'd prefer one page for now)TODO:
Note that I don't expect this to be completely finished when the todo items are done. I'm hoping its good enough for a first version so we can expand later. We also have some behaviour that isn't clearly defined, I hope we can define them before we put it in the manpage.