diff options
author | Victor Stinner <vstinner@python.org> | 2022-10-04 13:28:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-04 13:28:57 (GMT) |
commit | 116fa62c6ee18e2b2ccf3697802034c0d13a16e8 (patch) | |
tree | fab3ca7446049af8e4b96a0d406f250f18f0303f /Python/ceval.c | |
parent | 6e533088290b909df324615df24286489603989f (diff) | |
download | cpython-116fa62c6ee18e2b2ccf3697802034c0d13a16e8.zip cpython-116fa62c6ee18e2b2ccf3697802034c0d13a16e8.tar.gz cpython-116fa62c6ee18e2b2ccf3697802034c0d13a16e8.tar.bz2 |
gh-97670: Remove sys.getdxp() and analyze_dxp.py script (#97671)
Remove the sys.getdxp() function and the Tools/scripts/analyze_dxp.py
script. DXP stands for "dynamic execution pairs". They were related
to DYNAMIC_EXECUTION_PROFILE and DXPAIRS macros which have been
removed in Python 3.11. Python can now be built with "./configure
--enable-pystats" to gather statistics on Python opcodes.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 9453770..82b5422 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -7207,61 +7207,6 @@ format_awaitable_error(PyThreadState *tstate, PyTypeObject *type, int oparg) } } -#ifdef Py_STATS - -static PyObject * -getarray(uint64_t a[256]) -{ - int i; - PyObject *l = PyList_New(256); - if (l == NULL) return NULL; - for (i = 0; i < 256; i++) { - PyObject *x = PyLong_FromUnsignedLongLong(a[i]); - if (x == NULL) { - Py_DECREF(l); - return NULL; - } - PyList_SET_ITEM(l, i, x); - } - for (i = 0; i < 256; i++) - a[i] = 0; - return l; -} - -PyObject * -_Py_GetDXProfile(PyObject *self, PyObject *args) -{ - int i; - PyObject *l = PyList_New(257); - if (l == NULL) return NULL; - for (i = 0; i < 256; i++) { - PyObject *x = getarray(_py_stats_struct.opcode_stats[i].pair_count); - if (x == NULL) { - Py_DECREF(l); - return NULL; - } - PyList_SET_ITEM(l, i, x); - } - PyObject *counts = PyList_New(256); - if (counts == NULL) { - Py_DECREF(l); - return NULL; - } - for (i = 0; i < 256; i++) { - PyObject *x = PyLong_FromUnsignedLongLong( - _py_stats_struct.opcode_stats[i].execution_count); - if (x == NULL) { - Py_DECREF(counts); - Py_DECREF(l); - return NULL; - } - PyList_SET_ITEM(counts, i, x); - } - PyList_SET_ITEM(l, 256, counts); - return l; -} - -#endif Py_ssize_t _PyEval_RequestCodeExtraIndex(freefunc free) |