Re: [PATCH 2/2] perf sched timehist: Fix invalid runtime in the idle hist

Arnaldo Carvalho de Melo
2016-12-13T13:12:27Z

Em Tue, Dec 13, 2016 at 07:54:42PM +0900, Namhyung Kim escreveu:
> 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..

Ok, fixed up, after building it, before 'rebase --continue', we get:

time cpu task name wait time sch delay run time
[tid/pid] (msec) (msec) (msec)
--------------- ------ -------------------- --------- --------- ---------
47548.582141 [0000] perf[17869] 0.000 0.000 0.000
47548.583814 [0003] rcu_sched[7] 0.000 0.000 0.000
47548.583825 [0003] <idle> 0.005 0.000 0.010
47548.583826 [0002] rcuos/0[9] 0.000 0.000 0.000
47548.583828 [0003] rcu_sched[7] 0.000 0.000 0.000
47548.587797 [0003] <idle> 0.002 0.000 3.969
47548.587799 [0003] rcu_sched[7] 0.000 0.000 0.000
47548.587799 [0002] <idle> 0.011 0.000 3.973
47548.587808 [0002] rcuos/0[9] 0.000 0.000 0.000
47548.594979 [0002] <idle> 0.008 0.000 7.171
47548.595014 [0002] Timer[4869/4832] 0.000 0.000 0.000
47548.595064 [0001] firefox[4832] 0.000 0.000 0.000
47548.603831 [0002] <idle> 0.034 0.000 8.817
47548.603874 [0001] <idle> 0.054 0.000 8.809

Which matches what you state as being the fix (task runtime after idle task).

git rebase --continue next...

- Arnaldo