#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
# include "pycore_gc.h"
# include "pycore_runtime.h"
#endif
#include "pycore_modsupport.h"
PyDoc_STRVAR(_lsprof_Profiler_getstats__doc__,
"getstats($self, /)\n"
"--\n"
"\n"
"list of profiler_entry objects.\n"
"\n"
"getstats() -> list of profiler_entry objects\n"
"\n"
"Return all information collected by the profiler.\n"
"Each profiler_entry is a tuple-like object with the\n"
"following attributes:\n"
"\n"
" code code object\n"
" callcount how many times this was called\n"
" reccallcount how many times called recursively\n"
" totaltime total time in this entry\n"
" inlinetime inline time in this entry (not in subcalls)\n"
" calls details of the calls\n"
"\n"
"The calls attribute is either None or a list of\n"
"profiler_subentry objects:\n"
"\n"
" code called code object\n"
" callcount how many times this is called\n"
" reccallcount how many times this is called recursively\n"
" totaltime total time spent in this call\n"
" inlinetime inline time (not in further subcalls)");
#define _LSPROF_PROFILER_GETSTATS_METHODDEF …
static PyObject *
_lsprof_Profiler_getstats_impl(ProfilerObject *self, PyTypeObject *cls);
static PyObject *
_lsprof_Profiler_getstats(ProfilerObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{ … }
PyDoc_STRVAR(_lsprof_Profiler__pystart_callback__doc__,
"_pystart_callback($self, code, instruction_offset, /)\n"
"--\n"
"\n");
#define _LSPROF_PROFILER__PYSTART_CALLBACK_METHODDEF …
static PyObject *
_lsprof_Profiler__pystart_callback_impl(ProfilerObject *self, PyObject *code,
PyObject *instruction_offset);
static PyObject *
_lsprof_Profiler__pystart_callback(ProfilerObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(_lsprof_Profiler__pyreturn_callback__doc__,
"_pyreturn_callback($self, code, instruction_offset, retval, /)\n"
"--\n"
"\n");
#define _LSPROF_PROFILER__PYRETURN_CALLBACK_METHODDEF …
static PyObject *
_lsprof_Profiler__pyreturn_callback_impl(ProfilerObject *self,
PyObject *code,
PyObject *instruction_offset,
PyObject *retval);
static PyObject *
_lsprof_Profiler__pyreturn_callback(ProfilerObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(_lsprof_Profiler__ccall_callback__doc__,
"_ccall_callback($self, code, instruction_offset, callable, self_arg, /)\n"
"--\n"
"\n");
#define _LSPROF_PROFILER__CCALL_CALLBACK_METHODDEF …
static PyObject *
_lsprof_Profiler__ccall_callback_impl(ProfilerObject *self, PyObject *code,
PyObject *instruction_offset,
PyObject *callable, PyObject *self_arg);
static PyObject *
_lsprof_Profiler__ccall_callback(ProfilerObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(_lsprof_Profiler__creturn_callback__doc__,
"_creturn_callback($self, code, instruction_offset, callable, self_arg,\n"
" /)\n"
"--\n"
"\n");
#define _LSPROF_PROFILER__CRETURN_CALLBACK_METHODDEF …
static PyObject *
_lsprof_Profiler__creturn_callback_impl(ProfilerObject *self, PyObject *code,
PyObject *instruction_offset,
PyObject *callable,
PyObject *self_arg);
static PyObject *
_lsprof_Profiler__creturn_callback(ProfilerObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(_lsprof_Profiler_enable__doc__,
"enable($self, /, subcalls=True, builtins=True)\n"
"--\n"
"\n"
"Start collecting profiling information.\n"
"\n"
" subcalls\n"
" If True, also records for each function\n"
" statistics separated according to its current caller.\n"
" builtins\n"
" If True, records the time spent in\n"
" built-in functions separately from their caller.");
#define _LSPROF_PROFILER_ENABLE_METHODDEF …
static PyObject *
_lsprof_Profiler_enable_impl(ProfilerObject *self, int subcalls,
int builtins);
static PyObject *
_lsprof_Profiler_enable(ProfilerObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{ … }
PyDoc_STRVAR(_lsprof_Profiler_disable__doc__,
"disable($self, /)\n"
"--\n"
"\n"
"Stop collecting profiling information.");
#define _LSPROF_PROFILER_DISABLE_METHODDEF …
static PyObject *
_lsprof_Profiler_disable_impl(ProfilerObject *self);
static PyObject *
_lsprof_Profiler_disable(ProfilerObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(_lsprof_Profiler_clear__doc__,
"clear($self, /)\n"
"--\n"
"\n"
"Clear all profiling information collected so far.");
#define _LSPROF_PROFILER_CLEAR_METHODDEF …
static PyObject *
_lsprof_Profiler_clear_impl(ProfilerObject *self);
static PyObject *
_lsprof_Profiler_clear(ProfilerObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(profiler_init__doc__,
"Profiler(timer=None, timeunit=0.0, subcalls=True, builtins=True)\n"
"--\n"
"\n"
"Build a profiler object using the specified timer function.\n"
"\n"
"The default timer is a fast built-in one based on real time.\n"
"For custom timer functions returning integers, \'timeunit\' can\n"
"be a float specifying a scale (that is, how long each integer unit\n"
"is, in seconds).");
static int
profiler_init_impl(ProfilerObject *self, PyObject *timer, double timeunit,
int subcalls, int builtins);
static int
profiler_init(PyObject *self, PyObject *args, PyObject *kwargs)
{ … }