main
main copied to clipboard
sys.setprofile support
I've found that CPy profile module doesn't work under IronPython because
sys.setprofile doesn't implemented.
So, Is it planned to add support of python-level profiling for IronPython?
Work Item Details
Original CodePlex Issue: Issue 3124 Status: Active Reason Closed: Unassigned Assigned to: Unassigned Reported on: Sep 11, 2006 at 4:42 PM Reported by: dinov Updated on: Feb 22, 2013 at 2:16 AM Updated by: tristanz Thanks: Alexander Shafranov
On 2006-09-12 05:01:37 UTC, unknown user commented:
We want to provide a good profiling story for IronPython but won't get to this until potentially 2.0.
Not implemented yet with 2.7.6
Ok, as far as i can see someone started implementing getprofile:
#if PROFILE_SUPPORT
// not enabled because we don't yet support tracing built-in functions. Doing so is a little
// difficult because it's hard to flip tracing on/off for them w/o a perf overhead in the
// non-profiling case.
public static void setprofile(CodeContext/*!*/ context, TracebackDelegate o) {
PythonContext pyContext = PythonContext.GetContext(context);
pyContext.EnsureDebugContext();
if (o == null) {
pyContext.UnregisterTracebackHandler();
} else {
pyContext.RegisterTracebackHandler();
}
// Register the trace func with the listener
pyContext.TracebackListener.SetProfile(o);
}
#endif
@kunom FYI, please reference this issue when you do your setprofile work.