summaryrefslogtreecommitdiffstats
path: root/Modules/_tracemalloc.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-03-22 20:06:07 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-03-22 20:06:07 (GMT)
commiteddb074c534e32caad468c952c7d00adcbd76a41 (patch)
treee66d09bc086e1a80442f3d7e18a38a64da29c3ef /Modules/_tracemalloc.c
parentb8d927266d6c1f098b3490b897e160222d035e5c (diff)
downloadcpython-eddb074c534e32caad468c952c7d00adcbd76a41.zip
cpython-eddb074c534e32caad468c952c7d00adcbd76a41.tar.gz
cpython-eddb074c534e32caad468c952c7d00adcbd76a41.tar.bz2
Issue #26588: more debug traces
Diffstat (limited to 'Modules/_tracemalloc.c')
-rw-r--r--Modules/_tracemalloc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
index 79a7164..a674d0c 100644
--- a/Modules/_tracemalloc.c
+++ b/Modules/_tracemalloc.c
@@ -899,7 +899,7 @@ tracemalloc_clear_traces(void)
}
#define DEBUG(MSG) \
- if (tracemalloc_debug) { fprintf(stderr, "[pid %li, tid %li] " MSG "\n", (long)getpid(), PyThread_get_thread_ident()); fflush(stderr); }
+ if (tracemalloc_debug) { fprintf(stderr, "[pid %li, tid %li, reentrant key %i] " MSG "\n", (long)getpid(), PyThread_get_thread_ident(), tracemalloc_reentrant_key); fflush(stderr); }
static int
@@ -926,6 +926,7 @@ DEBUG("tracemalloc_init(): exit (already initialized)");
#ifdef REENTRANT_THREADLOCAL
tracemalloc_reentrant_key = PyThread_create_key();
+fprintf(stderr, "[pid %li, tid %li] PyThread_create_key() -> %i\n", (long)getpid(), PyThread_get_thread_ident(), tracemalloc_reentrant_key); fflush(stderr);
if (tracemalloc_reentrant_key == -1) {
#ifdef MS_WINDOWS
PyErr_SetFromWindowsErr(0);
@@ -1023,6 +1024,7 @@ DEBUG("tracemalloc_deinit(): exit (not initialized)");
DEBUG("tracemalloc_deinit(): delete reentrant key");
#ifdef REENTRANT_THREADLOCAL
+fprintf(stderr, "[pid %li, tid %li] PyThread_delete_key(%i)\n", (long)getpid(), PyThread_get_thread_ident(), tracemalloc_reentrant_key); fflush(stderr);
PyThread_delete_key(tracemalloc_reentrant_key);
tracemalloc_reentrant_key = -1;
#endif
@@ -1640,6 +1642,9 @@ PyMODINIT_FUNC
PyInit__tracemalloc(void)
{
PyObject *m;
+
+fprintf(stderr, "[pid %li, tid %li] PyInit__tracemalloc\n", (long)getpid(), PyThread_get_thread_ident()); fflush(stderr);
+
m = PyModule_Create(&module_def);
if (m == NULL)
return NULL;