HomePhabricator

traceprof: report profile data even on error

Authored by simpkins.

Description

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.

Reviewers: quark, #fbhgext

Reviewed By: quark, #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D386

Details

Committed
simpkinsAug 14 2017, 9:12 PM
Reviewer
Restricted Project
Differential Revision
D386: traceprof: report profile data even on error
Parents
rFBHGX418171f302d0: undo: improved --branch handling
Branches
Unknown
Tags
Unknown