( )⚙ D386 traceprof: report profile data even on error

This is an archive of the discontinued Mercurial Phabricator instance.

traceprof: report profile data even on error
ClosedPublic

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

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
Branch
default
Lint
Lint OK
Unit
Unit Tests OK

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.