Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1262102

Re: [PATCH] perf sched latency: Fix removed thread issue

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] perf sched latency: Fix removed thread issue
Date 2015-11-04 08:40 +0100
Message-ID <qr0PM-5Ti-17@gated-at.bofh.it> (permalink)
References <qqljA-4Eg-3@gated-at.bofh.it> <qqwf0-2M7-17@gated-at.bofh.it> <qqEvU-8a2-17@gated-at.bofh.it> <qqOEV-6rP-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Nov 03, 2015 at 03:33:10PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Nov 03, 2015 at 08:41:48AM +0100, Jiri Olsa escreveu:
> > On Mon, Nov 02, 2015 at 07:53:53PM -0300, Arnaldo Carvalho de Melo wrote:
> > > Em Mon, Nov 02, 2015 at 12:10:25PM +0100, Jiri Olsa escreveu:
> > > > If machine's thread gets excited (EXIT event is received),
> > > > we set thread->dead = true and it is later on removed from
> > > > machine's tree if the pid is reused on new thread.
> > > 
> > > > The latency subcommand holds tree of working atoms sorted
> > > > by thread's pid/tid. If there's new thread with same pid
> > > 
> > > Humm, wher is the latency subcommand handling the EXIT event?
> > > 
> > > I see:
> > > 
> > >    perf_sched__lat
> > >      perf_sched__read_events
> > >        session = perf_session__new(&file, false, &sched->tool);
> > >        perf_session__process_events(session)
> > > 
> > > And sched->tool->exit() is not set, which will make
> > > perf_session__process_events(), when calling perf_tool__fill_defaults()
> > > set it to process_event_stub() which will do nothing for
> > > PERF_RECORD_EXIT events, no?
> > 
> > yep, latency command does not handle EXIT event, but the
> > thread is removed via FORK event.. the first changelog
> 
> So its not related to processing an EXIT event as described in the
> changelog, ok. And I don't see where is that thread->dead is set, i.e.
> the sequence is:
> 
>   machine__process_fork_event()
>     machine__remove_thread()
> 
> The only place where thread->dead is set to true is in thread__exited()
> and that is only called by machine__process_exit_event(), which is never
> called by 'perf sched'.
> 
> It is not "later removed from machine's tree", it is removed straight
> away, in __machine__remove_thread().

it is removed later via FORK event, as stated in changelog
and in updated changelog I sent in previous email:

SNIP

> > could you please change it to:
> > 
> > ---
> > If machine's thread gets excited (EXIT event is received),
> > we set thread->dead = true and it is later on removed from
> > machine's tree if the pid is reused on new thread.
> > 
> > We dont handle EXIT command in 'perf sched latency',
> > however the old thread is removed anyway when FORK
> > event is received for new thrad with same pid/tid.
> > ---

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] perf sched latency: Fix removed thread issue Jiri Olsa <jolsa@kernel.org> - 2015-11-02 12:20 +0100
  Re: [PATCH] perf sched latency: Fix removed thread issue Namhyung Kim <namhyung@kernel.org> - 2015-11-02 23:30 +0100
    Re: [PATCH] perf sched latency: Fix removed thread issue Jiri Olsa <jolsa@redhat.com> - 2015-11-03 09:20 +0100
  Re: [PATCH] perf sched latency: Fix removed thread issue Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-11-03 00:00 +0100
    Re: [PATCH] perf sched latency: Fix removed thread issue Jiri Olsa <jolsa@redhat.com> - 2015-11-03 08:50 +0100
      Re: [PATCH] perf sched latency: Fix removed thread issue Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-11-03 19:40 +0100
        Re: [PATCH] perf sched latency: Fix removed thread issue Jiri Olsa <jolsa@redhat.com> - 2015-11-04 08:40 +0100
  [tip:perf/urgent] perf sched latency: Fix thread pid reuse issue tip-bot for Jiri Olsa <tipbot@zytor.com> - 2015-11-08 08:40 +0100

csiph-web