From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932575AbcLMK4C (ORCPT ); Tue, 13 Dec 2016 05:56:02 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:33203 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932229AbcLMKz6 (ORCPT ); Tue, 13 Dec 2016 05:55:58 -0500 Date: Tue, 13 Dec 2016 19:54:42 +0900 From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern , Andi Kleen , Minchan Kim Subject: Re: [PATCH 2/2] perf sched timehist: Fix invalid runtime in the idle hist Message-ID: <20161213105442.GB20050@danjae.aot.lge.com> References: <20161213080632.19099-1-namhyung@kernel.org> <20161213080632.19099-2-namhyung@kernel.org> <20161213103236.GH5482@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161213103236.GH5482@kernel.org> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 13, 2016 at 07:32:36AM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, Dec 13, 2016 at 05:06:32PM +0900, Namhyung Kim escreveu: > > When --idle-hist option is used, run/wait time and sched delay value > > should be shown for idle task only. But due to internal accounting, a > > last thread has same value of next idle task's and it was shown. > > > > In the below example, firefox after idle task has same run time of > > idle task's. > > Same as last message, is this something I can fold into a patch yet in > my perf/core branch? Yep, Fixes: 78de3657008b ("perf sched timehist: Add -I/--idle-hist option") I guess it makes a conflict on the callchain code. In case it doesn't look obvious to resolve, please let me know.. Thanks, Namhyung > > - Arnaldo > > > $ perf sched timehist --idle-hist > > Samples do not have callchains. > > time cpu task name wait time sch delay run time > > [tid/pid] (msec) (msec) (msec) > > --------------- ------ -------------------- --------- --------- --------- > > 197731.754335 [0002] firefox[17773/17739] 0.000 0.000 0.000 > > 197731.754486 [0001] sleep[27470] 0.000 0.000 0.000 > > 197731.754903 [0002] 0.047 0.000 0.567 > > 197731.754981 [0002] firefox[17773/17739] 0.000 0.000 0.567 > > 197731.755922 [0002] 0.078 0.000 0.941 > > 197731.755994 [0002] firefox[17773/17739] 0.000 0.000 0.941 > > > > > > Signed-off-by: Namhyung Kim > > --- > > tools/perf/builtin-sched.c | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > > > diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c > > index 405a91d0515f..64a0959bccd7 100644 > > --- a/tools/perf/builtin-sched.c > > +++ b/tools/perf/builtin-sched.c > > @@ -2439,6 +2439,15 @@ static int timehist_sched_change_event(struct perf_tool *tool, > > goto out; > > > > timehist_update_runtime_stats(last_tr, t, tprev); > > + /* > > + * remove delta time of last thread as it's not updated > > + * and otherwise it will show an invalid value next > > + * time. we only care total run time and run stat. > > + */ > > + last_tr->dt_run = 0; > > + last_tr->dt_wait = 0; > > + last_tr->dt_delay = 0; > > + > > if (itr->cursor.nr) > > callchain_append(&itr->callchain, &itr->cursor, > > t - tprev); > > -- > > 2.10.2