Re: [PATCH 01/19] perf: sample after exit loses thread correlation- v3

From: David Ahern
Date: Thu Aug 08 2013 - 16:42:40 EST


On 8/8/13 10:53 AM, Arnaldo Carvalho de Melo wrote:
Em Wed, Aug 07, 2013 at 10:50:43PM -0400, David Ahern escreveu:
Occassionally events (e.g., context-switch, sched tracepoints) are losing
the conversion of sample data associated with a thread. For example:

Humm, if we have a tool that traverses the list of threads in a machine
it will not know, after one of them exits, about it being dead, so I
think this needs to add a thread->dead, no?

As of now, from what I can remember, the closest to such a tool would
be:

perf top --sort pid

But that uses hist_entries that would eventually be decayed as samples
would cease to be taken at most a few moments after the EXIT event.

But at least for debugging purposes, machine__fprintf() would list dead
threads as being present, i.e. alive till its pid gets reused.

This is the only, minor, problem that I see with this solution, what do
you think?

I can add the exit timestamp to the thread struct. non-0 means it has died. Ok with that as an indicator?

David

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/