linux-stable/tools/perf
Hagen Paul Pfeifer 69f48c7040 perf script: Add min, max to futex-contention output, in addition to avg
Average is quite informative, but the outliners - especially max - are
also of interest.

Before:

  mutex-locker[793299] lock 5637ec61e080 contended 3400 times, 446 avg ns
  mutex-locker[793301] lock 5637ec61e080 contended 3563 times, 385 avg ns
  mutex-locker[793300] lock 5637ec61e080 contended 3110 times, 1855 avg ns

After:

  mutex-locker[795251] lock 55b14e6dd080 contended 3853 times, 1279 avg ns [max: 12270 ns, min 340 ns]
  mutex-locker[795253] lock 55b14e6dd080 contended 2911 times, 518 avg ns [max: 51660261 ns, min 347 ns]
  mutex-locker[795252] lock 55b14e6dd080 contended 3843 times, 385 avg ns [max: 24323998 ns, min 338 ns]

Committer testing:

  [root@five ~]# perf script record futex-contention -a
  ^C[ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 1.877 MB perf.data (923 samples) ]

  [root@five ~]# perf evlist
  syscalls:sys_enter_futex
  syscalls:sys_exit_futex
  dummy:HG
  # Tip: use 'perf evlist --trace-fields' to show fields for tracepoint events
  #

Before:

  [root@five ~]# perf script report futex-contention
  JS Helper[2457] lock 55fe0cf82610 contended 4 times, 6657 avg ns
  ibus-daemon[2975] lock 56227f6d0210 contended 4 times, 1020 avg ns
  chromium-browse[1905801] lock 7ffe573f5088 contended 8 times, 108463 avg ns
  gnome-shell[2240] lock 55fe0cf82678 contended 1 times, 8616 avg ns
  gnome-shel:cs0[2292] lock 55fe0d0ab768 contended 3 times, 606016034 avg ns
  JS Helper[2458] lock 55fe0cf82690 contended 1 times, 1167840 avg ns
  chromium-browse[1905470] lock 7ffe573f5358 contended 1 times, 551504 avg ns
  chromium-browse[1905948] lock 7ffe573f5358 contended 1 times, 577422 avg ns
  gnome-shell[2240] lock 55fe0cf82660 contended 6 times, 202696 avg ns
  pool[2602] lock 7fd600008ef0 contended 1 times, 500046007 avg ns
  chromium-browse[1905801] lock 7ffe573f5128 contended 4 times, 285083 avg ns
  JS Helper[2460] lock 55fe0cf82690 contended 1 times, 680877 avg ns
  JS Helper[2459] lock 55fe0cf82610 contended 7 times, 4224 avg ns
  chromium-browse[1905434] lock 7ffe573f5358 contended 1 times, 697038 avg ns
  chromium-browse[212592] lock 7ffe573f53c8 contended 4 times, 460601 avg ns
  gnome-shel:cs0[2292] lock 55fe0d0ab76c contended 2 times, 601237648 avg ns
  JS Helper[2460] lock 55fe0cf82610 contended 4 times, 3340 avg ns
  JS Helper[2462] lock 55fe0cf82694 contended 1 times, 237275 avg ns
  chromium-browse[1905605] lock 7ffe573f5358 contended 2 times, 634555 avg ns
  chromium-browse[1905992] lock 7ffe573f5358 contended 1 times, 583965 avg ns
  chromium-browse[1905647] lock 7ffe573f5368 contended 8 times, 549800 avg ns
  JS Helper[2462] lock 55fe0cf82610 contended 2 times, 4694 avg ns
  JS Helper[2461] lock 55fe0cf82694 contended 1 times, 257793 avg ns
  JS Helper[2456] lock 55fe0cf82690 contended 1 times, 677771 avg ns
  JS Helper[2463] lock 55fe0cf82610 contended 3 times, 5139 avg ns
  gdbus[2980] lock 56227f6d0210 contended 2 times, 2465 avg ns
  gnome-shell[2240] lock 55fe0cf82664 contended 5 times, 8036 avg ns
  chromium-browse[1906308] lock 7ffe573f5358 contended 1 times, 210735 avg ns
  JS Helper[2463] lock 55fe0cf82694 contended 1 times, 251531 avg ns
  chromium-browse[1905801] lock 7ffe573f4f58 contended 4 times, 399927 avg ns
  [root@five ~]#

