Skip to content

RFC perf: timehist command

David Ahern lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4perf: move setup_list from symbol.c to strlist.ctools/perf/util/strlist.c tools/perf/util/strlist.h tools/perf/util/symbol.c+17 -140 replies
2/4perf: add methods for setting/retrieving priv element of thread structtools/perf/util/thread.h+10 -00 replies
3/4perf: sample after exit loses thread correlationtools/perf/builtin-inject.c tools/perf/builtin-kmem.c tools/perf/builtin-kvm.c +12 more+87 -390 replies
4/4perf: add timehist commandtools/perf/Makefile tools/perf/builtin-timehist.c tools/perf/builtin.h +4 more+1296 -03 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/4] perf: timehist command

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(-)
Signature · 1 line
1.7.10.1