-
-
Notifications
You must be signed in to change notification settings - Fork 418
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 ability to trace runtime events in chromium json format #4649
Conversation
Runtime tracing is helpful in understanding how the runtime works and for debugging issues with the runtime. The implementation hopefully is flexible and extensible in order to be able to add more events for tracing as needed. The tracing can either write to file in the background or work in a "flight recorder" mode where events are stored into in memory circular buffers and written to stderr in case of abnormal program behavior (SIGILL, SIGSEGV, SIGBUS, etc). Chromium json format is documented at: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview?tab=t.0 and trace files can be viewed with the perfetto trace viewer: https://perfetto.dev/ inspired by golang's tracing and verona's flight recorder.
Hi @dipinhora, The changelog - added label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do. Release notes are added by creating a uniquely named file in the The basic format of the release notes (using markdown) should be:
Thanks. |
A think a section on the website's "use" section would be appropriate for this. I'd like to see that added "as part of" this work. |
src/libponyrt/sched/cpu.c
Outdated
@@ -227,10 +227,11 @@ uint32_t ponyint_cpu_count() | |||
} | |||
|
|||
uint32_t ponyint_cpu_assign(uint32_t count, scheduler_t* scheduler, | |||
bool pin, bool pinasio, bool pinpat) | |||
bool pin, bool pinasio, bool pinpat, uint32_t* tracing_cpu, bool pin_tracing_thread) |
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.
thoughts on reversing the boolean and the u32 here?
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.
other than this small thing, i think this 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.
no thoughts.. want them switched?
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.
weird.. i didn't see:
other than this small thing, i think this looks good.
previously when i added my comment..
will push a change with the order switched as requested soonish..
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
We discussed on today's sync call. Looks good to me, pending the above comment from Sean about parameter order. |
@dipinhora would you be up for adding documentation to the use section of the website after this is merged? |
i can take a stab at it.. do you envision the documentation being within https://www.ponylang.io/use/debugging/ or directly in https://www.ponylang.io/use/? |
I think under debugging. |
Runtime tracing is helpful in understanding how the runtime works and for debugging issues with the runtime.
The implementation hopefully is flexible and extensible in order to be able to add more events for tracing as needed.
The tracing can either write to file in the background or work in a "flight recorder" mode where events are stored into in memory circular buffers and written to stderr in case of abnormal program behavior (SIGILL, SIGSEGV, SIGBUS, etc).
Chromium json format is documented at:
https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview?tab=t.0
and trace files can be viewed with the perfetto trace viewer:
https://perfetto.dev/
inspired by golang's tracing and verona's flight recorder.