Lines Matching refs:self

170         PyObject *self = fn->m_self;
175 PyObject *mo = _PyType_Lookup(Py_TYPE(self), name);
199 ProfilerEntry *self;
200 self = (ProfilerEntry*) PyMem_Malloc(sizeof(ProfilerEntry));
201 if (self == NULL) {
208 PyMem_Free(self);
212 self->header.key = key;
213 self->userObj = userObj;
214 self->tt = 0;
215 self->it = 0;
216 self->callcount = 0;
217 self->recursivecallcount = 0;
218 self->recursionLevel = 0;
219 self->calls = EMPTY_ROTATING_TREE;
220 RotatingTree_Add(&pObj->profilerEntries, &self->header);
221 return self;
240 ProfilerSubEntry *self;
241 self = (ProfilerSubEntry*) PyMem_Malloc(sizeof(ProfilerSubEntry));
242 if (self == NULL) {
246 self->header.key = (void *)entry;
247 self->tt = 0;
248 self->it = 0;
249 self->callcount = 0;
250 self->recursivecallcount = 0;
251 self->recursionLevel = 0;
252 RotatingTree_Add(&caller->calls, &self->header);
253 return self;
290 initContext(ProfilerObject *pObj, ProfilerContext *self, ProfilerEntry *entry)
292 self->ctxEntry = entry;
293 self->subt = 0;
294 self->previous = pObj->currentProfilerContext;
295 pObj->currentProfilerContext = self;
297 if ((pObj->flags & POF_SUBCALLS) && self->previous) {
299 ProfilerEntry *caller = self->previous->ctxEntry;
306 self->t0 = call_timer(pObj);
310 Stop(ProfilerObject *pObj, ProfilerContext *self, ProfilerEntry *entry)
312 _PyTime_t tt = call_timer(pObj) - self->t0;
313 _PyTime_t it = tt - self->subt;
314 if (self->previous)
315 self->previous->subt += tt;
316 pObj->currentProfilerContext = self->previous;
323 if ((pObj->flags & POF_SUBCALLS) && self->previous) {
325 ProfilerEntry *caller = self->previous->ctxEntry;
339 ptrace_enter_call(PyObject *self, void *key, PyObject *userObj)
343 ProfilerObject *pObj = (ProfilerObject*)self;
383 ptrace_leave_call(PyObject *self, void *key)
386 ProfilerObject *pObj = (ProfilerObject*)self;
406 profiler_callback(PyObject *self, PyFrameObject *frame, int what,
415 ptrace_enter_call(self, (void *)code, (PyObject *)code);
425 ptrace_leave_call(self, (void *)code);
438 if ((((ProfilerObject *)self)->flags & POF_BUILTINS)
440 ptrace_enter_call(self,
450 if ((((ProfilerObject *)self)->flags & POF_BUILTINS)
452 ptrace_leave_call(self,
609 _lsprof_Profiler_getstats_impl(ProfilerObject *self, PyTypeObject *cls)
614 if (pending_exception(self)) {
617 if (!self->externalTimer || self->externalTimerUnit == 0.0) {
622 collect.factor = self->externalTimerUnit;
628 if (RotatingTree_Enum(self->profilerEntries, statsForEntry, &collect)
668 profiler_enable(ProfilerObject *self, PyObject *args, PyObject *kwds)
676 if (setSubcalls(self, subcalls) < 0 || setBuiltins(self, builtins) < 0) {
681 if (_PyEval_SetProfile(tstate, profiler_callback, (PyObject*)self) < 0) {
685 self->flags |= POF_ENABLED;
712 profiler_disable(ProfilerObject *self, PyObject* noarg)
718 self->flags &= ~POF_ENABLED;
720 flush_unmatched(self);
721 if (pending_exception(self)) {