summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorNicholas Bastin <nick.bastin@gmail.com>2004-06-22 03:51:38 (GMT)
committerNicholas Bastin <nick.bastin@gmail.com>2004-06-22 03:51:38 (GMT)
commit4c70b69fb19ce5d730a70ab5d67272bb7202bd6c (patch)
tree16693f8610a4e259acaa4604c8cc40f04081f683 /Python/ceval.c
parent9c18e81fb23d60ea77bdf4f3c2649296f26e4a95 (diff)
downloadcpython-4c70b69fb19ce5d730a70ab5d67272bb7202bd6c.zip
cpython-4c70b69fb19ce5d730a70ab5d67272bb7202bd6c.tar.gz
cpython-4c70b69fb19ce5d730a70ab5d67272bb7202bd6c.tar.bz2
Making C profiling a configure option (at least temporarily)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 088c881..d5493cc 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3502,15 +3502,23 @@ call_function(PyObject ***pp_stack, int oparg
PyCFunction meth = PyCFunction_GET_FUNCTION(func);
PyObject *self = PyCFunction_GET_SELF(func);
if (flags & METH_NOARGS && na == 0) {
+#ifdef WITH_C_PROF
BEGIN_C_TRACE
+#endif
x = (*meth)(self, NULL);
+#ifdef WITH_C_PROF
END_C_TRACE
+#endif
}
else if (flags & METH_O && na == 1) {
PyObject *arg = EXT_POP(*pp_stack);
+#ifdef WITH_C_PROF
BEGIN_C_TRACE
+#endif
x = (*meth)(self, arg);
+#ifdef WITH_C_PROF
END_C_TRACE
+#endif
Py_DECREF(arg);
}
else {
@@ -3521,7 +3529,9 @@ call_function(PyObject ***pp_stack, int oparg
else {
PyObject *callargs;
callargs = load_args(pp_stack, na);
+#ifdef WITH_C_PROF
BEGIN_C_TRACE
+#endif
#ifdef WITH_TSC
rdtscll(*pintr0);
#endif
@@ -3529,7 +3539,9 @@ call_function(PyObject ***pp_stack, int oparg
#ifdef WITH_TSC
rdtscll(*pintr1);
#endif
+#ifdef WITH_C_PROF
END_C_TRACE
+#endif
Py_XDECREF(callargs);
}
} else {