lkml.org 
[lkml]   [2009]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH][RFC] Adding information of counts processes acquired how many spinlocks to schedstat
From
From: Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH][RFC] Adding information of counts processes acquired how many spinlocks to schedstat
Date: Wed, 1 Jul 2009 09:31:39 +0200

>
> * Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> wrote:
>
> > Hi,
> >
> > I wrote a test patch which add information of counts processes
> > acquired how many spinlocks to schedstat. After applied this
> > patch, /proc/<PID>/sched will change like this,
> >
> > init (1, #threads: 1)
> > ---------------------------------------------------------
> > se.exec_start : 482130.851458
> > se.vruntime : 26883.107980
> > se.sum_exec_runtime : 2316.651816
> > se.avg_overlap : 0.480053
> > se.avg_wakeup : 14.999993
> > ....
> > se.nr_wakeups_passive : 1
> > se.nr_wakeups_idle : 0
> > se.nr_acquired_spinlock : 74483
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Looks potentially useful - but it would be nice and go one step
> further and add lock acquire stats as a software-counter.
>
> Perfcounters is a feature of the latest upstream kernel, there's a
> (still very small) Wiki page about it at:
>
> http://perf.wiki.kernel.org
>

Thanks for your information.
I've never heard about this. This is a useful software for me.

> Now, it would be nice to have a lock-acquire software-counter as
> well, which would output things like:
>
> $ perf stat -a -e lock-acquires sleep 1
>
> Performance counter stats for 'sleep 1':
>
> 294387 lock-acquires
>
> 1.022318527 seconds time elapsed
>
> Furthermore, beyond plain counts, doing this would also allow the
> profiling of lock acquire places: perf record -e lock-acquires and
> perf report would work fine.
>
> It is really easy to add a new sw counter, check how it is done for
> the pagefault counter(s), see the uses of PERF_COUNT_SW_PAGE_FAULTS
> in the following files:
>
> $ git grep -l PERF_COUNT_SW_PAGE_FAULTS
>
> arch/powerpc/mm/fault.c
> arch/x86/mm/fault.c
> include/linux/perf_counter.h
> kernel/perf_counter.c
> tools/perf/builtin-stat.c
> tools/perf/design.txt
>
> Would you be interested in having a look at this?

Of course, I want to do this!
If I got progress, I'll send a patch to you.


\
 
 \ /
  Last update: 2009-07-01 10:25    [W:0.106 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site