Em Fri, May 29, 2015 at 04:33:30PM +0300, Adrian Hunter escreveu:
The thread-stack represents a thread's current stack. When
a thread exits there can still be many functions on the stack
e.g. exit() can be called many levels deep, so all the callers
will never return. To get that information output, the
thread-stack must be flushed.
Previously it was assumed the thread-stack would be flushed
when the struct thread was deleted. With thread ref-counting
it is no longer clear when that will be, if ever. So instead
It'll be when the last reference to that thread is released.
- Arnaldo
explicitly flush all the thread-stacks at the end of a session.
If after the session ends you have no more need for those thread stacks,
that is the right way to do it.
With tools like 'report', after the session ends we should have all the
unreferenced threads deleted.
Previously they were not being deleted at all, i.e. they were simply
moved to the dead_threads list and sat there because I didn't knew if
some hist_entry, say, had a pointer to it.
So, unless I am missing something, this patch is required irrespective
of thread refcounting, no?
I'm applying it to my work branch where I'm trying to test all this.