[RFC/MERGE] 'bzr --lsprof' should print even with ^C

John Arbash Meinel john at arbash-meinel.com
Wed Nov 29 16:32:56 GMT 2006


When you run 'bzr --lsprof cmd' it generally prints out the profile
timings when the command has finished. However if you ^C the command
first, then you don't get anything.

I have a use case where I'm doing a big import, and I want to have it
just run for a little bit so I can tell what is taking so long, without
having to wait hours for it to finish.

The attached patch changes it so that if you supply --lsprof or
--lsprof-file, it will always write the profiled timings out, even if
there is an exception (like KeyboardInterrupt) raised.

This also means you can get profiles for commands that fail.

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lsprof.diff
Type: text/x-patch
Size: 897 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061129/990e138f/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061129/990e138f/attachment.pgp 


More information about the bazaar mailing list