Lines Matching refs:pObj

83 static _PyTime_t CallExternalTimer(ProfilerObject *pObj)  in CallExternalTimer()  argument
85 PyObject *o = _PyObject_CallNoArgs(pObj->externalTimer); in CallExternalTimer()
87 PyErr_WriteUnraisable(pObj->externalTimer); in CallExternalTimer()
93 if (pObj->externalTimerUnit > 0.0) { in CallExternalTimer()
106 PyErr_WriteUnraisable(pObj->externalTimer); in CallExternalTimer()
113 call_timer(ProfilerObject *pObj) in call_timer() argument
115 if (pObj->externalTimer != NULL) { in call_timer()
116 return CallExternalTimer(pObj); in call_timer()
197 newProfilerEntry(ProfilerObject *pObj, void *key, PyObject *userObj) in newProfilerEntry() argument
202 pObj->flags |= POF_NOMEMORY; in newProfilerEntry()
209 pObj->flags |= POF_NOMEMORY; in newProfilerEntry()
220 RotatingTree_Add(&pObj->profilerEntries, &self->header); in newProfilerEntry()
225 getEntry(ProfilerObject *pObj, void *key) in getEntry() argument
227 return (ProfilerEntry*) RotatingTree_Get(&pObj->profilerEntries, key); in getEntry()
231 getSubEntry(ProfilerObject *pObj, ProfilerEntry *caller, ProfilerEntry* entry) in getSubEntry() argument
238 newSubEntry(ProfilerObject *pObj, ProfilerEntry *caller, ProfilerEntry* entry) in newSubEntry() argument
243 pObj->flags |= POF_NOMEMORY; in newSubEntry()
272 static void clearEntries(ProfilerObject *pObj) in clearEntries() argument
274 RotatingTree_Enum(pObj->profilerEntries, freeEntry, NULL); in clearEntries()
275 pObj->profilerEntries = EMPTY_ROTATING_TREE; in clearEntries()
277 if (pObj->currentProfilerContext) { in clearEntries()
278 PyMem_Free(pObj->currentProfilerContext); in clearEntries()
279 pObj->currentProfilerContext = NULL; in clearEntries()
281 while (pObj->freelistProfilerContext) { in clearEntries()
282 ProfilerContext *c = pObj->freelistProfilerContext; in clearEntries()
283 pObj->freelistProfilerContext = c->previous; in clearEntries()
286 pObj->freelistProfilerContext = NULL; in clearEntries()
290 initContext(ProfilerObject *pObj, ProfilerContext *self, ProfilerEntry *entry) in initContext() argument
294 self->previous = pObj->currentProfilerContext; in initContext()
295 pObj->currentProfilerContext = self; in initContext()
297 if ((pObj->flags & POF_SUBCALLS) && self->previous) { in initContext()
300 ProfilerSubEntry *subentry = getSubEntry(pObj, caller, entry); in initContext()
302 subentry = newSubEntry(pObj, caller, entry); in initContext()
306 self->t0 = call_timer(pObj); in initContext()
310 Stop(ProfilerObject *pObj, ProfilerContext *self, ProfilerEntry *entry) in Stop() argument
312 _PyTime_t tt = call_timer(pObj) - self->t0; in Stop()
316 pObj->currentProfilerContext = self->previous; in Stop()
323 if ((pObj->flags & POF_SUBCALLS) && self->previous) { in Stop()
326 ProfilerSubEntry *subentry = getSubEntry(pObj, caller, entry); in Stop()
343 ProfilerObject *pObj = (ProfilerObject*)self; in ptrace_enter_call() local
356 profEntry = getEntry(pObj, key); in ptrace_enter_call()
358 profEntry = newProfilerEntry(pObj, key, userObj); in ptrace_enter_call()
363 pContext = pObj->freelistProfilerContext; in ptrace_enter_call()
365 pObj->freelistProfilerContext = pContext->previous; in ptrace_enter_call()
372 pObj->flags |= POF_NOMEMORY; in ptrace_enter_call()
376 initContext(pObj, pContext, profEntry); in ptrace_enter_call()
386 ProfilerObject *pObj = (ProfilerObject*)self; in ptrace_leave_call() local
390 pContext = pObj->currentProfilerContext; in ptrace_leave_call()
393 profEntry = getEntry(pObj, key); in ptrace_leave_call()
395 Stop(pObj, pContext, profEntry); in ptrace_leave_call()
398 pObj->currentProfilerContext = pContext->previous; in ptrace_leave_call()
401 pContext->previous = pObj->freelistProfilerContext; in ptrace_leave_call()
402 pObj->freelistProfilerContext = pContext; in ptrace_leave_call()
464 pending_exception(ProfilerObject *pObj) in pending_exception() argument
466 if (pObj->flags & POF_NOMEMORY) { in pending_exception()
467 pObj->flags -= POF_NOMEMORY; in pending_exception()
637 setSubcalls(ProfilerObject *pObj, int nvalue) in setSubcalls() argument
640 pObj->flags &= ~POF_SUBCALLS; in setSubcalls()
642 pObj->flags |= POF_SUBCALLS; in setSubcalls()
647 setBuiltins(ProfilerObject *pObj, int nvalue) in setBuiltins() argument
650 pObj->flags &= ~POF_BUILTINS; in setBuiltins()
652 pObj->flags |= POF_BUILTINS; in setBuiltins()
690 flush_unmatched(ProfilerObject *pObj) in flush_unmatched() argument
692 while (pObj->currentProfilerContext) { in flush_unmatched()
693 ProfilerContext *pContext = pObj->currentProfilerContext; in flush_unmatched()
696 Stop(pObj, pContext, profEntry); in flush_unmatched()
698 pObj->currentProfilerContext = pContext->previous; in flush_unmatched()
734 profiler_clear(ProfilerObject *pObj, PyObject* noarg) in profiler_clear() argument
736 clearEntries(pObj); in profiler_clear()
767 profiler_init(ProfilerObject *pObj, PyObject *args, PyObject *kw) in profiler_init() argument
781 if (setSubcalls(pObj, subcalls) < 0 || setBuiltins(pObj, builtins) < 0) in profiler_init()
783 pObj->externalTimerUnit = timeunit; in profiler_init()
785 Py_XSETREF(pObj->externalTimer, timer); in profiler_init()