Page MenuHomePhabricator

traceprof: report profile data even on error
ClosedPublic

Authored by simpkins on Aug 14 2017, 2:57 PM.

Details

Reviewers
quark
Group Reviewers
Restricted Project
Commits
rFBHGX9aca0dbdbdfc: traceprof: report profile data even on error
Summary

Update the traceprof contextmanager to always print the profile information,
even when exiting due to an exception.

In particular, this fixes the behavior so that we report profiling information
even if a slow command is interrupted with Ctrl-C. This also matches the
behavior of the upstream statprof profiler.

Test Plan

Confirmed that a profile was printed when interrupting a long-running
hg log -f command in a large repository.

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

simpkins created this revision.Aug 14 2017, 2:57 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptAug 14 2017, 2:57 PM
quark accepted this revision.Aug 14 2017, 4:24 PM
This revision is now accepted and ready to land.Aug 14 2017, 4:24 PM
This revision was automatically updated to reflect the committed changes.