-
Notifications
You must be signed in to change notification settings - Fork 247
Add profiling manager snippets for how-to-capture DAC docs #564
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 profiling manager snippets for how-to-capture DAC docs #564
Conversation
Here is the summary of changes. You are about to add 2 region tags.
This comment is generated by snippet-bot.
|
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.
Looks good, added some nits
// Computations you want to profile | ||
} | ||
|
||
void sampleRecordSystemTrace() { |
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.
should we just start the code snippet right before this function?
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, I also did the same for kotlin snippet. ptal and reopen if I missed anything
super.onCreate(savedInstanceState) | ||
sampleRecordSystemTrace() | ||
} | ||
|
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.
same q around just showing the function
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
SystemTraceRequestBuilder requestBuilder = new SystemTraceRequestBuilder(); | ||
requestBuilder.setCancellationSignal(stopSignal); | ||
requestBuilder.setTag("FOO"); | ||
requestBuilder.setDurationMs(60000); |
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.
can we pull this into duration const
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.
Is there a reason to want to pull this into a const, if we could, I prefer to leave as is because that way we make the snippet as hermatic as possible and we don't have to tweak the current wording of the snippet explanation in the DAC docs.
requestBuilder.setCancellationSignal(stopSignal) | ||
requestBuilder.setTag("FOO") // Caller supplied tag for identification | ||
requestBuilder.setDurationMs(60000) | ||
requestBuilder.setBufferFillPolicy(BufferFillPolicy.RING_BUFFER) |
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.
can we share what the other options are in a comment?
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.
The constructor methods are subject to change, we did not mean to be exhaustive here but provide an example. I think there's only one more method not shown here which is the setBufferSizeKb, I added it instead to the sample itself, I think its a bit odd to add it as a comment, so instead I integrated it directly
It looks like the bringing patches from forked repos doesn't work, so I will go ahead and post it directly into the main repository, the new PR is #568 . Closing this one as the review will finish in the new one. |
Adding some snippets required for the upcoming Profiling Manager sections for DAC documents