linux-stable/tools/perf
Namhyung Kim 79d9333b85 perf lock: Do not discard broken lock stats
Currently it discards a lock_stat for a lock instance when there's a
broken lock_seq_stat in a single task for the lock.  But it also means
that the existing (and later) valid lock stat info for that lock will
be discarded as well.

This is not ideal since we can lose many valuable info because of a
single failure.  Actually those failures are indepent to the existing
stat.  So we can only discard the broken lock_seq_stat but keep the
valid lock_stat.

The discarded lock_seq_stat will be reallocated in a subsequent event
with SEQ_STATE_UNINITIALIZED which will be ignored until it see the
start of the next sequence.  So it should be ok just free it.

Before:

  $ perf lock report -F acquired,contended,avg_wait

  Warning:
  Processed 1401603 events and lost 18 chunks!

  Check IO/CPU overload!

                  Name   acquired  contended   avg wait (ns)

         rcu_read_lock     251225          0               0
   &(ei->i_block_re...       8731          0               0
   &sb->s_type->i_l...       8731          0               0
    hrtimer_bases.lock       5261          0               0
    hrtimer_bases.lock       2626          0               0
    hrtimer_bases.lock       1953          0               0
    hrtimer_bases.lock       1382          0               0
      cpu_hotplug_lock       1350          0               0
    hrtimer_bases.lock       1273          0               0
    hrtimer_bases.lock       1269          0               0
    hrtimer_bases.lock       1198          0               0
   ...

New:
                  Name   acquired  contended   avg wait (ns)

         rcu_read_lock     251225          0               0
   tk_core.seq.seqc...      54074          0               0
          &xa->xa_lock      17470          0               0
        &ei->i_es_lock      17464          0               0
       &ei->i_raw_lock       9391          0               0
   &mapping->privat...       8734          0               0
       &ei->i_data_sem       8731          0               0
   &(ei->i_block_re...       8731          0               0
   &sb->s_type->i_l...       8731          0               0
   jiffies_seq.seqc...       6953          0               0
        &mm->mmap_lock       6889          0               0
             balancing       5768          0               0
    hrtimer_bases.lock       5261          0               0
   ...

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220521010811.932703-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2022-05-23 09:47:41 -03:00
..
arch Merge remote-tracking branch 'torvalds/master' into perf/core 2022-05-23 09:32:49 -03:00
bench Merge remote-tracking branch 'torvalds/master' into perf/core 2022-05-23 09:32:49 -03:00
dlfilters perf dlfilter: Drop unused variable 2021-12-16 12:18:11 -03:00
Documentation perf c2c: Update documentation for store metric 'N/A' 2022-05-23 09:36:47 -03:00
examples/bpf
include
jvmti
pmu-events perf vendor events intel: Update CLX events to v1.15 2022-05-04 12:52:04 -03:00
python perf python: Convert tracepoint.py example to python3 2022-04-01 16:19:35 -03:00
scripts perf scripts python: intel-pt-events.py: Print ptwrite value as a string if it is ASCII 2022-05-17 11:56:15 -03:00
tests Merge remote-tracking branch 'torvalds/master' into perf/core 2022-05-23 09:32:49 -03:00
trace perf beauty: Update copy of linux/socket.h with the kernel sources 2022-04-01 16:19:34 -03:00
ui perf annotate: Avoid TUI crash when navigating in the annotation of recursive functions 2022-01-10 15:47:30 -03:00
util perf mem: Add stats for store operation with no available memory level 2022-05-23 09:36:12 -03:00
.gitignore perf tools: Delete perf-with-kcore.sh script 2022-04-27 20:11:26 -03:00
Build
builtin-annotate.c perf annotate: Add --percent-limit option 2022-05-10 14:37:55 -03:00
builtin-bench.c perf bench: Add breakpoint benchmarks 2022-05-13 11:00:38 -03:00
builtin-buildid-cache.c perf record: Disable debuginfod by default 2022-01-15 17:41:25 -03:00
builtin-buildid-list.c
builtin-c2c.c perf c2c: Add dimensions for 'N/A' metrics of store operation 2022-05-23 09:36:34 -03:00
builtin-config.c
builtin-daemon.c
builtin-data.c perf data: Don't mention --to-ctf if it's not supported 2022-02-22 21:23:08 -03:00
builtin-diff.c
builtin-evlist.c
builtin-ftrace.c perf evlist: Rename cpus to user_requested_cpus 2022-04-01 16:19:35 -03:00
builtin-help.c
builtin-inject.c perf namespaces: Add functions to access nsinfo 2022-02-11 14:31:22 -03:00
builtin-kallsyms.c
builtin-kmem.c perf tools: Enhance the matching of sub-commands abbreviations 2022-03-26 10:55:57 -03:00
builtin-kvm.c perf tools: Enhance the matching of sub-commands abbreviations 2022-03-26 10:55:57 -03:00
builtin-list.c
builtin-lock.c perf lock: Do not discard broken lock stats 2022-05-23 09:47:41 -03:00
builtin-mem.c perf tools: Enhance the matching of sub-commands abbreviations 2022-03-26 10:55:57 -03:00
builtin-probe.c perf namespaces: Add functions to access nsinfo 2022-02-11 14:31:22 -03:00
builtin-record.c perf cpumap: Switch to using perf_cpu_map API 2022-05-05 14:07:27 -03:00
builtin-report.c perf report: Set PERF_SAMPLE_DATA_SRC bit for Arm SPE event 2022-04-22 18:39:34 -03:00
builtin-sched.c perf tools: Enhance the matching of sub-commands abbreviations 2022-03-26 10:55:57 -03:00
builtin-script.c perf script: Print Intel ptwrite value as a string if it is ASCII 2022-05-17 11:56:02 -03:00
builtin-stat.c perf stat: Always keep perf metrics topdown events in a group 2022-05-20 11:11:13 -03:00
builtin-timechart.c perf tools: Enhance the matching of sub-commands abbreviations 2022-03-26 10:55:57 -03:00
builtin-top.c perf evlist: Rename cpus to user_requested_cpus 2022-04-01 16:19:35 -03:00
builtin-trace.c Merge remote-tracking branch 'torvalds/master' into perf/core 2022-02-17 18:40:54 -03:00
builtin-version.c perf version: Add HAVE_DEBUGINFOD_SUPPORT to built-in features 2022-04-20 13:32:09 -03:00
builtin.h
check-headers.sh tools arm64: Import cputype.h 2022-03-26 10:53:45 -03:00
command-list.txt
CREDITS
design.txt perf design.txt: Synchronize the definition of enum perf_hw_id with code 2021-11-13 18:11:50 -03:00
Makefile
Makefile.config perf build: Error for BPF skeletons without LIBBPF 2022-05-23 09:33:39 -03:00
Makefile.perf perf tools: Delete perf-with-kcore.sh script 2022-04-27 20:11:26 -03:00
MANIFEST
perf-archive.sh
perf-completion.sh
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf.c perf tools: Add external commands to list-cmds 2022-04-09 14:21:00 -03:00
perf.h