linux-stable/tools/perf/Documentation
Jiri Olsa 0ce2da1483 perf stat: Display user and system time
Adding the support to read rusage data once the workload is finished and
display the system/user time values:

  $ perf stat --null perf bench sched pipe
  ...

   Performance counter stats for 'perf bench sched pipe':

       5.342599256 seconds time elapsed

       2.544434000 seconds user
       4.549691000 seconds sys

It works only in non -r mode and only for workload target.

So as of now, for workload targets, we display 3 types of timings. The
time we meassure in perf stat from enable to disable+period:

       5.342599256 seconds time elapsed

The time spent in user and system lands, displayed only for workload
session/target:

       2.544434000 seconds user
       4.549691000 seconds sys

Those times are the very same displayed by 'time' tool.  They are
returned by wait4 call via the getrusage struct interface.

Committer notes:

Had to rename some variables to avoid this on older systems such as
centos:6:

  builtin-stat.c: In function 'print_footer':
  builtin-stat.c:1831: warning: declaration of 'stime' shadows a global declaration
  /usr/include/time.h:297: warning: shadowed declaration is here

Committer testing:

  # perf stat --null time perf bench sched pipe
  # Running 'sched/pipe' benchmark:
  # Executed 1000000 pipe operations between two processes

       Total time: 5.526 [sec]

         5.526534 usecs/op
           180945 ops/sec
  1.00user 6.25system 0:05.52elapsed 131%CPU (0avgtext+0avgdata 8056maxresident)k
  0inputs+0outputs (0major+606minor)pagefaults 0swaps

   Performance counter stats for 'time perf bench sched pipe':

         5.530978744 seconds time elapsed

         1.004037000 seconds user
         6.259937000 seconds sys

  #

Suggested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180605121313.31337-1-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-06-06 12:52:04 -03:00
..
android.txt
asciidoc.conf
asciidoctor-extensions.rb perf Documentation: Support for asciidoctor 2018-04-26 13:47:10 -03:00
Build.txt
callchain-overhead-calculation.txt
examples.txt
intel-bts.txt
intel-pt.txt perf intel-pt: Fix syntax in documentation of config option 2017-09-01 14:45:59 -03:00
itrace.txt perf auxtrace: Add itrace option to output power events 2017-06-27 12:09:58 -03:00
jit-interface.txt
jitdump-specification.txt perf jit: Add jitdump format specification document 2016-10-24 11:07:41 -03:00
Makefile perf Documentation: Support for asciidoctor 2018-04-26 13:47:10 -03:00
manpage-1.72.xsl
manpage-base.xsl
manpage-bold-literal.xsl
manpage-normal.xsl
manpage-suppress-sp.xsl
perf-annotate.txt perf annotate: Introduce --ignore-vmlinux command line option 2018-03-21 12:53:42 -03:00
perf-archive.txt
perf-bench.txt
perf-buildid-cache.txt perf buildid-cache: Support --purge-all option 2018-04-26 09:30:26 -03:00
perf-buildid-list.txt
perf-c2c.txt perf c2c record: Record physical addresses in samples 2018-03-16 13:52:57 -03:00
perf-config.txt perf annotate: Allow setting the offset level in .perfconfig 2018-04-13 10:00:05 -03:00
perf-data.txt perf tools: Correct title markers for asciidoctor 2018-03-07 10:26:32 -03:00
perf-diff.txt perf diff: Add -q/--quiet option 2017-02-20 11:47:08 -03:00
perf-evlist.txt perf evlist: Document missing --force option 2017-11-16 14:50:07 -03:00
perf-ftrace.txt perf tools: Correct title markers for asciidoctor 2018-03-07 10:26:32 -03:00
perf-help.txt
perf-inject.txt perf inject: Document missing options 2017-11-16 14:50:05 -03:00
perf-kallsyms.txt perf tools: Correct title markers for asciidoctor 2018-03-07 10:26:32 -03:00
perf-kmem.txt perf kmem: Document a missing option & an argument 2018-02-16 14:55:42 -03:00
perf-kvm.txt
perf-list.txt perf record: Enable arbitrary event names thru name= modifier 2018-06-06 12:52:04 -03:00
perf-lock.txt perf lock: Document missing options 2017-11-16 14:50:04 -03:00
perf-mem.txt perf mem: Document incorrect and missing options 2018-04-23 11:59:18 -03:00
perf-probe.txt perf probe: Support escaped character in parser 2017-12-27 12:15:55 -03:00
perf-record.txt perf record: Enable arbitrary event names thru name= modifier 2018-06-06 12:52:04 -03:00
perf-report.txt perf tools: Add a "dso_size" sort order 2018-04-02 07:57:37 -03:00
perf-sched.txt perf sched: Fix documentation for timehist 2018-04-12 10:33:36 -03:00
perf-script-perl.txt perf tools: Correct title markers for asciidoctor 2018-03-07 10:26:32 -03:00
perf-script-python.txt perf script python: Remove dups in documentation examples 2017-06-07 20:36:12 -03:00
perf-script.txt perf script: Extend misc field decoding with switch out event type 2018-04-17 09:47:39 -03:00
perf-stat.txt perf stat: Display user and system time 2018-06-06 12:52:04 -03:00
perf-test.txt
perf-timechart.txt perf timechart: Document missing --force option 2017-11-16 14:50:06 -03:00
perf-top.txt perf top: Document --ignore-vmlinux 2018-03-19 13:51:52 -03:00
perf-trace.txt perf trace: Show only failing syscalls 2018-04-02 07:57:37 -03:00
perf-version.txt perf version: Add man page 2018-04-02 13:52:23 -03:00
perf.data-file-format.txt perf tools: Fix perf.data format description of NRCPUS header 2018-05-30 15:40:26 -03:00
perf.txt
perfconfig.example
tips.txt perf c2c: Add a tip about cacheline events 2017-12-05 15:43:55 -03:00