Generated by Cython 0.29.23
Yellow lines hint at Python interaction.
Click on a line that starts with a "+
" to see the C code that Cython generated for it.
Raw output: tracer.c
+001: import numpy as np
__pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
002: from py_pal.data_collection.opcode_metric cimport AdvancedOpcodeMetric, OpcodeMetric
003: from py_pal.data_collection.proxy cimport get_input_factor
004: from py_pal.data_collection.arguments cimport getfullargs
005:
+006: from py_pal.util import setup_logging
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_setup_logging); __Pyx_GIVEREF(__pyx_n_s_setup_logging); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_setup_logging); __pyx_t_2 = __Pyx_Import(__pyx_kp_s_py_pal_util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_setup_logging); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setup_logging, __pyx_t_1) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
007:
+008: logger = setup_logging(__name__)
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_setup_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_3) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
009:
+010: cdef class TraceEvent:
struct __pyx_obj_6py_pal_15data_collection_6tracer_TraceEvent { PyObject_HEAD };
+011: CALL = 0
if (PyDict_SetItem((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent->tp_dict, __pyx_n_s_CALL, __pyx_int_0) < 0) __PYX_ERR(0, 11, __pyx_L1_error) PyType_Modified(__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent);
+012: EXCEPTION = 1
if (PyDict_SetItem((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent->tp_dict, __pyx_n_s_EXCEPTION, __pyx_int_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error) PyType_Modified(__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent);
+013: LINE = 2
if (PyDict_SetItem((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent->tp_dict, __pyx_n_s_LINE, __pyx_int_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) PyType_Modified(__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent);
+014: RETURN = 3
if (PyDict_SetItem((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent->tp_dict, __pyx_n_s_RETURN, __pyx_int_3) < 0) __PYX_ERR(0, 14, __pyx_L1_error) PyType_Modified(__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent);
+015: C_CALL = 4
if (PyDict_SetItem((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent->tp_dict, __pyx_n_s_C_CALL, __pyx_int_4) < 0) __PYX_ERR(0, 15, __pyx_L1_error) PyType_Modified(__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent);
+016: C_EXCEPTION = 5
if (PyDict_SetItem((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent->tp_dict, __pyx_n_s_C_EXCEPTION, __pyx_int_5) < 0) __PYX_ERR(0, 16, __pyx_L1_error) PyType_Modified(__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent);
+017: C_RETURN = 6
if (PyDict_SetItem((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent->tp_dict, __pyx_n_s_C_RETURN, __pyx_int_6) < 0) __PYX_ERR(0, 17, __pyx_L1_error) PyType_Modified(__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent);
+018: OPCODE = 7
if (PyDict_SetItem((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent->tp_dict, __pyx_n_s_OPCODE, __pyx_int_7) < 0) __PYX_ERR(0, 18, __pyx_L1_error) PyType_Modified(__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent);
019:
+020: cdef class Tracer:
struct __pyx_vtabstruct_6py_pal_15data_collection_6tracer_Tracer { PyObject *(*get_call_stats)(struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *, int __pyx_skip_dispatch); PyObject *(*get_opcode_stats)(struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_6py_pal_15data_collection_6tracer_Tracer *__pyx_vtabptr_6py_pal_15data_collection_6tracer_Tracer;
021: """Tracing hook manager implemented as Cython extension class :doc:`cython:src/tutorial/cdef_classes`."""
+022: def __init__(self, OpcodeMetric metric=AdvancedOpcodeMetric(), tuple ignore_modules=()):
/* Python wrapper */ static int __pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *__pyx_v_metric = 0; PyObject *__pyx_v_ignore_modules = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_metric,&__pyx_n_s_ignore_modules,0}; PyObject* values[2] = {0,0}; values[0] = (PyObject *)__pyx_k_; values[1] = ((PyObject*)__pyx_empty_tuple); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metric); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_modules); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 22, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_metric = ((struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *)values[0]); __pyx_v_ignore_modules = ((PyObject*)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 22, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("py_pal.data_collection.tracer.Tracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric), __pyx_ptype_6py_pal_15data_collection_13opcode_metric_OpcodeMetric, 1, "metric", 0))) __PYX_ERR(0, 22, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ignore_modules), (&PyTuple_Type), 1, "ignore_modules", 1))) __PYX_ERR(0, 22, __pyx_L1_error) __pyx_r = __pyx_pf_6py_pal_15data_collection_6tracer_6Tracer___init__(((struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *)__pyx_v_self), __pyx_v_metric, __pyx_v_ignore_modules); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6py_pal_15data_collection_6tracer_6Tracer___init__(struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *__pyx_v_self, struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *__pyx_v_metric, PyObject *__pyx_v_ignore_modules) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("py_pal.data_collection.tracer.Tracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6py_pal_15data_collection_13opcode_metric_AdvancedOpcodeMetric)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_k_ = ((struct __pyx_obj_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *)__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0;
+023: self.blacklist = [
__Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->blacklist); __Pyx_DECREF(__pyx_v_self->blacklist); __pyx_v_self->blacklist = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+024: "py_pal",
__pyx_t_2 = PyList_New(11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_py_pal); __Pyx_GIVEREF(__pyx_n_s_py_pal); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_py_pal); __Pyx_INCREF(__pyx_kp_s_py_pal_analysis_complexity); __Pyx_GIVEREF(__pyx_kp_s_py_pal_analysis_complexity); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_kp_s_py_pal_analysis_complexity); __Pyx_INCREF(__pyx_kp_s_py_pal_core); __Pyx_GIVEREF(__pyx_kp_s_py_pal_core); PyList_SET_ITEM(__pyx_t_2, 2, __pyx_kp_s_py_pal_core); __Pyx_INCREF(__pyx_kp_s_py_pal_datagen); __Pyx_GIVEREF(__pyx_kp_s_py_pal_datagen); PyList_SET_ITEM(__pyx_t_2, 3, __pyx_kp_s_py_pal_datagen); __Pyx_INCREF(__pyx_kp_s_py_pal_analysis_estimator); __Pyx_GIVEREF(__pyx_kp_s_py_pal_analysis_estimator); PyList_SET_ITEM(__pyx_t_2, 4, __pyx_kp_s_py_pal_analysis_estimator); __Pyx_INCREF(__pyx_kp_s_py_pal_util); __Pyx_GIVEREF(__pyx_kp_s_py_pal_util); PyList_SET_ITEM(__pyx_t_2, 5, __pyx_kp_s_py_pal_util); __Pyx_INCREF(__pyx_kp_s_py_pal_data_collection_arguments); __Pyx_GIVEREF(__pyx_kp_s_py_pal_data_collection_arguments); PyList_SET_ITEM(__pyx_t_2, 6, __pyx_kp_s_py_pal_data_collection_arguments); __Pyx_INCREF(__pyx_kp_s_py_pal_data_collection_metric); __Pyx_GIVEREF(__pyx_kp_s_py_pal_data_collection_metric); PyList_SET_ITEM(__pyx_t_2, 7, __pyx_kp_s_py_pal_data_collection_metric); __Pyx_INCREF(__pyx_kp_s_py_pal_data_collection_opcode_me); __Pyx_GIVEREF(__pyx_kp_s_py_pal_data_collection_opcode_me); PyList_SET_ITEM(__pyx_t_2, 8, __pyx_kp_s_py_pal_data_collection_opcode_me); __Pyx_INCREF(__pyx_kp_s_py_pal_data_collection_proxy); __Pyx_GIVEREF(__pyx_kp_s_py_pal_data_collection_proxy); PyList_SET_ITEM(__pyx_t_2, 9, __pyx_kp_s_py_pal_data_collection_proxy); __Pyx_INCREF(__pyx_kp_s_py_pal_data_collection_tracer); __Pyx_GIVEREF(__pyx_kp_s_py_pal_data_collection_tracer); PyList_SET_ITEM(__pyx_t_2, 10, __pyx_kp_s_py_pal_data_collection_tracer); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0;
025: "py_pal.analysis.complexity",
026: "py_pal.core",
027: "py_pal.datagen",
028: "py_pal.analysis.estimator",
029: "py_pal.util",
030: "py_pal.data_collection.arguments",
031: "py_pal.data_collection.metric",
032: "py_pal.data_collection.opcode_metric",
033: "py_pal.data_collection.proxy",
034: "py_pal.data_collection.tracer",
+035: *ignore_modules
if (__Pyx_PyList_Extend(__pyx_t_1, __pyx_v_ignore_modules) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
036: ]
+037: self.metric = metric
__Pyx_INCREF(((PyObject *)__pyx_v_metric)); __Pyx_GIVEREF(((PyObject *)__pyx_v_metric)); __Pyx_GOTREF(__pyx_v_self->metric); __Pyx_DECREF(((PyObject *)__pyx_v_self->metric)); __pyx_v_self->metric = __pyx_v_metric;
+038: self.call_id = 0
__pyx_v_self->call_id = 0;
+039: self.calls = [(self.call_id, 0, '__main__', 0, '<module>', None, None, None, None, None, None, None, None)]
__pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->call_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0); __Pyx_INCREF(__pyx_n_s_main); __Pyx_GIVEREF(__pyx_n_s_main); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_main); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_int_0); __Pyx_INCREF(__pyx_kp_s_module); __Pyx_GIVEREF(__pyx_kp_s_module); PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_s_module); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_2, 5, Py_None); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_2, 6, Py_None); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_2, 7, Py_None); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_2, 8, Py_None); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_2, 9, Py_None); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_2, 10, Py_None); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_2, 11, Py_None); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_2, 12, Py_None); __pyx_t_1 = 0; __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->calls); __Pyx_DECREF(__pyx_v_self->calls); __pyx_v_self->calls = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+040: self.opcodes = {}
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->opcodes); __Pyx_DECREF(__pyx_v_self->opcodes); __pyx_v_self->opcodes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+041: self.f_weight_map = {}
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->f_weight_map); __Pyx_DECREF(__pyx_v_self->f_weight_map); __pyx_v_self->f_weight_map = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+042: self.call_stack = [(self.call_id, 0)]
__pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->call_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0); __pyx_t_1 = 0; __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->call_stack); __Pyx_DECREF(__pyx_v_self->call_stack); __pyx_v_self->call_stack = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+043: self.call_id += 1
__pyx_v_self->call_id = (__pyx_v_self->call_id + 1);
044:
+045: def __call__(self, FrameType frame, int what, object arg) -> Tracer:
/* Python wrapper */ static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyFrameObject *__pyx_v_frame = 0; CYTHON_UNUSED int __pyx_v_what; CYTHON_UNUSED PyObject *__pyx_v_arg = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frame,&__pyx_n_s_what,&__pyx_n_s_arg,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frame)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_what)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__call__", 1, 3, 3, 1); __PYX_ERR(0, 45, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arg)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__call__", 1, 3, 3, 2); __PYX_ERR(0, 45, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 45, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_frame = ((PyFrameObject *)values[0]); __pyx_v_what = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_what == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L3_error) __pyx_v_arg = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 45, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("py_pal.data_collection.tracer.Tracer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_frame), __pyx_ptype_6py_pal_15data_collection_6tracer_FrameType, 1, "frame", 0))) __PYX_ERR(0, 45, __pyx_L1_error) __pyx_r = __pyx_pf_6py_pal_15data_collection_6tracer_6Tracer_2__call__(((struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *)__pyx_v_self), __pyx_v_frame, __pyx_v_what, __pyx_v_arg); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6py_pal_15data_collection_6tracer_6Tracer_2__call__(struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *__pyx_v_self, PyFrameObject *__pyx_v_frame, CYTHON_UNUSED int __pyx_v_what, CYTHON_UNUSED PyObject *__pyx_v_arg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("py_pal.data_collection.tracer.Tracer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+046: if frame.f_globals.get('__name__', '') not in self.blacklist:
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_frame->f_globals, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_v_self->blacklist, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* … */ } /* … */ __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_name, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3);
047: # Do not measure inside of tracing machinery
+048: self.trace()
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
049:
+050: return self
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0;
051:
+052: def trace(self) -> Tracer:
/* Python wrapper */ static struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_5trace(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6py_pal_15data_collection_6tracer_6Tracer_4trace[] = "Tracer.trace(self) -> Tracer\nInstall tracing hook."; static PyMethodDef __pyx_mdef_6py_pal_15data_collection_6tracer_6Tracer_5trace = {"trace", (PyCFunction)__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_5trace, METH_NOARGS, __pyx_doc_6py_pal_15data_collection_6tracer_6Tracer_4trace}; static struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_5trace(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("trace (wrapper)", 0); __pyx_r = __pyx_pf_6py_pal_15data_collection_6tracer_6Tracer_4trace(((struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *__pyx_pf_6py_pal_15data_collection_6tracer_6Tracer_4trace(struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *__pyx_v_self) { struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("trace", 0); /* … */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* … */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_u_Tracer) < 0) __PYX_ERR(0, 52, __pyx_L1_error) __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6py_pal_15data_collection_6tracer_6Tracer_5trace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tracer_trace, NULL, __pyx_kp_s_py_pal_data_collection_tracer, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_1, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_Tracer->tp_dict, __pyx_n_s_trace, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6py_pal_15data_collection_6tracer_Tracer); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_py_pal_data_collection_trace, __pyx_n_s_trace, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 52, __pyx_L1_error)
053: """Install tracing hook."""
+054: PyEval_SetTrace(<Py_tracefunc> trace_func, <PyObject *> self)
PyEval_SetTrace(((Py_tracefunc)__pyx_f_6py_pal_15data_collection_6tracer_trace_func), ((PyObject *)__pyx_v_self));
+055: return self
__Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = __pyx_v_self; goto __pyx_L0;
056:
+057: def stop(self):
/* Python wrapper */ static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_7stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6py_pal_15data_collection_6tracer_6Tracer_6stop[] = "Tracer.stop(self)\nRemove tracing hook."; static PyMethodDef __pyx_mdef_6py_pal_15data_collection_6tracer_6Tracer_7stop = {"stop", (PyCFunction)__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_7stop, METH_NOARGS, __pyx_doc_6py_pal_15data_collection_6tracer_6Tracer_6stop}; static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_7stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); __pyx_r = __pyx_pf_6py_pal_15data_collection_6tracer_6Tracer_6stop(((struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6py_pal_15data_collection_6tracer_6Tracer_6stop(CYTHON_UNUSED struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* … */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6py_pal_15data_collection_6tracer_6Tracer_7stop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tracer_stop, NULL, __pyx_kp_s_py_pal_data_collection_tracer, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_Tracer->tp_dict, __pyx_n_s_stop, __pyx_t_1) < 0) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6py_pal_15data_collection_6tracer_Tracer); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_py_pal_data_collection_trace, __pyx_n_s_stop, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 57, __pyx_L1_error)
058: """Remove tracing hook."""
+059: PyEval_SetTrace(NULL, NULL)
PyEval_SetTrace(NULL, NULL);
060:
+061: cpdef get_call_stats(self):
static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_9get_call_stats(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_f_6py_pal_15data_collection_6tracer_6Tracer_get_call_stats(struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_call_stats", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("py_pal.data_collection.tracer.Tracer.get_call_stats", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_9get_call_stats(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6py_pal_15data_collection_6tracer_6Tracer_8get_call_stats[] = "Tracer.get_call_stats(self)\nReturn function call statistics.\n \n Returns:\n :class:`numpy.ndarray`: Set of function calls with arguments and meta information.\n "; static PyMethodDef __pyx_mdef_6py_pal_15data_collection_6tracer_6Tracer_9get_call_stats = {"get_call_stats", (PyCFunction)__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_9get_call_stats, METH_NOARGS, __pyx_doc_6py_pal_15data_collection_6tracer_6Tracer_8get_call_stats}; static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_9get_call_stats(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_call_stats (wrapper)", 0); __pyx_r = __pyx_pf_6py_pal_15data_collection_6tracer_6Tracer_8get_call_stats(((struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6py_pal_15data_collection_6tracer_6Tracer_8get_call_stats(struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_call_stats", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6py_pal_15data_collection_6tracer_6Tracer_get_call_stats(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("py_pal.data_collection.tracer.Tracer.get_call_stats", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* … */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6py_pal_15data_collection_6tracer_6Tracer_9get_call_stats, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tracer_get_call_stats, NULL, __pyx_kp_s_py_pal_data_collection_tracer, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_Tracer->tp_dict, __pyx_n_s_get_call_stats, __pyx_t_1) < 0) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6py_pal_15data_collection_6tracer_Tracer); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_py_pal_data_collection_trace, __pyx_n_s_get_call_stats, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 61, __pyx_L1_error)
062: """Return function call statistics.
063:
064: Returns:
065: :class:`numpy.ndarray`: Set of function calls with arguments and meta information.
066: """
+067: return np.asarray(self.calls)
__Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_self->calls) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->calls); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
068:
+069: cpdef get_opcode_stats(self):
static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_11get_opcode_stats(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_f_6py_pal_15data_collection_6tracer_6Tracer_get_opcode_stats(struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_7genexpr__pyx_v_k = NULL; PyObject *__pyx_7genexpr__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_opcode_stats", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("py_pal.data_collection.tracer.Tracer.get_opcode_stats", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k); __Pyx_XDECREF(__pyx_7genexpr__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_11get_opcode_stats(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6py_pal_15data_collection_6tracer_6Tracer_10get_opcode_stats[] = "Tracer.get_opcode_stats(self)\nReturn opcode statistics.\n \n Returns:\n :class:`numpy.ndarray`: Map of function call ids to opcode statistics.\n "; static PyMethodDef __pyx_mdef_6py_pal_15data_collection_6tracer_6Tracer_11get_opcode_stats = {"get_opcode_stats", (PyCFunction)__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_11get_opcode_stats, METH_NOARGS, __pyx_doc_6py_pal_15data_collection_6tracer_6Tracer_10get_opcode_stats}; static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_11get_opcode_stats(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_opcode_stats (wrapper)", 0); __pyx_r = __pyx_pf_6py_pal_15data_collection_6tracer_6Tracer_10get_opcode_stats(((struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6py_pal_15data_collection_6tracer_6Tracer_10get_opcode_stats(struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_opcode_stats", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6py_pal_15data_collection_6tracer_6Tracer_get_opcode_stats(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("py_pal.data_collection.tracer.Tracer.get_opcode_stats", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* … */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6py_pal_15data_collection_6tracer_6Tracer_11get_opcode_stats, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tracer_get_opcode_stats, NULL, __pyx_kp_s_py_pal_data_collection_tracer, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_Tracer->tp_dict, __pyx_n_s_get_opcode_stats, __pyx_t_1) < 0) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6py_pal_15data_collection_6tracer_Tracer); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_py_pal_data_collection_trace, __pyx_n_s_get_opcode_stats, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 69, __pyx_L1_error)
070: """Return opcode statistics.
071:
072: Returns:
073: :class:`numpy.ndarray`: Map of function call ids to opcode statistics.
074: """
+075: return np.asarray([(*k, v) for k, v in self.opcodes.items()])
__Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = 0; if (unlikely(__pyx_v_self->opcodes == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 75, __pyx_L5_error) } __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_self->opcodes, 1, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 75, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_8; __pyx_t_8 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, &__pyx_t_9, NULL, __pyx_t_7); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 75, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_k, __pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_v, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PySequence_List(__pyx_7genexpr__pyx_v_k); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 75, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_ListComp_Append(__pyx_t_9, __pyx_7genexpr__pyx_v_v) < 0) __PYX_ERR(0, 75, __pyx_L5_error) { PyObject *__pyx_temp = PyList_AsTuple(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = __pyx_temp; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 75, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); } if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 75, __pyx_L5_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k); __pyx_7genexpr__pyx_v_k = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_v); __pyx_7genexpr__pyx_v_v = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k); __pyx_7genexpr__pyx_v_k = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_v); __pyx_7genexpr__pyx_v_v = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
076:
+077: def __enter__(self):
/* Python wrapper */ static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_13__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6py_pal_15data_collection_6tracer_6Tracer_12__enter__[] = "Tracer.__enter__(self)"; static PyMethodDef __pyx_mdef_6py_pal_15data_collection_6tracer_6Tracer_13__enter__ = {"__enter__", (PyCFunction)__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_13__enter__, METH_NOARGS, __pyx_doc_6py_pal_15data_collection_6tracer_6Tracer_12__enter__}; static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_13__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); __pyx_r = __pyx_pf_6py_pal_15data_collection_6tracer_6Tracer_12__enter__(((struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6py_pal_15data_collection_6tracer_6Tracer_12__enter__(struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__", 0); /* … */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* … */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6py_pal_15data_collection_6tracer_6Tracer_13__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tracer___enter, NULL, __pyx_kp_s_py_pal_data_collection_tracer, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_Tracer->tp_dict, __pyx_n_s_enter, __pyx_t_1) < 0) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6py_pal_15data_collection_6tracer_Tracer); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_py_pal_data_collection_trace, __pyx_n_s_enter, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 77, __pyx_L1_error)
+078: return self
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0;
079:
+080: def __exit__(self, exc_type, exc_val, exc_tb):
/* Python wrapper */ static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_15__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6py_pal_15data_collection_6tracer_6Tracer_14__exit__[] = "Tracer.__exit__(self, exc_type, exc_val, exc_tb)"; static PyMethodDef __pyx_mdef_6py_pal_15data_collection_6tracer_6Tracer_15__exit__ = {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_15__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6py_pal_15data_collection_6tracer_6Tracer_14__exit__}; static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_6Tracer_15__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0; CYTHON_UNUSED PyObject *__pyx_v_exc_val = 0; CYTHON_UNUSED PyObject *__pyx_v_exc_tb = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_val,&__pyx_n_s_exc_tb,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 80, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_tb)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 80, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 80, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_exc_type = values[0]; __pyx_v_exc_val = values[1]; __pyx_v_exc_tb = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 80, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("py_pal.data_collection.tracer.Tracer.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6py_pal_15data_collection_6tracer_6Tracer_14__exit__(((struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_val, __pyx_v_exc_tb); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6py_pal_15data_collection_6tracer_6Tracer_14__exit__(struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("py_pal.data_collection.tracer.Tracer.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__18 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); /* … */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6py_pal_15data_collection_6tracer_6Tracer_15__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tracer___exit, NULL, __pyx_kp_s_py_pal_data_collection_tracer, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_Tracer->tp_dict, __pyx_n_s_exit, __pyx_t_1) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6py_pal_15data_collection_6tracer_Tracer); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_py_pal_data_collection_trace, __pyx_n_s_exit, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 80, __pyx_L1_error)
+081: self.stop()
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
082:
083: cdef int last_lineno
084:
+085: def trace_func_doc():
/* Python wrapper */ static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_1trace_func_doc(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6py_pal_15data_collection_6tracer_trace_func_doc[] = "trace_func_doc()\n`trace_func` is the central data collection functionality. The function is called for specific events within a\n frame, documented in detail in :meth:`sys.settrace`. The events are emitted after the opcode execution. The `call`\n and `return` events are used to structure the calls into a hierarchy.\n The function is currently not accessible from Python. It is used by the 'tracer' class as a tracing hook.\n "; static PyMethodDef __pyx_mdef_6py_pal_15data_collection_6tracer_1trace_func_doc = {"trace_func_doc", (PyCFunction)__pyx_pw_6py_pal_15data_collection_6tracer_1trace_func_doc, METH_NOARGS, __pyx_doc_6py_pal_15data_collection_6tracer_trace_func_doc}; static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_1trace_func_doc(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("trace_func_doc (wrapper)", 0); __pyx_r = __pyx_pf_6py_pal_15data_collection_6tracer_trace_func_doc(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6py_pal_15data_collection_6tracer_trace_func_doc(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("trace_func_doc", 0); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6py_pal_15data_collection_6tracer_1trace_func_doc, 0, __pyx_n_s_trace_func_doc, NULL, __pyx_kp_s_py_pal_data_collection_tracer, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_trace_func_doc, __pyx_t_1) < 0) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* … */ __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_py_pal_data_collection_trace, __pyx_n_s_trace_func_doc, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 85, __pyx_L1_error)
086: """`trace_func` is the central data collection functionality. The function is called for specific events within a
087: frame, documented in detail in :meth:`sys.settrace`. The events are emitted after the opcode execution. The `call`
088: and `return` events are used to structure the calls into a hierarchy.
089: The function is currently not accessible from Python. It is used by the 'tracer' class as a tracing hook.
090: """
091: pass
092:
+093: cdef int trace_func(Tracer self, FrameType frame, int what, PyObject *arg) except -1:
static int __pyx_f_6py_pal_15data_collection_6tracer_trace_func(struct __pyx_obj_6py_pal_15data_collection_6tracer_Tracer *__pyx_v_self, PyFrameObject *__pyx_v_frame, int __pyx_v_what, CYTHON_UNUSED PyObject *__pyx_v_arg) { struct __pyx_obj_6py_pal_15data_collection_6tracer___pyx_scope_struct____pyx_f_6py_pal_15data_collection_6tracer_trace_func *__pyx_cur_scope; PyObject *__pyx_v__args = NULL; PyObject *__pyx_v_kwonlyargs = NULL; PyObject *__pyx_v__varargs = NULL; PyObject *__pyx_v__varkw = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kwargs = NULL; PyObject *__pyx_v_varargs = NULL; PyObject *__pyx_v_varkw = NULL; PyObject *__pyx_v_child = NULL; PyObject *__pyx_v_parent = NULL; PyObject *__pyx_v_value = NULL; PyObject *__pyx_v_parent_weight = NULL; PyObject *__pyx_v__value = NULL; Py_ssize_t __pyx_v_metric_value; PyObject *__pyx_v_call = NULL; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_value_line = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("trace_func", 0); __pyx_cur_scope = (struct __pyx_obj_6py_pal_15data_collection_6tracer___pyx_scope_struct____pyx_f_6py_pal_15data_collection_6tracer_trace_func *)__pyx_tp_new_6py_pal_15data_collection_6tracer___pyx_scope_struct____pyx_f_6py_pal_15data_collection_6tracer_trace_func(__pyx_ptype_6py_pal_15data_collection_6tracer___pyx_scope_struct____pyx_f_6py_pal_15data_collection_6tracer_trace_func, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_6py_pal_15data_collection_6tracer___pyx_scope_struct____pyx_f_6py_pal_15data_collection_6tracer_trace_func *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 93, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_frame = __pyx_v_frame; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_frame); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_frame); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("py_pal.data_collection.tracer.trace_func", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v__args); __Pyx_XDECREF(__pyx_v_kwonlyargs); __Pyx_XDECREF(__pyx_v__varargs); __Pyx_XDECREF(__pyx_v__varkw); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_XDECREF(__pyx_v_varargs); __Pyx_XDECREF(__pyx_v_varkw); __Pyx_XDECREF(__pyx_v_child); __Pyx_XDECREF(__pyx_v_parent); __Pyx_XDECREF(__pyx_v_value); __Pyx_XDECREF(__pyx_v_parent_weight); __Pyx_XDECREF(__pyx_v__value); __Pyx_XDECREF(__pyx_v_call); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_value_line); __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_obj_6py_pal_15data_collection_6tracer___pyx_scope_struct____pyx_f_6py_pal_15data_collection_6tracer_trace_func { PyObject_HEAD PyFrameObject *__pyx_v_frame; };
+094: frame.f_trace_opcodes = 1
__pyx_cur_scope->__pyx_v_frame->f_trace_opcodes = 1;
+095: frame.f_trace_lines = 0
__pyx_cur_scope->__pyx_v_frame->f_trace_lines = 0;
096:
097: global last_lineno
098:
+099: if frame.f_globals.get('__name__', '') in self.blacklist:
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_frame->f_globals, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_v_self->blacklist, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* … */ }
+100: return 0
__pyx_r = 0; goto __pyx_L0;
101:
+102: if what == TraceEvent.CALL:
__pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_what); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent), __pyx_n_s_CALL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L4; }
103: # Add call as row (module, function, args, kwargs)
+104: self.call_stack.append((self.call_id, last_lineno))
if (unlikely(__pyx_v_self->call_stack == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); __PYX_ERR(0, 104, __pyx_L1_error) } __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_self->call_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_6py_pal_15data_collection_6tracer_last_lineno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_self->call_stack, __pyx_t_2); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
105:
+106: PyFrame_FastToLocals(frame)
__pyx_t_2 = ((PyObject *)__pyx_cur_scope->__pyx_v_frame); __Pyx_INCREF(__pyx_t_2); PyFrame_FastToLocals(((PyFrameObject *)__pyx_t_2)); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+107: _args, kwonlyargs, _varargs, _varkw = getfullargs(frame.f_code)
__pyx_t_2 = ((PyObject *)__pyx_cur_scope->__pyx_v_frame->f_code); __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __pyx_f_6py_pal_15data_collection_9arguments_getfullargs(__pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(__pyx_t_1 != Py_None)) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 107, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_5,&__pyx_t_7,&__pyx_t_8}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 107, __pyx_L1_error) } __pyx_v__args = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_kwonlyargs = __pyx_t_5; __pyx_t_5 = 0; __pyx_v__varargs = __pyx_t_7; __pyx_t_7 = 0; __pyx_v__varkw = __pyx_t_8; __pyx_t_8 = 0;
108:
+109: if isinstance(_args, list):
__pyx_t_4 = PyList_Check(__pyx_v__args);
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
/* … */
}
+110: _args = tuple(_args)
__pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v__args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v__args, __pyx_t_1); __pyx_t_1 = 0;
111:
+112: if isinstance(kwonlyargs, list):
__pyx_t_3 = PyList_Check(__pyx_v_kwonlyargs);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
/* … */
}
+113: kwonlyargs = tuple(kwonlyargs)
__pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_kwonlyargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_kwonlyargs, __pyx_t_1); __pyx_t_1 = 0;
114:
+115: if isinstance(_varargs, list):
__pyx_t_4 = PyList_Check(__pyx_v__varargs);
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
/* … */
}
+116: _varargs = tuple(_varargs)
__pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v__varargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v__varargs, __pyx_t_1); __pyx_t_1 = 0;
117:
+118: if isinstance(_varkw, list):
__pyx_t_3 = PyList_Check(__pyx_v__varkw);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
/* … */
}
+119: _varkw = tuple(_varkw)
__pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v__varkw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v__varkw, __pyx_t_1); __pyx_t_1 = 0;
120:
+121: args = tuple(map(lambda x: frame.f_locals[x], _args)) if _args else ()
/* Python wrapper */ static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_lambda(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static PyMethodDef __pyx_mdef_6py_pal_15data_collection_6tracer_10trace_func_lambda = {"lambda", (PyCFunction)__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_lambda, METH_O, 0}; static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_lambda(PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, ((PyObject *)__pyx_v_x)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, PyObject *__pyx_v_x) { struct __pyx_obj_6py_pal_15data_collection_6tracer___pyx_scope_struct____pyx_f_6py_pal_15data_collection_6tracer_trace_func *__pyx_cur_scope; struct __pyx_obj_6py_pal_15data_collection_6tracer___pyx_scope_struct____pyx_f_6py_pal_15data_collection_6tracer_trace_func *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda", 0); __pyx_outer_scope = (struct __pyx_obj_6py_pal_15data_collection_6tracer___pyx_scope_struct____pyx_f_6py_pal_15data_collection_6tracer_trace_func *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); if (unlikely(!__pyx_cur_scope->__pyx_v_frame)) { __Pyx_RaiseClosureNameError("frame"); __PYX_ERR(0, 121, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_frame->f_locals, __pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("py_pal.data_collection.tracer.trace_func.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__args); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 121, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6py_pal_15data_collection_6tracer_10trace_func_lambda, 0, __pyx_n_s_trace_func_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_kp_s_py_pal_data_collection_tracer, __pyx_d, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __Pyx_INCREF(__pyx_v__args); __Pyx_GIVEREF(__pyx_v__args); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v__args); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_1 = __pyx_t_7; __pyx_t_7 = 0; } else { __Pyx_INCREF(__pyx_empty_tuple); __pyx_t_1 = __pyx_empty_tuple; } __pyx_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+122: kwargs = tuple(map(lambda x: frame.f_locals[x], kwonlyargs)) if kwonlyargs else ()
/* Python wrapper */ static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_1lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static PyMethodDef __pyx_mdef_6py_pal_15data_collection_6tracer_10trace_func_1lambda1 = {"lambda1", (PyCFunction)__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_1lambda1, METH_O, 0}; static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_1lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, ((PyObject *)__pyx_v_x)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) { struct __pyx_obj_6py_pal_15data_collection_6tracer___pyx_scope_struct____pyx_f_6py_pal_15data_collection_6tracer_trace_func *__pyx_cur_scope; struct __pyx_obj_6py_pal_15data_collection_6tracer___pyx_scope_struct____pyx_f_6py_pal_15data_collection_6tracer_trace_func *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda1", 0); __pyx_outer_scope = (struct __pyx_obj_6py_pal_15data_collection_6tracer___pyx_scope_struct____pyx_f_6py_pal_15data_collection_6tracer_trace_func *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); if (unlikely(!__pyx_cur_scope->__pyx_v_frame)) { __Pyx_RaiseClosureNameError("frame"); __PYX_ERR(0, 122, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_frame->f_locals, __pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("py_pal.data_collection.tracer.trace_func.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwonlyargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 122, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6py_pal_15data_collection_6tracer_10trace_func_1lambda1, 0, __pyx_n_s_trace_func_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_kp_s_py_pal_data_collection_tracer, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __Pyx_INCREF(__pyx_v_kwonlyargs); __Pyx_GIVEREF(__pyx_v_kwonlyargs); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_kwonlyargs); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = __pyx_t_8; __pyx_t_8 = 0; } else { __Pyx_INCREF(__pyx_empty_tuple); __pyx_t_1 = __pyx_empty_tuple; } __pyx_v_kwargs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+123: varargs = frame.f_locals[_varargs] if _varargs else ()
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__varargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 123, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_frame->f_locals, __pyx_v__varargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __pyx_t_8; __pyx_t_8 = 0; } else { __Pyx_INCREF(__pyx_empty_tuple); __pyx_t_1 = __pyx_empty_tuple; } __pyx_v_varargs = __pyx_t_1; __pyx_t_1 = 0;
+124: varkw = frame.f_locals[_varkw].values() if _varkw else ()
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__varkw); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 124, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_frame->f_locals, __pyx_v__varkw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __pyx_t_8; __pyx_t_8 = 0; } else { __Pyx_INCREF(__pyx_empty_tuple); __pyx_t_1 = __pyx_empty_tuple; } __pyx_v_varkw = __pyx_t_1; __pyx_t_1 = 0;
125:
+126: self.calls.append((
if (unlikely(__pyx_v_self->calls == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); __PYX_ERR(0, 126, __pyx_L1_error) } /* … */ __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_self->calls, __pyx_t_12); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+127: self.call_id,
__pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->call_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* … */ __pyx_t_12 = PyTuple_New(13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_8); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_frame->f_code->co_filename); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_frame->f_code->co_filename); PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_cur_scope->__pyx_v_frame->f_code->co_filename); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_5); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_frame->f_code->co_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_frame->f_code->co_name); PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_cur_scope->__pyx_v_frame->f_code->co_name); __Pyx_INCREF(__pyx_v__args); __Pyx_GIVEREF(__pyx_v__args); PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_v__args); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_7); __Pyx_INCREF(__pyx_v_kwonlyargs); __Pyx_GIVEREF(__pyx_v_kwonlyargs); PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_v_kwonlyargs); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 8, __pyx_t_9); __Pyx_INCREF(__pyx_v__varargs); __Pyx_GIVEREF(__pyx_v__varargs); PyTuple_SET_ITEM(__pyx_t_12, 9, __pyx_v__varargs); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 10, __pyx_t_10); __Pyx_INCREF(__pyx_v__varkw); __Pyx_GIVEREF(__pyx_v__varkw); PyTuple_SET_ITEM(__pyx_t_12, 11, __pyx_v__varkw); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 12, __pyx_t_11); __pyx_t_1 = 0; __pyx_t_8 = 0; __pyx_t_5 = 0; __pyx_t_7 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
+128: id(frame.f_code),
__pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_cur_scope->__pyx_v_frame->f_code)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8);
129: frame.f_code.co_filename,
+130: frame.f_lineno,
__pyx_t_5 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_frame->f_lineno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
131: frame.f_code.co_name,
132: _args,
+133: tuple(map(lambda x: get_input_factor(x), args)) if args else None,
/* Python wrapper */ static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_2lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static PyMethodDef __pyx_mdef_6py_pal_15data_collection_6tracer_10trace_func_2lambda2 = {"lambda2", (PyCFunction)__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_2lambda2, METH_O, 0}; static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_2lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, ((PyObject *)__pyx_v_x)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda2", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6py_pal_15data_collection_5proxy_get_input_factor(__pyx_v_x, 0, NULL); if (unlikely(__pyx_t_1 == ((float)-1.0))) __PYX_ERR(0, 133, __pyx_L1_error) __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("py_pal.data_collection.tracer.trace_func.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_4 = (__pyx_v_args != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_args) != 0); if (__pyx_t_4) { __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6py_pal_15data_collection_6tracer_10trace_func_2lambda2, 0, __pyx_n_s_trace_func_locals_lambda, NULL, __pyx_kp_s_py_pal_data_collection_tracer, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_args); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __pyx_t_9; __pyx_t_9 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_7 = Py_None; }
134: kwonlyargs,
+135: tuple(map(lambda x: get_input_factor(x), kwargs)) if kwargs else None,
/* Python wrapper */ static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_3lambda3(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static PyMethodDef __pyx_mdef_6py_pal_15data_collection_6tracer_10trace_func_3lambda3 = {"lambda3", (PyCFunction)__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_3lambda3, METH_O, 0}; static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_3lambda3(PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self, ((PyObject *)__pyx_v_x)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda3", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6py_pal_15data_collection_5proxy_get_input_factor(__pyx_v_x, 0, NULL); if (unlikely(__pyx_t_1 == ((float)-1.0))) __PYX_ERR(0, 135, __pyx_L1_error) __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("py_pal.data_collection.tracer.trace_func.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_4 = (__pyx_v_kwargs != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_kwargs) != 0); if (__pyx_t_4) { __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6py_pal_15data_collection_6tracer_10trace_func_3lambda3, 0, __pyx_n_s_trace_func_locals_lambda, NULL, __pyx_kp_s_py_pal_data_collection_tracer, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_v_kwargs); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_kwargs); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __pyx_t_10; __pyx_t_10 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_9 = Py_None; }
136: _varargs,
+137: tuple(map(lambda x: get_input_factor(x), varargs)) if varargs else None,
/* Python wrapper */ static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_4lambda4(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static PyMethodDef __pyx_mdef_6py_pal_15data_collection_6tracer_10trace_func_4lambda4 = {"lambda4", (PyCFunction)__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_4lambda4, METH_O, 0}; static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_4lambda4(PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self, ((PyObject *)__pyx_v_x)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda4", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6py_pal_15data_collection_5proxy_get_input_factor(__pyx_v_x, 0, NULL); if (unlikely(__pyx_t_1 == ((float)-1.0))) __PYX_ERR(0, 137, __pyx_L1_error) __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("py_pal.data_collection.tracer.trace_func.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_varargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 137, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6py_pal_15data_collection_6tracer_10trace_func_4lambda4, 0, __pyx_n_s_trace_func_locals_lambda, NULL, __pyx_kp_s_py_pal_data_collection_tracer, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_varargs); __Pyx_GIVEREF(__pyx_v_varargs); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_varargs); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = __pyx_t_11; __pyx_t_11 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_10 = Py_None; }
138: _varkw,
+139: tuple(map(lambda x: get_input_factor(x), varkw)) if varkw else None
/* Python wrapper */ static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_5lambda5(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static PyMethodDef __pyx_mdef_6py_pal_15data_collection_6tracer_10trace_func_5lambda5 = {"lambda5", (PyCFunction)__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_5lambda5, METH_O, 0}; static PyObject *__pyx_pw_6py_pal_15data_collection_6tracer_10trace_func_5lambda5(PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda5 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda5(__pyx_self, ((PyObject *)__pyx_v_x)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda5", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6py_pal_15data_collection_5proxy_get_input_factor(__pyx_v_x, 0, NULL); if (unlikely(__pyx_t_1 == ((float)-1.0))) __PYX_ERR(0, 139, __pyx_L1_error) __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("py_pal.data_collection.tracer.trace_func.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_varkw); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 139, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6py_pal_15data_collection_6tracer_10trace_func_5lambda5, 0, __pyx_n_s_trace_func_locals_lambda, NULL, __pyx_kp_s_py_pal_data_collection_tracer, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_varkw); __Pyx_GIVEREF(__pyx_v_varkw); PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_varkw); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __pyx_t_12; __pyx_t_12 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_11 = Py_None; }
140: ))
+141: self.call_id += 1
__pyx_v_self->call_id = (__pyx_v_self->call_id + 1);
+142: logger.debug(f"Call: {self.calls[len(self.calls) - 1]}")
__Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_debug); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(__pyx_v_self->calls == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 142, __pyx_L1_error) } __pyx_t_11 = __pyx_v_self->calls; __Pyx_INCREF(__pyx_t_11); if (unlikely(__pyx_t_11 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 142, __pyx_L1_error) } __pyx_t_13 = PyList_GET_SIZE(__pyx_t_11); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_14 = (__pyx_t_13 - 1); __pyx_t_11 = __Pyx_PyObject_FormatSimple(PyList_GET_ITEM(__pyx_v_self->calls, __pyx_t_14), __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Call, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } __pyx_t_12 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
143:
+144: elif what == TraceEvent.RETURN:
__pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_what); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent), __pyx_n_s_RETURN); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = PyObject_RichCompare(__pyx_t_12, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L4; }
+145: if len(self.call_stack) > 1:
__pyx_t_9 = __pyx_v_self->call_stack; __Pyx_INCREF(__pyx_t_9); if (unlikely(__pyx_t_9 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 145, __pyx_L1_error) } __pyx_t_14 = PyList_GET_SIZE(__pyx_t_9); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = ((__pyx_t_14 > 1) != 0); if (__pyx_t_4) { /* … */ goto __pyx_L9; }
146: # Do not pop root call row
+147: child = self.call_stack.pop()
if (unlikely(__pyx_v_self->call_stack == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop"); __PYX_ERR(0, 147, __pyx_L1_error) } __pyx_t_9 = __Pyx_PyList_Pop(__pyx_v_self->call_stack); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_v_child = __pyx_t_9; __pyx_t_9 = 0;
148: else:
+149: child = self.call_stack[0]
/*else*/ { if (unlikely(__pyx_v_self->call_stack == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 149, __pyx_L1_error) } __pyx_t_9 = PyList_GET_ITEM(__pyx_v_self->call_stack, 0); __Pyx_INCREF(__pyx_t_9); __pyx_v_child = __pyx_t_9; __pyx_t_9 = 0; } __pyx_L9:;
150:
151: # Add opcode weight to parent call
+152: parent = self.call_stack[len(self.call_stack) - 1]
if (unlikely(__pyx_v_self->call_stack == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 152, __pyx_L1_error) } __pyx_t_9 = __pyx_v_self->call_stack; __Pyx_INCREF(__pyx_t_9); if (unlikely(__pyx_t_9 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 152, __pyx_L1_error) } __pyx_t_14 = PyList_GET_SIZE(__pyx_t_9); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = (__pyx_t_14 - 1); __pyx_t_9 = PyList_GET_ITEM(__pyx_v_self->call_stack, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_v_parent = __pyx_t_9; __pyx_t_9 = 0;
+153: value = self.f_weight_map.get(child[0], 0)
if (unlikely(__pyx_v_self->f_weight_map == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 153, __pyx_L1_error) } __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_child, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->f_weight_map, __pyx_t_9, __pyx_int_0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_value = __pyx_t_10; __pyx_t_10 = 0;
+154: parent_weight = self.opcodes.get(parent, 0)
if (unlikely(__pyx_v_self->opcodes == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 154, __pyx_L1_error) } __pyx_t_10 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->opcodes, __pyx_v_parent, __pyx_int_0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_v_parent_weight = __pyx_t_10; __pyx_t_10 = 0;
+155: self.opcodes[parent] = parent_weight + value
__pyx_t_10 = PyNumber_Add(__pyx_v_parent_weight, __pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (unlikely(__pyx_v_self->opcodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 155, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_self->opcodes, __pyx_v_parent, __pyx_t_10) < 0)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
156:
+157: _value = self.f_weight_map.get(parent[0], 0)
if (unlikely(__pyx_v_self->f_weight_map == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 157, __pyx_L1_error) } __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_parent, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->f_weight_map, __pyx_t_10, __pyx_int_0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v__value = __pyx_t_9; __pyx_t_9 = 0;
+158: self.f_weight_map[parent[0]] = _value + value
__pyx_t_9 = PyNumber_Add(__pyx_v__value, __pyx_v_value); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (unlikely(__pyx_v_self->f_weight_map == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 158, __pyx_L1_error) } __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_parent, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (unlikely(PyDict_SetItem(__pyx_v_self->f_weight_map, __pyx_t_10, __pyx_t_9) < 0)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+159: logger.debug(f"Return call: {child[0]}, opcodes: {value}")
__Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_logger); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_debug); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_13 = 0; __pyx_t_15 = 127; __Pyx_INCREF(__pyx_kp_u_Return_call); __pyx_t_13 += 13; __Pyx_GIVEREF(__pyx_kp_u_Return_call); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_u_Return_call); __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_child, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_11, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_15; __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7); __pyx_t_7 = 0; __Pyx_INCREF(__pyx_kp_u_opcodes); __pyx_t_13 += 11; __Pyx_GIVEREF(__pyx_kp_u_opcodes); PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_kp_u_opcodes); __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_value, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_15; __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __pyx_t_13, __pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_10, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_7); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
160:
+161: elif what == TraceEvent.OPCODE:
__pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_what); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6py_pal_15data_collection_6tracer_TraceEvent), __pyx_n_s_OPCODE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { /* … */ } __pyx_L4:;
162: # Anything in here should cause minimal overhead
+163: last_lineno = frame.f_lineno
__pyx_t_16 = __pyx_cur_scope->__pyx_v_frame->f_lineno; __pyx_v_6py_pal_15data_collection_6tracer_last_lineno = __pyx_t_16;
+164: metric_value = self.metric.get_value(frame)
if (!(likely(((((PyObject *)__pyx_cur_scope->__pyx_v_frame)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_cur_scope->__pyx_v_frame), __pyx_ptype_6py_pal_15data_collection_13opcode_metric_FrameType))))) __PYX_ERR(0, 164, __pyx_L1_error) __pyx_t_7 = ((PyObject *)__pyx_cur_scope->__pyx_v_frame); __Pyx_INCREF(__pyx_t_7); __pyx_t_13 = ((struct __pyx_vtabstruct_6py_pal_15data_collection_13opcode_metric_OpcodeMetric *)__pyx_v_self->metric->__pyx_vtab)->get_value(__pyx_v_self->metric, ((PyFrameObject *)__pyx_t_7)); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1L))) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_metric_value = __pyx_t_13;
165:
166: # Save opcode weight per line in current call
+167: call = self.call_stack[len(self.call_stack) - 1][0]
if (unlikely(__pyx_v_self->call_stack == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 167, __pyx_L1_error) } __pyx_t_7 = __pyx_v_self->call_stack; __Pyx_INCREF(__pyx_t_7); if (unlikely(__pyx_t_7 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 167, __pyx_L1_error) } __pyx_t_13 = PyList_GET_SIZE(__pyx_t_7); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_14 = (__pyx_t_13 - 1); __pyx_t_7 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_self->call_stack, __pyx_t_14), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_call = __pyx_t_7; __pyx_t_7 = 0;
+168: key = (call, frame.f_lineno)
__pyx_t_7 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_frame->f_lineno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_call); __Pyx_GIVEREF(__pyx_v_call); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_call); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_7); __pyx_t_7 = 0; __pyx_v_key = ((PyObject*)__pyx_t_12); __pyx_t_12 = 0;
+169: value_line = self.opcodes.get(key, 0)
if (unlikely(__pyx_v_self->opcodes == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 169, __pyx_L1_error) } __pyx_t_12 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->opcodes, __pyx_v_key, __pyx_int_0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_v_value_line = __pyx_t_12; __pyx_t_12 = 0;
+170: self.opcodes[key] = value_line + metric_value
__pyx_t_12 = PyInt_FromSsize_t(__pyx_v_metric_value); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_7 = PyNumber_Add(__pyx_v_value_line, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(__pyx_v_self->opcodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 170, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_self->opcodes, __pyx_v_key, __pyx_t_7) < 0)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
171:
172: # Keep track of all opcodes executed within call
+173: value = self.f_weight_map.get(call, 0)
if (unlikely(__pyx_v_self->f_weight_map == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 173, __pyx_L1_error) } __pyx_t_7 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->f_weight_map, __pyx_v_call, __pyx_int_0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_value = __pyx_t_7; __pyx_t_7 = 0;
+174: self.f_weight_map[call] = value + metric_value
__pyx_t_7 = PyInt_FromSsize_t(__pyx_v_metric_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12 = PyNumber_Add(__pyx_v_value, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_v_self->f_weight_map == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 174, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_self->f_weight_map, __pyx_v_call, __pyx_t_12) < 0)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
175:
+176: return 0
__pyx_r = 0; goto __pyx_L0;