-
Notifications
You must be signed in to change notification settings - Fork 107
Use perf ctlfd #320
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
Use perf ctlfd #320
Conversation
3011cd4
to
a66e21b
Compare
src/perf_tool_backend.ml
Outdated
if should_take_snapshot | ||
then ( | ||
match t.snapshot_behavior with | ||
| Never -> failwith "unreachable" |
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.
Suggestion: lift this block into a let snapshot () = ...
, then have the -> (true|false)
branches above be -> (() | snapshot ())
. That way we don't have to double-state the Never
case.
src/perf_tool_backend.ml
Outdated
else ( | ||
match when_to_snapshot with | ||
| Magic_trace_or_the_application_terminates -> | ||
if perf_supports_snapshot_on_exit then `at_exit `sigint else `at_exit `sigusr2 | ||
| Application_calls_a_function _ -> `function_call) | ||
if perf_supports_snapshot_on_exit then At_exit Sigint else At_exit Sigusr2 |
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 use the ctrlfd here too?
This logic is also used for triggering on ^C; it'd be nice to get away from the buggy signal handling where we can.
3a9ffee
to
aa31f43
Compare
Use perf controlfd to snapshot, cause snapshot-on-exit, and cleanly shutdown perf, replacing SIGUSR2, SIGINT, and SIGTERM respectively. Signed-off-by: Ilana Brooks <[email protected]>
aa31f43
to
a95431c
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.
LGTM, thanks!
Use perf controlfd to snapshot, cause snapshot-on-exit, and cleanly
shutdown perf, replacing SIGUSR2, SIGINT, and SIGTERM respectively.
Manual testing: