main icon indicating copy to clipboard operation
main copied to clipboard

sys.setprofile support

Open ironpythonbot opened this issue 10 years ago • 4 comments

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

ironpythonbot avatar Dec 09 '14 16:12 ironpythonbot

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.

ironpythonbot avatar Dec 09 '14 16:12 ironpythonbot

Not implemented yet with 2.7.6

simplicbe avatar Aug 01 '16 20:08 simplicbe

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

simplicbe avatar Aug 02 '16 07:08 simplicbe

@kunom FYI, please reference this issue when you do your setprofile work.

slide avatar Oct 19 '16 09:10 slide