Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add tracing tools and documentation #898
Add tracing tools and documentation #898
Changes from 3 commits
f522bf4
5835839
d8814ef
93c5b49
8fd9b9c
dc7eda4
0783ee9
3eaef2a
5289fc4
c5b368b
99d5155
221d1b2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
A general style problem: I find that you never uses newline characters within one paragraph. Markdown allows this.
But here the text spans over three lines. I think you intend to introduce one title and two paragraphs. However, Markdown will interpret consecutive non-blank lines as one paragraph (except for titles (
### blah blah blah
)). If you intend to put "The time unit is ns." in a single paragraph, you need to add an empty line before it.I also recommend formatting the text so that the line width is no more than 100 characters long (or 80 or 72 if you prefer). The
fmt
command line utility may come in handy. If you are a Vim user, you canset tw=100
, select one or more paragraphs and pressgq
to format them. In this way, this text file will still be easy to read using text editors.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.
Done
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.
If they are two paragraphs, there needs to be an empty line in between.
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.
Fixed.
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.
We only need to delete the temp file if we use exec. See the comment on
run.py
.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.
See above
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.
Python will automatically delete the
NamedTemporaryFile
when exiting the scope ofwith
. However,execvp
never returns. You can replace this withsubprocess.run
orsubprocess.Popen
.An alternative to using temp file is using pipes. I tried piping the script into
sudo bpftrace
and it works. For example, I am currently usingerb
(from Ruby) for templating, and my command line looks like this:In Python, the
subprocess.run
function (orpopen.communicate
) allows you to specify the stdin as a pipe, so you can directly pipe the Python stringprologue + content + epilogue
intosudo bpftrace
.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.
That's a deliberate choice. I will add comments to explain this.