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

From: Arnaldo Carvalho de Melo
Date: Thu Aug 08 2013 - 17:23:34 EST


Em Thu, Aug 08, 2013 at 04:42:33PM -0400, David Ahern escreveu:
> 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?

I thought about that, at first looked like overengineering and wasting
some bytes, as we don't have an user for that now, all we need is a
single bit (or bool) just after ->comm_set :-)

If we ever have a use for knowing when the thread exited, no problem in
adding it then.

- Arnaldo
--
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/