Part of bzrlib
| Function | profile | Run a function profile. |
| Class | BzrProfiler | Bzr utility wrapper around Profiler. |
| Class | Stats | Wrapper around the collected data. |
| Function | label | Undocumented |
| Class | _CallTreeFilter | Converter of a Stats object to input suitable for KCacheGrind. |
Exceptions are not caught: If you need stats even when exceptions are to be raised, pass in a closure that will catch the exceptions and transform them appropriately for your driver function.
Important caveat: only one profile can execute at a time. See BzrProfiler for details.
| Returns | The functions return value and a stats object. | |