#ifndef Py_BUILD_CORE_BUILTIN
#define Py_BUILD_CORE_MODULE …
#endif
#include "Python.h"
#include "pycore_call.h"
#include "pycore_ceval.h"
#include "pycore_pystate.h"
#include "pycore_time.h"
#include "rotatingtree.h"
struct _ProfilerEntry;
ProfilerSubEntry;
ProfilerEntry;
ProfilerContext;
ProfilerObject;
#define POF_ENABLED …
#define POF_SUBCALLS …
#define POF_BUILTINS …
#define POF_EXT_TIMER …
#define POF_NOMEMORY …
#include "clinic/_lsprof.c.h"
_lsprof_state;
static inline _lsprof_state*
_lsprof_get_state(PyObject *module)
{ … }
static PyTime_t CallExternalTimer(ProfilerObject *pObj)
{ … }
static inline PyTime_t
call_timer(ProfilerObject *pObj)
{ … }
static PyObject *
normalizeUserObj(PyObject *obj)
{ … }
static ProfilerEntry*
newProfilerEntry(ProfilerObject *pObj, void *key, PyObject *userObj)
{ … }
static ProfilerEntry*
getEntry(ProfilerObject *pObj, void *key)
{ … }
static ProfilerSubEntry *
getSubEntry(ProfilerObject *pObj, ProfilerEntry *caller, ProfilerEntry* entry)
{ … }
static ProfilerSubEntry *
newSubEntry(ProfilerObject *pObj, ProfilerEntry *caller, ProfilerEntry* entry)
{ … }
static int freeSubEntry(rotating_node_t *header, void *arg)
{ … }
static int freeEntry(rotating_node_t *header, void *arg)
{ … }
static void clearEntries(ProfilerObject *pObj)
{ … }
static void
initContext(ProfilerObject *pObj, ProfilerContext *self, ProfilerEntry *entry)
{ … }
static void
Stop(ProfilerObject *pObj, ProfilerContext *self, ProfilerEntry *entry)
{ … }
static void
ptrace_enter_call(PyObject *self, void *key, PyObject *userObj)
{ … }
static void
ptrace_leave_call(PyObject *self, void *key)
{ … }
static int
pending_exception(ProfilerObject *pObj)
{ … }
static PyStructSequence_Field profiler_entry_fields[] = …;
static PyStructSequence_Field profiler_subentry_fields[] = …;
static PyStructSequence_Desc profiler_entry_desc = …;
static PyStructSequence_Desc profiler_subentry_desc = …;
statscollector_t;
static int statsForSubEntry(rotating_node_t *node, void *arg)
{ … }
static int statsForEntry(rotating_node_t *node, void *arg)
{ … }
static PyObject *
_lsprof_Profiler_getstats_impl(ProfilerObject *self, PyTypeObject *cls)
{ … }
static int
setSubcalls(ProfilerObject *pObj, int nvalue)
{ … }
static int
setBuiltins(ProfilerObject *pObj, int nvalue)
{ … }
static PyObject *
_lsprof_Profiler__pystart_callback_impl(ProfilerObject *self, PyObject *code,
PyObject *instruction_offset)
{ … }
static PyObject *
_lsprof_Profiler__pyreturn_callback_impl(ProfilerObject *self,
PyObject *code,
PyObject *instruction_offset,
PyObject *retval)
{ … }
PyObject* get_cfunc_from_callable(PyObject* callable, PyObject* self_arg, PyObject* missing)
{ … }
static PyObject *
_lsprof_Profiler__ccall_callback_impl(ProfilerObject *self, PyObject *code,
PyObject *instruction_offset,
PyObject *callable, PyObject *self_arg)
{ … }
static PyObject *
_lsprof_Profiler__creturn_callback_impl(ProfilerObject *self, PyObject *code,
PyObject *instruction_offset,
PyObject *callable,
PyObject *self_arg)
{ … }
static const struct { … } callback_table[] = …;
static PyObject *
_lsprof_Profiler_enable_impl(ProfilerObject *self, int subcalls,
int builtins)
{ … }
static void
flush_unmatched(ProfilerObject *pObj)
{ … }
static PyObject *
_lsprof_Profiler_disable_impl(ProfilerObject *self)
{ … }
static PyObject *
_lsprof_Profiler_clear_impl(ProfilerObject *self)
{ … }
static int
profiler_traverse(ProfilerObject *op, visitproc visit, void *arg)
{ … }
static void
profiler_dealloc(ProfilerObject *op)
{ … }
static int
profiler_init_impl(ProfilerObject *self, PyObject *timer, double timeunit,
int subcalls, int builtins)
{ … }
static PyMethodDef profiler_methods[] = …;
static PyType_Slot _lsprof_profiler_type_spec_slots[] = …;
static PyType_Spec _lsprof_profiler_type_spec = …;
static PyMethodDef moduleMethods[] = …;
static int
_lsprof_traverse(PyObject *module, visitproc visit, void *arg)
{ … }
static int
_lsprof_clear(PyObject *module)
{ … }
static void
_lsprof_free(void *module)
{ … }
static int
_lsprof_exec(PyObject *module)
{ … }
static PyModuleDef_Slot _lsprofslots[] = …;
static struct PyModuleDef _lsprofmodule = …;
PyMODINIT_FUNC
PyInit__lsprof(void)
{ … }