summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapimodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-03-22 15:13:31 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-03-22 15:13:31 (GMT)
commit84aab09421330711607671ed8bc637ea2a8e273c (patch)
treec8fb3373d3c7dd1cef0764e8da7ccc085926b972 /Modules/_testcapimodule.c
parent24f949e10c4031c059118dd4b49cace16d4e3e5d (diff)
downloadcpython-84aab09421330711607671ed8bc637ea2a8e273c.zip
cpython-84aab09421330711607671ed8bc637ea2a8e273c.tar.gz
cpython-84aab09421330711607671ed8bc637ea2a8e273c.tar.bz2
Issue #26588: add debug traces
Try to debug random failure on buildbots.
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r--Modules/_testcapimodule.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 8c79485..f952aec 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -3747,6 +3747,19 @@ tracemalloc_get_traceback(PyObject *self, PyObject *args)
return _PyTraceMalloc_GetTraceback(domain, (Py_uintptr_t)ptr);
}
+PyObject*
+tracemalloc_set_debug(PyObject *self, PyObject *args)
+{
+ int debug;
+ extern int tracemalloc_debug;
+
+ if (!PyArg_ParseTuple(args, "i", &debug))
+ return NULL;
+
+ tracemalloc_debug = debug;
+ Py_RETURN_NONE;
+}
+
static PyMethodDef TestMethods[] = {
{"raise_exception", raise_exception, METH_VARARGS},
@@ -3936,6 +3949,7 @@ static PyMethodDef TestMethods[] = {
{"tracemalloc_track", tracemalloc_track, METH_VARARGS},
{"tracemalloc_untrack", tracemalloc_untrack, METH_VARARGS},
{"tracemalloc_get_traceback", tracemalloc_get_traceback, METH_VARARGS},
+ {"tracemalloc_set_debug", tracemalloc_set_debug, METH_VARARGS},
{NULL, NULL} /* sentinel */
};