[issue37961] Tracemalloc traces do not include original stack trace length

2020-12-16 Thread miss-islington


miss-islington  added the comment:


New changeset 78062e07bc7c3b47ffdcdec786b259dda376370c by Miss Islington (bot) 
in branch '3.9':
bpo-37961: Fix regression in tracemalloc.Traceback.__repr__ (GH-23805)
https://github.com/python/cpython/commit/78062e07bc7c3b47ffdcdec786b259dda376370c


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37961] Tracemalloc traces do not include original stack trace length

2020-12-16 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +22670
pull_request: https://github.com/python/cpython/pull/23809

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37961] Tracemalloc traces do not include original stack trace length

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 051b9818671625d125dee8198e0d2af5ad4c85b8 by Daniel Hahler in 
branch 'master':
bpo-37961: Fix regression in tracemalloc.Traceback.__repr__ (GH-23805)
https://github.com/python/cpython/commit/051b9818671625d125dee8198e0d2af5ad4c85b8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37961] Tracemalloc traces do not include original stack trace length

2020-12-16 Thread daniel hahler


Change by daniel hahler :


--
nosy: +blueyed
nosy_count: 2.0 -> 3.0
pull_requests: +22665
pull_request: https://github.com/python/cpython/pull/23805

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37961] Tracemalloc traces do not include original stack trace length

2019-10-15 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for your contribution Julien, I merged your PR.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37961] Tracemalloc traces do not include original stack trace length

2019-10-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8d59eb1b66c51b2b918da9881c57d07d08df43b7 by Victor Stinner 
(Julien Danjou) in branch 'master':
bpo-37961, tracemalloc: add Traceback.total_nframe (GH-15545)
https://github.com/python/cpython/commit/8d59eb1b66c51b2b918da9881c57d07d08df43b7


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37961] Tracemalloc traces do not include original stack trace length

2019-08-30 Thread STINNER Victor


STINNER Victor  added the comment:

With the following change, traceback_t size changes from 24 bytes to 32 bytes:

diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
index ee32ac29b7..8a820db907 100644
--- a/Modules/_tracemalloc.c
+++ b/Modules/_tracemalloc.c
@@ -79,6 +79,7 @@ __attribute__((packed))
 typedef struct {
 Py_uhash_t hash;
 int nframe;
+int length;
 frame_t frames[1];
 } traceback_t;
 
@@ -1640,6 +1641,8 @@ PyInit__tracemalloc(void)
 if (tracemalloc_init() < 0)
 return NULL;
 
+printf("sizeof(traceback_t) = %zu bytes\n", sizeof(traceback_t));
+
 return m;
 }


The following structure size is 24 bytes, so no change:

typedef struct {
Py_uhash_t hash;
short nframe;
short length;
frame_t frames[1];
} traceback_t;

The short approach is promising :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37961] Tracemalloc traces do not include original stack trace length

2019-08-30 Thread Julien Danjou


Julien Danjou  added the comment:

> In fact, I didn't check: maybe traceback_t size is not change by your PR, 
> because of memory aligment and padding.

It is changed. The current size is should be determined by sizeof(Py_uhash_t + 
int + int) which is 4 + 4 + 4, so 12 aligned/padded.

Using a short will add 2 bytes and potentially some space for 2 more bytes in 
the future. :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37961] Tracemalloc traces do not include original stack trace length

2019-08-30 Thread STINNER Victor


STINNER Victor  added the comment:

I'm fine with limiting MAX_NFRAME to USHRT_MAX and change traceback_t.nframe 
type to unsigned short (16 bits). Storing 65536 should be way enough. It would 
be great if you manage to add your new field without making traceback_t larger.

In fact, I didn't check: maybe traceback_t size is not change by your PR, 
because of memory aligment and padding.

By the way, first I taught that your modified trace_t: no, you modified 
traceback_t. _tracemalloc ensures that a traceback_t instance is allocated 
exactly once in the heap memory, to reduce the memory footprint. So making 
traceback_t larger should impact less the memory than making trace_t larger.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37961] Tracemalloc traces do not include original stack trace length

2019-08-29 Thread Julien Danjou


Julien Danjou  added the comment:

That's a good question. Considering that Py_DEFAULT_RECURSION_LIMIT is 1000, we 
could probably settle on 2 bytes by using an uint16_t which ought to be enough 
unless people regularly trace Python stack traces bigger that are bigger than 
2^16.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37961] Tracemalloc traces do not include original stack trace length

2019-08-29 Thread STINNER Victor


STINNER Victor  added the comment:

> However, if the number of frames is truncated, there's no way to know the 
> original length of the stack traces.

PR 15545 makes each trace 4 bytes (sizeof int) larger. Would it be enough for 
you to only know if the traceback is truncated?

tracemalloc is already "memory heavy", so I don't think that making trace_t 
larger is a blocker issue :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37961] Tracemalloc traces do not include original stack trace length

2019-08-27 Thread Julien Danjou


Change by Julien Danjou :


--
keywords: +patch
pull_requests: +15222
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15545

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37961] Tracemalloc traces do not include original stack trace length

2019-08-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37961] Tracemalloc traces do not include original stack trace length

2019-08-27 Thread Julien Danjou


New submission from Julien Danjou :

When using the tracemalloc module, the maximum number of frames that are 
captured is specified at startup via a value to the `start` method.

However, if the number of frames is truncated, there's no way to know the 
original length of the stack traces.

--
components: Interpreter Core
messages: 350616
nosy: jd
priority: normal
severity: normal
status: open
title: Tracemalloc traces do not include original stack trace length
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com