linux-stable/tools/perf
Zhengjun Xing 9a0b36266f perf stat: Add topdown metrics in the default perf stat on the hybrid machine
Topdown metrics are missed in the default perf stat on the hybrid machine,
add Topdown metrics in default perf stat for hybrid systems.

Currently, we support the perf metrics Topdown for the p-core PMU in the
perf stat default, the perf metrics Topdown support for e-core PMU will be
implemented later separately. Refactor the code adds two x86 specific
functions. Widen the size of the event name column by 7 chars, so that all
metrics after the "#" become aligned again.

The perf metrics topdown feature is supported on the cpu_core of ADL. The
dedicated perf metrics counter and the fixed counter 3 are used for the
topdown events. Adding the topdown metrics doesn't trigger multiplexing.

Before:

 # ./perf  stat  -a true

 Performance counter stats for 'system wide':

             53.70 msec cpu-clock                 #   25.736 CPUs utilized
                80      context-switches          #    1.490 K/sec
                24      cpu-migrations            #  446.951 /sec
                52      page-faults               #  968.394 /sec
         2,788,555      cpu_core/cycles/          #   51.931 M/sec
           851,129      cpu_atom/cycles/          #   15.851 M/sec
         2,974,030      cpu_core/instructions/    #   55.385 M/sec
           416,919      cpu_atom/instructions/    #    7.764 M/sec
           586,136      cpu_core/branches/        #   10.916 M/sec
            79,872      cpu_atom/branches/        #    1.487 M/sec
            14,220      cpu_core/branch-misses/   #  264.819 K/sec
             7,691      cpu_atom/branch-misses/   #  143.229 K/sec

       0.002086438 seconds time elapsed

After:

 # ./perf stat  -a true

 Performance counter stats for 'system wide':

             61.39 msec cpu-clock                        #   24.874 CPUs utilized
                76      context-switches                 #    1.238 K/sec
                24      cpu-migrations                   #  390.968 /sec
                52      page-faults                      #  847.097 /sec
         2,753,695      cpu_core/cycles/                 #   44.859 M/sec
           903,899      cpu_atom/cycles/                 #   14.725 M/sec
         2,927,529      cpu_core/instructions/           #   47.690 M/sec
           428,498      cpu_atom/instructions/           #    6.980 M/sec
           581,299      cpu_core/branches/               #    9.470 M/sec
            83,409      cpu_atom/branches/               #    1.359 M/sec
            13,641      cpu_core/branch-misses/          #  222.216 K/sec
             8,008      cpu_atom/branch-misses/          #  130.453 K/sec
        14,761,308      cpu_core/slots/                  #  240.466 M/sec
         3,288,625      cpu_core/topdown-retiring/       #     22.3% retiring
         1,323,323      cpu_core/topdown-bad-spec/       #      9.0% bad speculation
         5,477,470      cpu_core/topdown-fe-bound/       #     37.1% frontend bound
         4,679,199      cpu_core/topdown-be-bound/       #     31.7% backend bound
           646,194      cpu_core/topdown-heavy-ops/      #      4.4% heavy operations       #     17.9% light operations
         1,244,999      cpu_core/topdown-br-mispredict/  #      8.4% branch mispredict      #      0.5% machine clears
         3,891,800      cpu_core/topdown-fetch-lat/      #     26.4% fetch latency          #     10.7% fetch bandwidth
         1,879,034      cpu_core/topdown-mem-bound/      #     12.7% memory bound           #     19.0% Core bound

       0.002467839 seconds time elapsed

Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Acked-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220721065706.2886112-6-zhengjun.xing@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2022-07-29 13:43:34 -03:00
..
arch perf stat: Add topdown metrics in the default perf stat on the hybrid machine 2022-07-29 13:43:34 -03:00
bench Merge remote-tracking branch 'torvalds/master' into perf/core 2022-05-23 09:32:49 -03:00
dlfilters
Documentation perf kwork: Implement BPF trace 2022-07-26 16:31:54 -03:00
examples/bpf
include perf dlfilter: Add machine_pid and vcpu 2022-07-20 11:08:13 -03:00
jvmti
pmu-events perf vendor events arm64: Arm Cortex-A78C and X1C 2022-07-28 16:13:01 -03:00
python perf python: Convert tracepoint.py example to python3 2022-04-01 16:19:35 -03:00
scripts perf python: Ignore unused command line arguments when building with clang 2022-07-20 15:14:39 -03:00
tests perf test: Fix test case 95 ("Check branch stack sampling") on s390 and use same event 2022-07-29 10:31:06 -03:00
trace perf trace beauty: Fix generation of errno id->str table on ALT Linux 2022-06-26 12:32:55 -03:00
ui
util perf stat: Add topdown metrics in the default perf stat on the hybrid machine 2022-07-29 13:43:34 -03:00
.gitignore perf tools: Delete perf-with-kcore.sh script 2022-04-27 20:11:26 -03:00
Build perf kwork: New tool to trace time properties of kernel work (such as softirq, and workqueue) 2022-07-26 16:01:24 -03:00
builtin-annotate.c perf gtk: Only support --gtk if compiled in 2022-07-20 11:09:11 -03:00
builtin-bench.c perf bench: Add breakpoint benchmarks 2022-05-13 11:00:38 -03:00
builtin-buildid-cache.c
builtin-buildid-list.c perf buildid-list: Add a "-m" option to show kernel and modules build-ids 2022-07-18 16:35:34 -03:00
builtin-c2c.c perf c2c: Fix sorting in percent_rmt_hitm_cmp() 2022-06-03 21:40:15 +02: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 inject: Fix spelling mistake "theads" -> "threads" 2022-07-26 16:31:54 -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 kvm report: Add guest_code support 2022-05-23 10:19:15 -03:00
builtin-kwork.c perf kwork: Implement BPF trace 2022-07-26 16:31:54 -03:00
builtin-list.c
builtin-lock.c perf lock: Support -t option for 'contention' subcommand 2022-07-25 17:58:42 -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 record: Add finished init event 2022-06-23 11:54:22 -03:00
builtin-report.c perf gtk: Only support --gtk if compiled in 2022-07-20 11:09:11 -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: Add machine_pid and vcpu 2022-07-20 11:08:13 -03:00
builtin-stat.c perf stat: Add topdown metrics in the default perf stat on the hybrid machine 2022-07-29 13:43:34 -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 perf trace: Fix SIGSEGV when processing syscall args 2022-07-17 10:59:52 -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 perf kwork: New tool to trace time properties of kernel work (such as softirq, and workqueue) 2022-07-26 16:01:24 -03:00
check-headers.sh tools arm64: Import cputype.h 2022-03-26 10:53:45 -03:00
command-list.txt perf kwork: New tool to trace time properties of kernel work (such as softirq, and workqueue) 2022-07-26 16:01:24 -03:00
CREDITS
design.txt
Makefile
Makefile.config perf build: Avoid defining _FORTIFY_SOURCE multiple times 2022-07-20 13:21:45 -03:00
Makefile.perf perf kwork: Implement BPF trace 2022-07-26 16:31:54 -03:00
MANIFEST
perf-archive.sh
perf-completion.sh
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf.c perf kwork: New tool to trace time properties of kernel work (such as softirq, and workqueue) 2022-07-26 16:01:24 -03:00
perf.h