linux-stable/tools/perf
Arnaldo Carvalho de Melo 2b7fcbc5a9 perf sched: Use perf_evsel__{int,str}val
This patch also stops reading the common fields, as they were not being used except
for one ->common_pid case that was replaced by sample->tid, i.e. the info is already
in the perf_sample struct.

Also it only fills the _event structures when there is a handler.

  [root@sandy ~]# perf sched record sleep 30s
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 8.585 MB perf.data (~375063 samples) ]

Before:

  [root@sandy ~]# perf stat -r 10 perf sched lat > /dev/null

   Performance counter stats for 'perf sched lat' (10 runs):

          129.117838 task-clock                #    0.994 CPUs utilized            ( +-  0.28% )
                  14 context-switches          #    0.111 K/sec                    ( +-  2.10% )
                   0 cpu-migrations            #    0.002 K/sec                    ( +- 66.67% )
               7,654 page-faults               #    0.059 M/sec                    ( +-  0.67% )
         438,121,661 cycles                    #    3.393 GHz                      ( +-  0.06% ) [83.06%]
         150,808,605 stalled-cycles-frontend   #   34.42% frontend cycles idle     ( +-  0.14% ) [83.10%]
          80,748,941 stalled-cycles-backend    #   18.43% backend  cycles idle     ( +-  0.64% ) [66.73%]
         758,605,879 instructions              #    1.73  insns per cycle
                                               #    0.20  stalled cycles per insn  ( +-  0.08% ) [83.54%]
         162,164,321 branches                  # 1255.940 M/sec                    ( +-  0.10% ) [83.70%]
           1,609,903 branch-misses             #    0.99% of all branches          ( +-  0.08% ) [83.62%]

         0.129949153 seconds time elapsed                                          ( +-  0.28% )

After:

  [root@sandy ~]# perf stat -r 10 perf sched lat > /dev/null

   Performance counter stats for 'perf sched lat' (10 runs):

          103.592215 task-clock                #    0.993 CPUs utilized            ( +-  0.33% )
                  12 context-switches          #    0.114 K/sec                    ( +-  3.29% )
                   0 cpu-migrations            #    0.000 K/sec
               7,605 page-faults               #    0.073 M/sec                    ( +-  0.00% )
         345,796,112 cycles                    #    3.338 GHz                      ( +-  0.07% ) [82.90%]
         106,876,796 stalled-cycles-frontend   #   30.91% frontend cycles idle     ( +-  0.38% ) [83.23%]
          62,060,877 stalled-cycles-backend    #   17.95% backend  cycles idle     ( +-  0.80% ) [67.14%]
         628,246,586 instructions              #    1.82  insns per cycle
                                               #    0.17  stalled cycles per insn  ( +-  0.04% ) [83.64%]
         134,962,057 branches                  # 1302.820 M/sec                    ( +-  0.10% ) [83.64%]
           1,233,037 branch-misses             #    0.91% of all branches          ( +-  0.29% ) [83.41%]

         0.104333272 seconds time elapsed                                          ( +-  0.33% )

  [root@sandy ~]#

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-weu9t63zkrfrazkn0gxj48xy@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-09-11 19:33:51 -03:00
..
arch perf tools: Support for DWARF CFI unwinding on post processing 2012-08-11 15:06:56 -03:00
bench perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
config perf tools: add NO_BACKTRACE for application self-debugging 2012-09-07 22:12:30 -03:00
Documentation perf diff: Make diff command work with evsel hists 2012-09-07 21:44:02 -03:00
python perf python: Use attr.watermark in twatch.py 2012-01-30 18:38:23 -02:00
scripts perf script python: Correct handler check and spelling errors 2012-08-09 13:26:19 -03:00
ui perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
util perf evsel: Introduce perf_evsel__{str,int}val methods 2012-09-11 19:24:23 -03:00
.gitignore perf tools: Ignore compiled python binaries 2012-09-07 12:10:58 -03:00
bash_completion perf tools: Support for events bash completion 2012-08-09 15:59:26 -03:00
builtin-annotate.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-bench.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-buildid-cache.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-buildid-list.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-diff.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-evlist.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-help.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-inject.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-kmem.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-kvm.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-list.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-lock.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-probe.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-record.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-report.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-sched.c perf sched: Use perf_evsel__{int,str}val 2012-09-11 19:33:51 -03:00
builtin-script.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-stat.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-test.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-timechart.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-top.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin.h
command-list.txt perf symbols: Support minimal build without libelf 2012-08-09 16:26:38 -03:00
CREDITS
design.txt perf tools: Update ioctl documentation for PERF_IOC_FLAG_GROUP 2012-05-31 11:38:42 -03:00
Makefile perf tools: Back [vdso] DSO with real data 2012-09-11 12:08:30 -03:00
MANIFEST perf tools: Add missing perf_regs.h file to MANIFEST 2012-09-11 11:42:41 -03:00
perf-archive.sh perf archive: Correct cutting of symbolic link 2012-04-14 13:52:15 -03:00
perf.c perf tools: include missing pthread.h header 2012-09-07 22:08:09 -03:00
perf.h perf tools: Support for DWARF mode callchain 2012-08-11 15:07:18 -03:00