_lsprof.c.h 1.9 KB

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