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


Groups > linux.kernel > #1521807

[PATCHSET 0/7] perf sched: Introduce timehist command, again (v1)

From Namhyung Kim <namhyung@kernel.org>
Newsgroups linux.kernel
Subject [PATCHSET 0/7] perf sched: Introduce timehist command, again (v1)
Date 2016-11-14 17:20 +0100
Message-ID <sDs9b-RG-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Hello,

This patchset is a rebased version of David's sched timehist work [1].
I plan to improve perf sched command more and think that having
timehist command before the work looks good.  It seems David is busy
these days, so I'm retrying it by myself.

This implements only basic feature and a few options.  I just split
the patch to make it easier to review and did some cosmetic changes.
More patches will come later.

The below is from the David's original description:

------------------------8<-------------------------
'perf sched timehist' provides an analysis of scheduling events.

Example usage:
    perf sched record -- sleep 1
    perf sched timehist

By default it shows the individual schedule events, including the time between
sched-in events for the task, the task scheduling delay (time between wakeup
and actually running) and run time for the task:

           time cpu  task name[tid/pid]    b/n time sch delay  run time
  ------------- ---- -------------------- --------- --------- ---------
   79371.874569 [11] gcc[31949]               0.014     0.000     1.148
   79371.874591 [10] gcc[31951]               0.000     0.000     0.024
   79371.874603 [10] migration/10[59]         3.350     0.004     0.011
   79371.874604 [11] <idle>                   1.148     0.000     0.035
   79371.874723 [05] <idle>                   0.016     0.000     1.383
   79371.874746 [05] gcc[31949]               0.153     0.078     0.022
...

Times are in msec.usec.

If callchains were recorded they are appended to the line with a default stack depth of 5:

   79371.874569 [11] gcc[31949]                  0.000014  0.000000  0.001148  wait_for_completion_killable do_fork sys_vfork stub_vfork __vfork
   79371.874591 [10] gcc[31951]                  0.000000  0.000000  0.000024  __cond_resched _cond_resched wait_for_completion stop_one_cpu sched_exec
   79371.874603 [10] migration/10[59]            0.003350  0.000004  0.000011  smpboot_thread_fn kthread ret_from_fork
   79371.874604 [11] <idle>                      0.001148  0.000000  0.000035  cpu_startup_entry start_secondary
   79371.874723 [05] <idle>                      0.000016  0.000000  0.001383  cpu_startup_entry start_secondary
   79371.874746 [05] gcc[31949]                  0.000153  0.000078  0.000022  do_wait sys_wait4 system_call_fastpath __GI___waitpid

--no-call-graph can be used to not show the callchains. --max-stack is used
to control the number of frames shown (default of 5). -x/--excl options can
be used to collapse redundant callchains to get more relevant data on screen.

Similar to perf-trace -s and -S can be used to dump a statistical summary
without or with events (respectively). Statistics include min run time,
average run time and max run time. Stats are also shown for run time by
cpu.

The cpu-visual option provides a visual aid for sched switches by cpu:
...
   79371.874569 [11]            s      gcc[31949]                  0.000014  0.000000  0.001148
   79371.874591 [10]           s       gcc[31951]                  0.000000  0.000000  0.000024
   79371.874603 [10]           s       migration/10[59]            0.003350  0.000004  0.000011
   79371.874604 [11]            i      <idle>                      0.001148  0.000000  0.000035
   79371.874723 [05]      i            <idle>                      0.000016  0.000000  0.001383
   79371.874746 [05]      s            gcc[31949]                  0.000153  0.000078  0.000022
...

------------------------8<-------------------------

This code is available at 'perf/timehist-v1' branch in my tree

  git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git

Any feedback is welcomed, David?

Thanks,
Namhyung


[1] https://lkml.org/lkml/2013/12/1/129

David Ahern (6):
  perf sched timehist: Introduce timehist command
  perf sched timehist: Add summary options
  perf sched timehist: Add -w/--wakeups option
  perf sched timehist: Add call graph options
  perf sched timehist: Add -V/--cpu-visual option
  perf sched: Add documentation for timehist options

Namhyung Kim (1):
  perf symbol: Print symbol offsets conditionally

 tools/perf/Documentation/perf-sched.txt |  46 +-
 tools/perf/builtin-sched.c              | 912 +++++++++++++++++++++++++++++++-
 tools/perf/util/evsel_fprintf.c         |   6 +-
 tools/perf/util/symbol.h                |   3 +-
 tools/perf/util/symbol_fprintf.c        |  11 +-
 5 files changed, 963 insertions(+), 15 deletions(-)

-- 
2.10.1

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


Thread

[PATCHSET 0/7] perf sched: Introduce timehist command, again (v1) Namhyung Kim <namhyung@kernel.org> - 2016-11-14 17:20 +0100
  [PATCH 4/7] perf sched timehist: Add -w/--wakeups option Namhyung Kim <namhyung@kernel.org> - 2016-11-14 17:20 +0100
  [PATCH 5/7] perf sched timehist: Add call graph options Namhyung Kim <namhyung@kernel.org> - 2016-11-14 17:20 +0100
  [PATCH 6/7] perf sched timehist: Add -V/--cpu-visual option Namhyung Kim <namhyung@kernel.org> - 2016-11-14 17:20 +0100
  [PATCH 3/7] perf sched timehist: Add summary options Namhyung Kim <namhyung@kernel.org> - 2016-11-14 17:20 +0100
  [PATCH 7/7] perf sched: Add documentation for timehist options Namhyung Kim <namhyung@kernel.org> - 2016-11-14 17:30 +0100
  Re: [PATCHSET 0/7] perf sched: Introduce timehist command, again (v1) David Ahern <dsahern@gmail.com> - 2016-11-14 17:30 +0100
  [PATCH RESEND 1/7] perf symbol: Print symbol offsets conditionally Namhyung Kim <namhyung@kernel.org> - 2016-11-14 17:40 +0100
  Re: [PATCHSET 0/7] perf sched: Introduce timehist command, again (v1) Ingo Molnar <mingo@kernel.org> - 2016-11-15 07:50 +0100
    Re: [PATCHSET 0/7] perf sched: Introduce timehist command, again (v1) Namhyung Kim <namhyung@kernel.org> - 2016-11-15 08:00 +0100
      Re: [PATCHSET 0/7] perf sched: Introduce timehist command, again (v1) Ingo Molnar <mingo@kernel.org> - 2016-11-15 08:40 +0100
        Re: [PATCHSET 0/7] perf sched: Introduce timehist command, again (v1) David Ahern <dsahern@gmail.com> - 2016-11-15 16:20 +0100
          Re: [PATCHSET 0/7] perf sched: Introduce timehist command, again (v1) Namhyung Kim <namhyung@kernel.org> - 2016-11-15 16:40 +0100
            Re: [PATCHSET 0/7] perf sched: Introduce timehist command, again (v1) David Ahern <dsahern@gmail.com> - 2016-11-15 19:30 +0100

csiph-web