From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755759AbbKCSdP (ORCPT ); Tue, 3 Nov 2015 13:33:15 -0500 Received: from mail.kernel.org ([198.145.29.136]:55660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753996AbbKCSdO (ORCPT ); Tue, 3 Nov 2015 13:33:14 -0500 Date: Tue, 3 Nov 2015 15:33:10 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: Jiri Olsa , lkml , David Ahern , Ingo Molnar , Namhyung Kim , Peter Zijlstra , Mohit Agrawal Subject: Re: [PATCH] perf sched latency: Fix removed thread issue Message-ID: <20151103183310.GU21609@kernel.org> References: <1446462625-15807-1-git-send-email-jolsa@kernel.org> <20151102225353.GC21609@kernel.org> <20151103074148.GC23878@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151103074148.GC23878@krava.brq.redhat.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). Anyway, I'm downloading that perf.data file to try to debug this here. - Arnaldo > paragraph might be a little misleading sorry ;-) > > 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