linux/tools/perf
Hitoshi Mitake e4cef1f650 perf lock: Fix state machine to recognize lock sequence
Previous state machine of perf lock was really broken.
This patch improves it a little.

This patch prepares the list of state machine that represents
lock sequences for each threads.

These state machines can be one of these sequences:

      1) acquire -> acquired -> release
      2) acquire -> contended -> acquired -> release
      3) acquire (w/ try) -> release
      4) acquire (w/ read) -> release

The case of 4) is a little special.
Double acquire of read lock is allowed, so the state machine
counts read lock number, and permits double acquire and release.

But, things are not so simple. Something in my model is still wrong.
I counted the number of lock instances with bad sequence,
and ratio is like this (case of tracing whoami): bad:233, total:2279

version 2:
 * threads are now identified with tid, not pid
 * prepared SEQ_STATE_READ_ACQUIRED for read lock.
 * bunch of struct lock_seq_stat is now linked list
 * debug information enhanced (this have to be removed someday)
   e.g.
     | === output for debug===
     |
     | bad:233, total:2279
     | bad rate:0.000000
     | histogram of events caused bad sequence
     |     acquire: 165
     |    acquired: 0
     |   contended: 0
     |     release: 68

Signed-off-by: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Cc: Ingo Molnar <mingo@elte.hu>
LKML-Reference: <1271852634-9351-1-git-send-email-mitake@dcl.info.waseda.ac.jp>
[rename SEQ_STATE_UNINITED to SEQ_STATE_UNINITIALIZED]
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
2010-04-24 03:23:14 +02:00
..
Documentation perf: 'perf kvm' tool for monitoring guest performance from host 2010-04-19 12:37:24 +03:00
arch perf probe: Add PowerPC DWARF register number mappings 2010-04-22 13:48:31 +10:00
bench perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() 2010-04-14 11:26:44 +02:00
scripts perf trace/scripting: Enable scripting shell scripts for live mode 2010-04-14 11:56:08 +02:00
util perf: Move arch specific code into separate arch directory 2010-04-22 13:48:31 +10:00
.gitignore perf: Ignore perf-archive temp file 2010-01-29 10:37:33 +01:00
CREDITS perf_counter tools: Add CREDITS file for Git contributors 2009-06-24 19:54:29 +02:00
Makefile perf: Move arch specific code into separate arch directory 2010-04-22 13:48:31 +10:00
builtin-annotate.c perf: 'perf kvm' tool for monitoring guest performance from host 2010-04-19 12:37:24 +03:00
builtin-bench.c perf bench: Add "all" pseudo subsystem and "all" pseudo suite 2009-12-14 08:51:19 +01:00
builtin-buildid-cache.c perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() 2010-04-14 11:26:44 +02:00
builtin-buildid-list.c perf: 'perf kvm' tool for monitoring guest performance from host 2010-04-19 12:37:24 +03:00
builtin-diff.c perf: 'perf kvm' tool for monitoring guest performance from host 2010-04-19 12:37:24 +03:00
builtin-help.c perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() 2010-04-14 11:26:44 +02:00
builtin-kmem.c perf: 'perf kvm' tool for monitoring guest performance from host 2010-04-19 12:37:24 +03:00
builtin-kvm.c perf: 'perf kvm' tool for monitoring guest performance from host 2010-04-19 12:37:24 +03:00
builtin-list.c perf list: Fix large list output by using the pager 2009-08-13 09:05:48 +02:00
builtin-lock.c perf lock: Fix state machine to recognize lock sequence 2010-04-24 03:23:14 +02:00
builtin-probe.c perf probe: Fix to use correct debugfs path finder 2010-04-14 17:41:06 -03:00
builtin-record.c perf: 'perf kvm' tool for monitoring guest performance from host 2010-04-19 12:37:24 +03:00
builtin-report.c perf: 'perf kvm' tool for monitoring guest performance from host 2010-04-19 12:37:24 +03:00
builtin-sched.c perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() 2010-04-14 11:26:44 +02:00
builtin-stat.c perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() 2010-04-14 11:26:44 +02:00
builtin-timechart.c perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() 2010-04-14 11:26:44 +02:00
builtin-top.c perf: 'perf kvm' tool for monitoring guest performance from host 2010-04-19 12:37:24 +03:00
builtin-trace.c perf trace: Invoke live mode automatically if record/report not specified 2010-04-14 11:56:09 +02:00
builtin.h perf: 'perf kvm' tool for monitoring guest performance from host 2010-04-19 12:37:24 +03:00
command-list.txt perf: 'perf kvm' tool for monitoring guest performance from host 2010-04-19 12:37:24 +03:00
design.txt perf: Fix few typos + cosmetics 2010-01-13 17:39:44 +01:00
perf-archive.sh perf archive: Explain how to use the generated tarball 2010-03-23 20:33:08 +01:00
perf.c perf: 'perf kvm' tool for monitoring guest performance from host 2010-04-19 12:37:24 +03:00
perf.h perf: 'perf kvm' tool for monitoring guest performance from host 2010-04-19 12:37:24 +03:00