Lines Matching refs:traceback

83     /* Total number of frames the traceback had */
105 traceback_t *traceback;
122 /* Buffer to store a new traceback in traceback_new().
273 const traceback_t *traceback = (const traceback_t *)key;
274 return traceback->hash;
366 traceback_hash(traceback_t *traceback)
370 int len = traceback->nframe;
375 frame = traceback->frames;
385 x ^= traceback->total_nframe;
392 traceback_get_frames(traceback_t *traceback)
410 if (traceback->nframe < _Py_tracemalloc_config.max_nframe) {
411 tracemalloc_get_frame(pyframe, &traceback->frames[traceback->nframe]);
412 assert(traceback->frames[traceback->nframe].filename != NULL);
413 traceback->nframe++;
415 if (traceback->total_nframe < UINT16_MAX) {
416 traceback->total_nframe++;
427 traceback_t *traceback;
433 traceback = tracemalloc_traceback;
434 traceback->nframe = 0;
435 traceback->total_nframe = 0;
436 traceback_get_frames(traceback);
437 if (traceback->nframe == 0)
439 traceback->hash = traceback_hash(traceback);
441 /* intern the traceback */
442 entry = _Py_hashtable_get_entry(tracemalloc_tracebacks, traceback);
444 traceback = (traceback_t *)entry->key;
450 traceback_size = TRACEBACK_SIZE(traceback->nframe);
455 tracemalloc_error("failed to intern the traceback: malloc failed");
459 memcpy(copy, traceback, traceback_size);
464 tracemalloc_error("failed to intern the traceback: putdata failed");
468 traceback = copy;
470 return traceback;
534 traceback_t *traceback = traceback_new();
535 if (traceback == NULL) {
559 trace->traceback = traceback;
567 trace->traceback = traceback;
979 /* allocate a buffer to store a new traceback */
1103 traceback_to_pyobject(traceback_t *traceback, _Py_hashtable_t *intern_table)
1108 frames = _Py_hashtable_get(intern_table, (const void *)traceback);
1115 frames = PyTuple_New(traceback->nframe);
1119 for (int i=0; i < traceback->nframe; i++) {
1120 PyObject *frame = frame_to_pyobject(&traceback->frames[i]);
1129 if (_Py_hashtable_set(intern_table, traceback, frames) < 0) {
1166 obj = traceback_to_pyobject(trace->traceback, intern_tracebacks);
1173 obj = PyLong_FromUnsignedLong(trace->traceback->total_nframe);
1331 Return a list of (size: int, traceback: tuple) tuples.
1332 traceback is a tuple of (filename: str, lineno: int) tuples.
1353 /* the traceback hash table is used temporarily to intern traceback tuple
1441 return trace->traceback;
1452 Get the traceback where the Python object obj was allocated.
1465 traceback_t *traceback;
1475 traceback = tracemalloc_get_traceback(DEFAULT_DOMAIN, (uintptr_t)ptr);
1476 if (traceback == NULL)
1479 return traceback_to_pyobject(traceback, NULL);
1495 /* Dump the traceback where a memory block was allocated into file descriptor
1500 traceback_t *traceback;
1505 "allocation traceback\n\n");
1509 traceback = tracemalloc_get_traceback(DEFAULT_DOMAIN, (uintptr_t)ptr);
1510 if (traceback == NULL)
1514 for (i=0; i < traceback->nframe; i++) {
1515 _PyMem_DumpFrame(fd, &traceback->frames[i]);
1532 Also set the maximum number of frames stored in the traceback of a
1567 Get the maximum number of frames stored in the traceback of a trace.
1773 with the current Python traceback.
1801 /* update the traceback of the memory block */
1802 traceback_t *traceback = traceback_new();
1803 if (traceback != NULL) {
1804 trace->traceback = traceback;
1818 traceback_t *traceback;
1820 traceback = tracemalloc_get_traceback(domain, ptr);
1821 if (traceback == NULL)
1824 return traceback_to_pyobject(traceback, NULL);