1 /*[clinic input]
2 preserve
3 [clinic start generated code]*/
4
5 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
6 # include "pycore_gc.h" // PyGC_Head
7 # include "pycore_runtime.h" // _Py_ID()
8 #endif
9
10
11 PyDoc_STRVAR(_lsprof_Profiler_getstats__doc__,
12 "getstats($self, /)\n"
13 "--\n"
14 "\n"
15 "list of profiler_entry objects.\n"
16 "\n"
17 "getstats() -> list of profiler_entry objects\n"
18 "\n"
19 "Return all information collected by the profiler.\n"
20 "Each profiler_entry is a tuple-like object with the\n"
21 "following attributes:\n"
22 "\n"
23 " code code object\n"
24 " callcount how many times this was called\n"
25 " reccallcount how many times called recursively\n"
26 " totaltime total time in this entry\n"
27 " inlinetime inline time in this entry (not in subcalls)\n"
28 " calls details of the calls\n"
29 "\n"
30 "The calls attribute is either None or a list of\n"
31 "profiler_subentry objects:\n"
32 "\n"
33 " code called code object\n"
34 " callcount how many times this is called\n"
35 " reccallcount how many times this is called recursively\n"
36 " totaltime total time spent in this call\n"
37 " inlinetime inline time (not in further subcalls)");
38
39 #define _LSPROF_PROFILER_GETSTATS_METHODDEF \
40 {"getstats", _PyCFunction_CAST(_lsprof_Profiler_getstats), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _lsprof_Profiler_getstats__doc__},
41
42 static PyObject *
43 _lsprof_Profiler_getstats_impl(ProfilerObject *self, PyTypeObject *cls);
44
45 static PyObject *
46 _lsprof_Profiler_getstats(ProfilerObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
47 {
48 if (nargs) {
49 PyErr_SetString(PyExc_TypeError, "getstats() takes no arguments");
50 return NULL;
51 }
52 return _lsprof_Profiler_getstats_impl(self, cls);
53 }
54 /*[clinic end generated code: output=7425d3481349629a input=a9049054013a1b77]*/