IronLanguages / main

Work for this repo has moved to https://github.com/IronLanguages/ironpython2
1.16k stars 347 forks source link

sys.setprofile support #264

Open ironpythonbot opened 9 years ago

ironpythonbot commented 9 years ago

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 commented 9 years ago

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.

simplicbe commented 8 years ago

Not implemented yet with 2.7.6

simplicbe commented 8 years ago

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
slide commented 8 years ago

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