After:

  [root@five ~]# perf script report futex-contention
  JS Helper[2457] lock 55fe0cf82610 contended 4 times, 6657 avg ns [max: 11502 ns, min 792 ns]
  ibus-daemon[2975] lock 56227f6d0210 contended 4 times, 1020 avg ns [max: 1813 ns, min 581 ns]
  chromium-browse[1905801] lock 7ffe573f5088 contended 8 times, 108463 avg ns [max: 380103 ns, min 57989 ns]
  gnome-shell[2240] lock 55fe0cf82678 contended 1 times, 8616 avg ns [max: 8616 ns, min 8616 ns]
  gnome-shel:cs0[2292] lock 55fe0d0ab768 contended 3 times, 606016034 avg ns [max: 611295960 ns, min 600191357 ns]
  JS Helper[2458] lock 55fe0cf82690 contended 1 times, 1167840 avg ns [max: 1167840 ns, min 1167840 ns]
  chromium-browse[1905470] lock 7ffe573f5358 contended 1 times, 551504 avg ns [max: 551504 ns, min 551504 ns]
  chromium-browse[1905948] lock 7ffe573f5358 contended 1 times, 577422 avg ns [max: 577422 ns, min 577422 ns]
  gnome-shell[2240] lock 55fe0cf82660 contended 6 times, 202696 avg ns [max: 398998 ns, min 5050 ns]
  pool[2602] lock 7fd600008ef0 contended 1 times, 500046007 avg ns [max: 500046007 ns, min 500046007 ns]
  chromium-browse[1905801] lock 7ffe573f5128 contended 4 times, 285083 avg ns [max: 389531 ns, min 76183 ns]
  JS Helper[2460] lock 55fe0cf82690 contended 1 times, 680877 avg ns [max: 680877 ns, min 680877 ns]
  JS Helper[2459] lock 55fe0cf82610 contended 7 times, 4224 avg ns [max: 12724 ns, min 1012 ns]
  chromium-browse[1905434] lock 7ffe573f5358 contended 1 times, 697038 avg ns [max: 697038 ns, min 697038 ns]
  chromium-browse[212592] lock 7ffe573f53c8 contended 4 times, 460601 avg ns [max: 594956 ns, min 232996 ns]
  gnome-shel:cs0[2292] lock 55fe0d0ab76c contended 2 times, 601237648 avg ns [max: 601255863 ns, min 601219434 ns]
  JS Helper[2460] lock 55fe0cf82610 contended 4 times, 3340 avg ns [max: 9168 ns, min 962 ns]
  JS Helper[2462] lock 55fe0cf82694 contended 1 times, 237275 avg ns [max: 237275 ns, min 237275 ns]
  chromium-browse[1905605] lock 7ffe573f5358 contended 2 times, 634555 avg ns [max: 1024060 ns, min 245050 ns]
  chromium-browse[1905992] lock 7ffe573f5358 contended 1 times, 583965 avg ns [max: 583965 ns, min 583965 ns]
  chromium-browse[1905647] lock 7ffe573f5368 contended 8 times, 549800 avg ns [max: 775293 ns, min 258375 ns]
  JS Helper[2462] lock 55fe0cf82610 contended 2 times, 4694 avg ns [max: 8556 ns, min 832 ns]
  JS Helper[2461] lock 55fe0cf82694 contended 1 times, 257793 avg ns [max: 257793 ns, min 257793 ns]
  JS Helper[2456] lock 55fe0cf82690 contended 1 times, 677771 avg ns [max: 677771 ns, min 677771 ns]
  JS Helper[2463] lock 55fe0cf82610 contended 3 times, 5139 avg ns [max: 6873 ns, min 931 ns]
  gdbus[2980] lock 56227f6d0210 contended 2 times, 2465 avg ns [max: 4188 ns, min 742 ns]
  gnome-shell[2240] lock 55fe0cf82664 contended 5 times, 8036 avg ns [max: 13105 ns, min 401 ns]
  chromium-browse[1906308] lock 7ffe573f5358 contended 1 times, 210735 avg ns [max: 210735 ns, min 210735 ns]
  JS Helper[2463] lock 55fe0cf82694 contended 1 times, 251531 avg ns [max: 251531 ns, min 251531 ns]
  chromium-browse[1905801] lock 7ffe573f4f58 contended 4 times, 399927 avg ns [max: 476904 ns, min 178495 ns]
  [root@five ~]#

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: http://lore.kernel.org/lkml/20200922200922.1306034-1-hagen@jauu.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-09-23 12:58:53 -03:00
..
arch perf tsc: Add rdtsc() for Arm64 2020-09-22 13:44:16 -03:00
bench perf bench: Fix 2 memory sanitizer warnings 2020-09-14 18:30:26 -03:00
Documentation perf docs: Improve help information in perf.txt 2020-09-17 16:03:31 -03:00
examples/bpf Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-01-28 16:02:33 -08:00
include/bpf perf bpf: Remove bpf/ subdir from bpf.h headers used to build bpf events 2020-02-18 10:13:28 -03:00
jvmti perf jvmti: Remove redundant jitdump line table entries 2020-05-29 16:51:38 -03:00
pmu-events Merge remote-tracking branch 'torvalds/master' into perf/core 2020-09-17 15:45:05 -03:00
python
scripts perf script: Add min, max to futex-contention output, in addition to avg 2020-09-23 12:58:53 -03:00
tests perf metric: Remove duplicate include 2020-09-17 15:48:49 -03:00
trace perf trace beauty: Use the autogenerated protocol family table 2020-08-12 08:43:51 -03:00
ui perf top/report: Fix infinite loop in the TUI for grouped events 2020-09-01 12:15:52 -03:00
util perf tsc: Support cap_user_time_short for event TIME_CONV 2020-09-22 13:46:40 -03:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
Build
builtin-annotate.c perf evsel: Rename perf_evsel__resort*() to evsel__resort*() 2020-05-28 10:03:24 -03:00
builtin-bench.c perf bench: Add benchmark of find_next_bit 2020-07-31 09:32:11 -03:00
builtin-buildid-cache.c
builtin-buildid-list.c
builtin-c2c.c perf evlist: Fix the class prefix for 'struct evlist' sample_type methods 2020-06-22 16:28:09 -03:00
builtin-config.c
builtin-data.c perf data: Add support to store time of day in CTF data conversion 2020-08-06 09:43:37 -03:00
builtin-diff.c perf evsel: Rename perf_evsel__is_*() to evsel__is*() 2020-05-05 16:35:31 -03:00
builtin-evlist.c perf evsel: Rename perf_evsel__fprintf() to evsel__fprintf() 2020-05-28 10:03:24 -03:00
builtin-ftrace.c perf: ftrace: Add filter support for option -F/--funcs 2020-09-04 16:11:16 -03:00
builtin-help.c
builtin-inject.c perf inject jit: Remove //anon mmap events 2020-07-08 13:51:12 -03:00
builtin-kallsyms.c
builtin-kmem.c perf kmem: Pass additional arguments to 'perf record' 2020-07-10 09:37:55 -03:00
builtin-kvm.c perf evlist: Fix the class prefix for 'struct evlist' 'add' evsel methods 2020-06-22 16:28:09 -03:00
builtin-list.c perf list: Remove dead code in argument check 2020-09-09 11:12:10 -03:00
builtin-lock.c perf lock: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() 2020-05-05 16:35:31 -03:00
builtin-mem.c perf c2c: Fix 'perf c2c record -e list' to show the default events used 2020-05-28 10:03:25 -03:00
builtin-probe.c perf probe: Do not show the skipped events 2020-05-28 10:03:24 -03:00
builtin-record.c perf tools: Consolidate close_control_option()'s into one function 2020-09-04 16:11:16 -03:00
builtin-report.c perf report: Disable ordered_events for raw dump 2020-09-01 12:20:25 -03:00
builtin-sched.c perf sched timehist: Fix use of CPU list with summary option 2020-08-21 10:22:23 -03:00
builtin-script.c perf script: Display negative tid in non-sample events 2020-09-17 16:06:22 -03:00
builtin-stat.c perf stat: Skip duration_time in setup_system_wide 2020-09-23 12:58:53 -03:00
builtin-timechart.c perf tools: Replace zero-length array with flexible-array 2020-05-28 10:03:27 -03:00
builtin-top.c perf top: Skip side-band event setup if HAVE_LIBBPF_SUPPORT is not set 2020-08-21 10:22:23 -03:00
builtin-trace.c perf record: Extend -D,--delay option with -1 value 2020-08-04 08:50:04 -03:00
builtin-version.c perf tools: Make GTK2 support opt-in 2020-09-04 17:11:59 -03:00
builtin.h
check-headers.sh perf trace beauty: Use the autogenerated protocol family table 2020-08-12 08:43:51 -03:00
command-list.txt
CREDITS
design.txt perf tools: Support CAP_PERFMON capability 2020-04-16 12:19:08 -03:00
Makefile tools: Let O= makes handle a relative path with -C option 2020-03-06 17:08:28 -03:00
Makefile.config perf tools: Make GTK2 support opt-in 2020-09-04 17:11:59 -03:00
Makefile.perf perf tools: Make GTK2 support opt-in 2020-09-04 17:11:59 -03:00
MANIFEST libperf: Move to tools/lib/perf 2020-01-06 11:46:09 -03:00
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h perf tests: Call test_attr__open() directly 2020-09-10 11:55:37 -03:00
perf-with-kcore.sh
perf.c
perf.h