public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: acme@ghostprotocols.net, linux-kernel@vger.kernel.org
Cc: mingo@kernel.org, peterz@infradead.org, fweisbec@gmail.com,
	jolsa@redhat.com, namhyung@kernel.org, eranian@google.com,
	David Ahern <dsahern@gmail.com>
Subject: [RFC PATCH 0/4] perf: timehist command
Date: Fri,  7 Jun 2013 16:22:10 -0600	[thread overview]
Message-ID: <1370643734-9579-1-git-send-email-dsahern@gmail.com> (raw)

I have commented a few times over the years about a perf-based command
that does a time history analysis of task scheduling. Internal to the
product I work on it has been extremely helpful debugging systems with
heavy CPU contention - understanding which tasks are consuming cpu cycles
over a given time window; when, why and how long a task was off the CPU
and how much time did the task get when it was scheduled; inefficiencies
from process bombs (shell scripts); and more.

This is the first exported version of that command. It contains the
basic features. It is also availabe at:
    https://github.com/dsahern/linux/commits/timehist-basic-3.9

We rely on the version that also provides time-of-day correlations.
e.g., task X raised an alarm at time Y due to lack of access to a
CPU. Take time Y from the log file and correlate with perf data to
gain some insights into what was happening before, during and after
the time of interest. The time-of-day version can be found here:
    https://github.com/dsahern/linux/commits/timehist-timeofday-3.9

The command currently uses the context-switch event -- for legacy reasons
with the kernel version we use. The command needs to be updated to
leverage the many scheduling tracepoints and with it updating the data
that can be generated from the analysis. Until then throwing it out for
comments and in case others find it useful.

David Ahern (4):
  perf: move setup_list from symbol.c to strlist.c
  perf: add methods for setting/retrieving priv element of thread struct
  perf: sample after exit loses thread correlation
  perf: add timehist command

 tools/perf/Makefile           |    2 ++
 tools/perf/builtin-inject.c   |    2 +-
 tools/perf/builtin-kmem.c     |    3 ++-
 tools/perf/builtin-kvm.c      |    3 ++-
 tools/perf/builtin-lock.c     |    3 ++-
 tools/perf/builtin-sched.c    |   17 +++++++-------
 tools/perf/builtin-script.c   |    3 ++-
 tools/perf/builtin-trace.c    |    9 +++++---
 tools/perf/builtin.h          |    1 +
 tools/perf/perf.c             |    1 +
 tools/perf/perf.h             |    6 +++++
 tools/perf/tests/hists_link.c |    2 +-
 tools/perf/util/build-id.c    |   11 ++++-----
 tools/perf/util/event.c       |   11 +++++++--
 tools/perf/util/machine.c     |   49 ++++++++++++++++++++++++++++++++---------
 tools/perf/util/machine.h     |    6 +++--
 tools/perf/util/session.c     |    2 +-
 tools/perf/util/strlist.c     |   15 +++++++++++++
 tools/perf/util/strlist.h     |    2 ++
 tools/perf/util/symbol.c      |   14 ------------
 tools/perf/util/thread.h      |   12 +++++++++-
 21 files changed, 121 insertions(+), 53 deletions(-)

-- 
1.7.10.1


             reply	other threads:[~2013-06-07 22:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-07 22:22 David Ahern [this message]
2013-06-07 22:22 ` [RFC PATCH 1/4] perf: move setup_list from symbol.c to strlist.c David Ahern
2013-06-07 22:22 ` [RFC PATCH 2/4] perf: add methods for setting/retrieving priv element of thread struct David Ahern
2013-07-19  7:43   ` [tip:perf/core] perf tools: Add methods for setting/ retrieving " tip-bot for David Ahern
2013-06-07 22:22 ` [PATCH 3/4] perf: sample after exit loses thread correlation David Ahern
2013-06-07 22:22 ` [RFC PATCH 4/4] perf: add timehist command David Ahern
2013-06-20 10:46   ` Ingo Molnar
2013-06-20 15:00     ` David Ahern
2013-06-20 15:26       ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1370643734-9579-1-git-send-email-dsahern@gmail.com \
    --to=dsahern@gmail.com \
    --cc=acme@ghostprotocols.net \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox