Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Jan 20, 2022
  2. Jan 18, 2022
  3. Jan 15, 2022
  4. Jan 14, 2022
    • Yang Zhong's avatar
      selftest: kvm: Add amx selftest · bf70636d
      Yang Zhong authored
      
      This selftest covers two aspects of AMX.  The first is triggering #NM
      exception and checking the MSR XFD_ERR value.  The second case is
      loading tile config and tile data into guest registers and trapping to
      the host side for a complete save/load of the guest state.  TMM0
      is also checked against memory data after save/restore.
      
      Signed-off-by: default avatarYang Zhong <yang.zhong@intel.com>
      Message-Id: <20211223145322.2914028-4-yang.zhong@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      bf70636d
    • Yang Zhong's avatar
      selftest: kvm: Move struct kvm_x86_state to header · 6559b4a5
      Yang Zhong authored
      
      Those changes can avoid dereferencing pointer compile issue
      when amx_test.c reference state->xsave.
      
      Move struct kvm_x86_state definition to processor.h.
      
      Signed-off-by: default avatarYang Zhong <yang.zhong@intel.com>
      Message-Id: <20211223145322.2914028-3-yang.zhong@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      6559b4a5
    • Paolo Bonzini's avatar
      selftest: kvm: Reorder vcpu_load_state steps for AMX · 551447cf
      Paolo Bonzini authored
      
      For AMX support it is recommended to load XCR0 after XFD, so
      that KVM does not see XFD=0, XCR=1 for a save state that will
      eventually be disabled (which would lead to premature allocation
      of the space required for that save state).
      
      It is also required to load XSAVE data after XCR0 and XFD, so
      that KVM can trigger allocation of the extra space required to
      store AMX state.
      
      Adjust vcpu_load_state to obey these new requirements.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarYang Zhong <yang.zhong@intel.com>
      Message-Id: <20211223145322.2914028-2-yang.zhong@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      551447cf
    • Wei Wang's avatar
      kvm: selftests: Add support for KVM_CAP_XSAVE2 · 415a3c33
      Wei Wang authored
      
      When KVM_CAP_XSAVE2 is supported, userspace is expected to allocate
      buffer for KVM_GET_XSAVE2 and KVM_SET_XSAVE using the size returned
      by KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2).
      
      Signed-off-by: default avatarWei Wang <wei.w.wang@intel.com>
      Signed-off-by: default avatarGuang Zeng <guang.zeng@intel.com>
      Signed-off-by: default avatarJing Liu <jing2.liu@intel.com>
      Signed-off-by: default avatarYang Zhong <yang.zhong@intel.com>
      Message-Id: <20220105123532.12586-20-yang.zhong@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      415a3c33
    • Thomas Richter's avatar
      perf cputopo: Fix CPU topology reading on s/390 · a6e62743
      Thomas Richter authored
      Commit fdf1e29b ("perf expr: Add metric literals for topology.")
      fails on s390:
      
       # ./perf test -Fv 7
         ...
       # FAILED tests/expr.c:173 #num_dies >= #num_packages
         ---- end ----
         Simple expression parser: FAILED!
       #
      
      Investigating this issue leads to these functions:
       build_cpu_topology()
         +--> has_die_topology(void)
              {
                 struct utsname uts;
      
                 if (uname(&uts) < 0)
                        return false;
                 if (strncmp(uts.machine, "x86_64", 6))
                        return false;
                 ....
              }
      
      which always returns false on s390. The caller build_cpu_topology()
      checks has_die_topology() return value. On false the
      the struct cpu_topology::die_cpu_list is not contructed and has zero
      entries. This leads to the failing comparison: #num_dies >= #num_packages.
      s390 of course has a positive number of packages.
      
      Fix this by adding s390 architecture to support CPU die list.
      
      Output after:
       # ./perf test -Fv 7
        7: Simple expression parser                                        :
        --- start ---
        division by zero
        syntax error
        ---- end ----
        Simple expression parser: Ok
       #
      
      Fixes: fdf1e29b
      
       ("perf expr: Add metric literals for topology.")
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Sven Schnelle <svens@linux.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Link: https://lore.kernel.org/r/20211124090343.9436-1-tmricht@linux.ibm.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a6e62743
    • José Expósito's avatar
      perf metricgroup: Fix use after free in metric__new() · e000ea0b
      José Expósito authored
      We shouldn't free() something that will be used in the next line, fix
      it.
      
      Fixes: b85a4d61
      
       ("perf metric: Allow modifiers on metrics")
      Addresses-Coverity-ID: 1494000
      Signed-off-by: default avatarJosé Expósito <jose.exposito89@gmail.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20211208171113.22089-1-jose.exposito89@gmail.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e000ea0b
    • Ian Rogers's avatar
      libperf tests: Update a use of the new cpumap API · 99fc11bb
      Ian Rogers authored
      Fixes a build breakage.
      
      Fixes: 6d18804b
      
       ("perf cpumap: Give CPUs their own type")
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: colin ian king <colin.king@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Shunsuke Nakamura <nakamura.shun@fujitsu.com>
      Link: http://lore.kernel.org/lkml/20220114065105.1806542-1-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      99fc11bb
    • Ian Rogers's avatar
      perf arm: Fix off-by-one directory path · 46f57d24
      Ian Rogers authored
      Relative path include works in the regular build due to -I paths but may
      fail in other situations.
      
      Fixes: 83869019
      
       ("perf arch: Support register names from all archs")
      Reviewed-by: default avatarGerman Gomez <german.gomez@arm.com>
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/20220114064822.1806019-1-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      46f57d24
    • Arnaldo Carvalho de Melo's avatar
      tools arch x86: Sync the msr-index.h copy with the kernel sources · e652ab64
      Arnaldo Carvalho de Melo authored
      To pick up the changes in:
      
        89aa94b4
      
       ("x86/msr: Add AMD CPPC MSR definitions")
      
      Addressing these tools/perf build warnings:
      
          diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
          Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h'
      
      That makes the beautification scripts to pick some new entries:
      
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before
        $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after
        $ diff -u before after
        --- before	2022-01-13 10:59:51.743416890 -0300
        +++ after	2022-01-13 11:00:00.776644178 -0300
        @@ -303,6 +303,11 @@
       	  [0xc0010299 - x86_AMD_V_KVM_MSRs_offset] = "AMD_RAPL_POWER_UNIT",
       	  [0xc001029a - x86_AMD_V_KVM_MSRs_offset] = "AMD_CORE_ENERGY_STATUS",
       	  [0xc001029b - x86_AMD_V_KVM_MSRs_offset] = "AMD_PKG_ENERGY_STATUS",
        +       [0xc00102b0 - x86_AMD_V_KVM_MSRs_offset] = "AMD_CPPC_CAP1",
        +       [0xc00102b1 - x86_AMD_V_KVM_MSRs_offset] = "AMD_CPPC_ENABLE",
        +       [0xc00102b2 - x86_AMD_V_KVM_MSRs_offset] = "AMD_CPPC_CAP2",
        +       [0xc00102b3 - x86_AMD_V_KVM_MSRs_offset] = "AMD_CPPC_REQ",
        +       [0xc00102b4 - x86_AMD_V_KVM_MSRs_offset] = "AMD_CPPC_STATUS",
       	  [0xc00102f0 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PPIN_CTL",
       	  [0xc00102f1 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PPIN",
         };
        $
      
      And this gets rebuilt:
      
        CC       /tmp/build/perf/trace/beauty/tracepoints/x86_msr.o
        INSTALL  trace_plugins
        LD       /tmp/build/perf/trace/beauty/tracepoints/perf-in.o
        LD       /tmp/build/perf/trace/beauty/perf-in.o
        LD       /tmp/build/perf/perf-in.o
        LINK     /tmp/build/perf/perf
      
      Now one can trace systemwide asking to see backtraces to where those
      MSRs are being read/written with:
      
        # perf trace -e msr:*_msr/max-stack=32/ --filter="msr>=AMD_CPPC_CAP1 && msr<=AMD_CPPC_STATUS"
        ^C#
      
      If we use -v (verbose mode) we can see what it does behind the scenes:
      
        # perf trace -v -e msr:*_msr/max-stack=32/ --filter="msr>=AMD_CPPC_CAP1 && msr<=AMD_CPPC_STATUS"
        <SNIP>
        New filter for msr:read_msr: (msr>=0xc00102b0 && msr<=0xc00102b4) && (common_pid != 2612102 && common_pid != 3841)
        New filter for msr:write_msr: (msr>=0xc00102b0 && msr<=0xc00102b4) && (common_pid != 2612102 && common_pid != 3841)
        <SNIP>
        ^C#
      
      Example with a frequent msr:
      
        # perf trace -v -e msr:*_msr/max-stack=32/ --filter="msr==IA32_SPEC_CTRL" --max-events 2
        Using CPUID AuthenticAMD-25-21-0
        0x48
        New filter for msr:read_msr: (msr==0x48) && (common_pid != 2612129 && common_pid != 3841)
        0x48
        New filter for msr:write_msr: (msr==0x48) && (common_pid != 2612129 && common_pid != 3841)
        mmap size 528384B
        Looking at the vmlinux_path (8 entries long)
        symsrc__init: build id mismatch for vmlinux.
        Using /proc/kcore for kernel data
        Using /proc/kallsyms for symbols
             0.000 Timer/2525383 msr:write_msr(msr: IA32_SPEC_CTRL, val: 6)
                                               do_trace_write_msr ([kernel.kallsyms])
                                               do_trace_write_msr ([kernel.kallsyms])
                                               __switch_to_xtra ([kernel.kallsyms])
                                               __switch_to ([kernel.kallsyms])
                                               __schedule ([kernel.kallsyms])
                                               schedule ([kernel.kallsyms])
                                               futex_wait_queue_me ([kernel.kallsyms])
                                               futex_wait ([kernel.kallsyms])
                                               do_futex ([kernel.kallsyms])
                                               __x64_sys_futex ([kernel.kallsyms])
                                               do_syscall_64 ([kernel.kallsyms])
                                               entry_SYSCALL_64_after_hwframe ([kernel.kallsyms])
                                               __futex_abstimed_wait_common64 (/usr/lib64/libpthread-2.33.so)
             0.030 :0/0 msr:write_msr(msr: IA32_SPEC_CTRL, val: 2)
                                               do_trace_write_msr ([kernel.kallsyms])
                                               do_trace_write_msr ([kernel.kallsyms])
                                               __switch_to_xtra ([kernel.kallsyms])
                                               __switch_to ([kernel.kallsyms])
                                               __schedule ([kernel.kallsyms])
                                               schedule_idle ([kernel.kallsyms])
                                               do_idle ([kernel.kallsyms])
                                               cpu_startup_entry ([kernel.kallsyms])
                                               secondary_startup_64_no_verify ([kernel.kallsyms])
        #
      
      Acked-by: default avatarHuang Rui <ray.huang@amd.com>
      Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/all/YeA2PAvHV+uHRhLj@kernel.org
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e652ab64
    • Li Zhijian's avatar
      kselftests/net: list all available tests in usage() · 22556341
      Li Zhijian authored
      
      So that users can run/query them easily.
      
      $ ./fcnal-test.sh -h
      usage: fcnal-test.sh OPTS
      
      	-4          IPv4 tests only
      	-6          IPv6 tests only
      	-t <test>   Test name/set to run
      	-p          Pause on fail
      	-P          Pause after each test
      	-v          Be verbose
      
      Tests:
      	ipv4_ping ipv4_tcp ipv4_udp ipv4_bind ipv4_runtime ipv4_netfilter ipv6_ping ipv6_tcp ipv6_udp ipv6_bind ipv6_runtime ipv6_netfilter use_cases
      
      Suggested-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarLi Zhijian <lizhijian@fujitsu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      22556341
  5. Jan 13, 2022
    • Daniel Bristot de Oliveira's avatar
      rtla: Add Documentation · d40d48e1
      Daniel Bristot de Oliveira authored
      Adds the basis for rtla documentation. This patch also
      includes the rtla(1) man page.
      
      As suggested by Jonathan Corbet, we are placing these man
      pages at Documentation/tools/rtla, using rst format. It
      is not linked to the official documentation, though.
      
      The Makefile is based on bpftool's Documentation one.
      
      Link: https://lkml.kernel.org/r/5f510f3e962fc0cd531c43f5a815544dd720c3f2.1639158831.git.bristot@kernel.org
      
      
      
      Cc: Tao Zhou <tao.zhou@linux.dev>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Juri Lelli <juri.lelli@redhat.com>
      Cc: Clark Williams <williams@redhat.com>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
      Cc: linux-rt-users@vger.kernel.org
      Cc: linux-trace-devel@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Suggested-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Suggested-by: default avatarJonathan Corbet <corbet@lwn.net>
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      d40d48e1
    • Daniel Bristot de Oliveira's avatar
      rtla/timerlat: Add timerlat hist mode · 1eeb6328
      Daniel Bristot de Oliveira authored
      The rtla hist hist mode displays a histogram of each tracer event
      occurrence, both for IRQ and timer latencies. The tool also allows
      many configurations of the timerlat tracer and the collection of
      the tracer output.
      
      Here is one example of the rtla timerlat hist mode output:
        ---------- %< ----------
       [root@alien ~]# rtla timerlat hist -c 0-3 -d 1M
       # RTLA timerlat histogram
       # Time unit is microseconds (us)
       # Duration:   0 00:01:00
       Index   IRQ-000   Thr-000   IRQ-001   Thr-001   IRQ-002   Thr-002   IRQ-003   Thr-003
       0         58572         0     59373         0     58691         0     58895         0
       1          1422     57021       628     57241      1310     56160      1102     56805
       2             6      2931         0      2695         0      3567         4      3031
       3             1        40         0        53         0       260         0       142
       4             0         7         0         5         0         6         0        17
       5             0         2         0         5         0         7         0         4
       6             0         0         0         2         0         1         0         1
       8             0         0         0         0         0         0         0         1
       over:         0         0         0         0         0         0         0         0
       count:    60001     60001     60001     60001     60001     60001     60001     60001
       min:          0         1         0         1         0         1         0         1
       avg:          0         1         0         1         0         1         0         1
       max:          3         5         1         6         1         6         2         8
        ---------- >% ----------
      
      Running
       - rtla timerlat hist --help
      provides information about the available options.
      
      Link: https://lkml.kernel.org/r/7049ed3c46b7d6aceab18ffe7770003dfc4ddceb.1639158831.git.bristot@kernel.org
      
      
      
      Cc: Tao Zhou <tao.zhou@linux.dev>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Juri Lelli <juri.lelli@redhat.com>
      Cc: Clark Williams <williams@redhat.com>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
      Cc: linux-rt-users@vger.kernel.org
      Cc: linux-trace-devel@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      1eeb6328
    • Daniel Bristot de Oliveira's avatar
      rtla: Add timerlat tool and timelart top mode · a828cd18
      Daniel Bristot de Oliveira authored
      The rtla timerlat tool is an interface for the timerlat tracer.
      The timerlat tracer dispatches a kernel thread per-cpu. These threads set a
      periodic timer to wake themselves up and go back to sleep. After the
      wakeup, they collect and generate useful information for the debugging of
      operating system timer latency.
      
      The timerlat tracer outputs information in two ways. It periodically
      prints the timer latency at the timer IRQ handler and the Thread handler.
      It also provides information for each noise via the osnoise tracepoints.
      
      The rtla timerlat top mode displays a summary of the periodic output from
      the timerlat tracer.
      
      Here is one example of the rtla timerlat tool output:
       ---------- %< ----------
      [root@alien ~]# rtla timerlat top -c 0-3 -d 1m
                                           Timer Latency
        0 00:01:00   |          IRQ Timer Latency (us)        |         Thread Timer Latency (us)
      CPU COUNT      |      cur       min       avg       max |      cur       min       avg       max
        0 #60001     |        0         0         0         3 |        1         1         1         6
        1 #60001     |        0         0         0         3 |        2         1         1         5
        2 #60001     |        0         0         1         6 |        1         1         2         7
        3 #60001     |        0         0         0         7 |        1         1         1        11
       ---------- >% ----------
      
      Running:
        # rtla timerlat --help
        # rtla timerlat top --help
      provides information about the available options.
      
      Link: https://lkml.kernel.org/r/e95032e20c2b88c962195bf7693bb53c9ebcced8.1639158831.git.bristot@kernel.org
      
      
      
      Cc: Tao Zhou <tao.zhou@linux.dev>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Juri Lelli <juri.lelli@redhat.com>
      Cc: Clark Williams <williams@redhat.com>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
      Cc: linux-rt-users@vger.kernel.org
      Cc: linux-trace-devel@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      a828cd18
    • Daniel Bristot de Oliveira's avatar
      rtla/osnoise: Add the hist mode · 829a6c0b
      Daniel Bristot de Oliveira authored
      The rtla osnoise hist tool collects all osnoise:sample_threshold
      occurrence in a histogram, displaying the results in a user-friendly
      way. The tool also allows many configurations of the osnoise tracer
      and the collection of the tracer output.
      
      Here is one example of the rtla osnoise hist tool output:
        ---------- %< ----------
       [root@f34 ~]# rtla osnoise hist --bucket-size 10 --entries 100 -c 0-8 -d 1M -r 9000 -P F:1
       # RTLA osnoise histogram
       # Time unit is microseconds (us)
       # Duration:   0 00:01:00
       Index   CPU-000   CPU-001   CPU-002   CPU-003   CPU-004   CPU-005   CPU-006   CPU-007   CPU-008
       0           430       434       352       455       440       463       467       436       484
       10           88        88        92       141       120       100       126       166       100
       20           19         7        12        22         8         8        13        13        16
       30            6         0         2         0         1         2         2         1         0
       50            0         0         0         0         0         0         1         0         0
       over:         0         0         0         0         0         0         0         0         0
       count:      543       529       458       618       569       573       609       616       600
       min:          0         0         0         0         0         0         0         0         0
       avg:          0         0         0         0         0         0         0         0         0
       max:         30        20        30        20        30        30        50        30        20
        ---------- >% ----------
      
      Running
       - rtla osnoise hist --help
      
      provides information about the available options.
      
      Link: https://lkml.kernel.org/r/c68060544de89b8b62510ed91c7369f162eb465b.1639158831.git.bristot@kernel.org
      
      
      
      Cc: Tao Zhou <tao.zhou@linux.dev>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Juri Lelli <juri.lelli@redhat.com>
      Cc: Clark Williams <williams@redhat.com>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
      Cc: linux-rt-users@vger.kernel.org
      Cc: linux-trace-devel@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      829a6c0b
    • Daniel Bristot de Oliveira's avatar
      rtla/osnoise: Add osnoise top mode · 1eceb2fc
      Daniel Bristot de Oliveira authored
      The rtla osnoise tool is an interface for the osnoise tracer. The
      osnoise tracer dispatches a kernel thread per-cpu. These threads read
      the time in a loop while with preemption, softirqs and IRQs enabled,
      thus allowing all the sources of osnoise during its execution. The
      osnoise threads take note of the entry and exit point of any source
      of interferences, increasing a per-cpu interference counter. The
      osnoise tracer also saves an interference counter for each source
      of interference.
      
      The rtla osnoise top mode displays information about the periodic
      summary from the osnoise tracer.
      
      One example of rtla osnoise top output is:
      
      [root@alien ~]# rtla osnoise top -c 0-3 -d 1m -q -r 900000 -P F:1
                                               Operating System Noise
      duration:   0 00:01:00 | time is in us
      CPU Period       Runtime        Noise  % CPU Aval   Max Noise   Max Single          HW          NMI          IRQ      Softirq       Thread
        0 #58         52200000         1031    99.99802          91           60           0            0        52285            0          101
        1 #59         53100000            5    99.99999           5            5           0            9        53122            0           18
        2 #59         53100000            7    99.99998           7            7           0            8        53115            0           18
        3 #59         53100000         8274    99.98441         277           23           0            9        53778            0          660
      
      "rtla osnoise top --help" works and provide information about the
      available options.
      
      Link: https://lkml.kernel.org/r/0d796993abf587ae5a170bb8415c49368d4999e1.1639158831.git.bristot@kernel.org
      
      
      
      Cc: Tao Zhou <tao.zhou@linux.dev>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Juri Lelli <juri.lelli@redhat.com>
      Cc: Clark Williams <williams@redhat.com>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
      Cc: linux-rt-users@vger.kernel.org
      Cc: linux-trace-devel@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      1eceb2fc
    • Daniel Bristot de Oliveira's avatar
      rtla: Add osnoise tool · 0605bf00
      Daniel Bristot de Oliveira authored
      The osnoise tool is the interface for the osnoise tracer. The osnoise
      tool will have multiple "modes" with different outputs. At this point,
      no mode is included.
      
      The osnoise.c includes the osnoise_context abstraction. It serves to
      read-save-change-restore the default values from tracing/osnoise/
      directory. When the context is deleted, the default values are restored.
      
      It also includes some other helper functions for managing osnoise
      tracer sessions.
      
      With these bits and pieces in place, we can start adding some
      functionality to rtla.
      
      Link: https://lkml.kernel.org/r/2d44c21ff561f503b4c7b1813892761818118460.1639158831.git.bristot@kernel.org
      
      
      
      Cc: Tao Zhou <tao.zhou@linux.dev>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Juri Lelli <juri.lelli@redhat.com>
      Cc: Clark Williams <williams@redhat.com>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
      Cc: linux-rt-users@vger.kernel.org
      Cc: linux-trace-devel@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      0605bf00
    • Daniel Bristot de Oliveira's avatar
      rtla: Helper functions for rtla · b1696371
      Daniel Bristot de Oliveira authored
      This is a set of utils and tracer helper functions. They are used by
      rtla mostly to parse config, display data and some trace operations that
      are not part of libtracefs (because they are only useful it for this
      case).
      
      Link: https://lkml.kernel.org/r/a94c128aba9e6e66d502b7094f2e8c7ac95b12e5.1639158831.git.bristot@kernel.org
      
      
      
      Cc: Tao Zhou <tao.zhou@linux.dev>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Juri Lelli <juri.lelli@redhat.com>
      Cc: Clark Williams <williams@redhat.com>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
      Cc: linux-rt-users@vger.kernel.org
      Cc: linux-trace-devel@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      b1696371
    • Daniel Bristot de Oliveira's avatar
      rtla: Real-Time Linux Analysis tool · 79ce8f43
      Daniel Bristot de Oliveira authored
      The rtla is a meta-tool that includes a set of commands that aims
      to analyze the real-time properties of Linux. But instead of testing
      Linux as a black box, rtla leverages kernel tracing capabilities to
      provide precise information about the properties and root causes of
      unexpected results.
      
      rtla --help works and provide information about the available options.
      
      This is just the "main" and the Makefile, no function yet.
      
      Link: https://lkml.kernel.org/r/bf9118ed43a09e6c054c9a491cbe7411ad1acd89.1639158831.git.bristot@kernel.org
      
      
      
      Cc: Tao Zhou <tao.zhou@linux.dev>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Juri Lelli <juri.lelli@redhat.com>
      Cc: Clark Williams <williams@redhat.com>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
      Cc: linux-rt-users@vger.kernel.org
      Cc: linux-trace-devel@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      79ce8f43
    • Arnaldo Carvalho de Melo's avatar
      tools headers cpufeatures: Sync with the kernel sources · 486e5ed8
      Arnaldo Carvalho de Melo authored
      To pick the changes from:
      
        d341db8f
      
       ("x86/cpufeatures: Add AMD Collaborative Processor Performance Control feature flag")
      
      This only causes these perf files to be rebuilt:
      
        CC       /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o
        CC       /tmp/build/perf/bench/mem-memset-x86-64-asm.o
      
      And addresses this perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
        diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
      
      Cc: Huang Rui <ray.huang@amd.com>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      486e5ed8
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Update tools's copy of drm.h header · f1dcda0f
      Arnaldo Carvalho de Melo authored
      Picking the changes from:
      
        43d5ac7d
      
       ("drm: document DRM_IOCTL_MODE_GETFB2")
      
      It is just a comment, so no changes and silences these perf build warnings:
      
        Warning: Kernel ABI header at 'tools/include/uapi/drm/drm.h' differs from latest version at 'include/uapi/drm/drm.h'
        diff -u tools/include/uapi/drm/drm.h include/uapi/drm/drm.h
      
      Cc: Simon Ser <contact@emersion.fr>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f1dcda0f
    • Arnaldo Carvalho de Melo's avatar
      tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy' · 35cb8c71
      Arnaldo Carvalho de Melo authored
      To bring in the change made in this cset:
      
        f94909ce
      
       ("x86: Prepare asm files for straight-line-speculation")
      
      It silences these perf tools build warnings, no change in the tools:
      
        Warning: Kernel ABI header at 'tools/arch/x86/lib/memcpy_64.S' differs from latest version at 'arch/x86/lib/memcpy_64.S'
        diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S
        Warning: Kernel ABI header at 'tools/arch/x86/lib/memset_64.S' differs from latest version at 'arch/x86/lib/memset_64.S'
        diff -u tools/arch/x86/lib/memset_64.S arch/x86/lib/memset_64.S
      
      The code generated was checked before and after using 'objdump -d /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o',
      no changes.
      
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      35cb8c71
    • Li Zhijian's avatar
      kselftests/net: adapt the timeout to the largest runtime · de0e4447
      Li Zhijian authored
      timeout in settings is used by each case under the same directory, so
      it should adapt to the maximum runtime.
      
      A normally running net/fib_nexthops.sh may be killed by this unsuitable
      timeout. Furthermore, since the defect[1] of kselftests framework,
      net/fib_nexthops.sh which might take at least (300 * 4) seconds would
      block the whole kselftests framework previously.
      $ git grep -w 'sleep 300' tools/testing/selftests/net
      tools/testing/selftests/net/fib_nexthops.sh:    sleep 300
      tools/testing/selftests/net/fib_nexthops.sh:    sleep 300
      tools/testing/selftests/net/fib_nexthops.sh:    sleep 300
      tools/testing/selftests/net/fib_nexthops.sh:    sleep 300
      
      Enlarge the timeout by plus 300 based on the obvious largest runtime
      to avoid the blocking.
      
      [1]: https://www.spinics.net/lists/kernel/msg4185370.html
      
      
      
      Signed-off-by: default avatarZhou Jie <zhoujie2011@fujitsu.com>
      Signed-off-by: default avatarLi Zhijian <lizhijian@fujitsu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      de0e4447
  6. Jan 12, 2022
    • Ian Rogers's avatar
      perf pmu-events: Don't lower case MetricExpr · c0dd9455
      Ian Rogers authored
      
      This patch changes MetricExpr to be written out in the same case. This
      enables events in metrics to use modifiers like 'G' which currently
      yield parse errors when made lower case. To keep tests passing the
      literal #smt_on is compared in a non-case sensitive way - #SMT_on is
      present in at least SkylakeX metrics.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20211126071305.3733878-1-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c0dd9455
    • Ian Rogers's avatar
      perf expr: Add debug logging for literals · f56ef30a
      Ian Rogers authored
      
      Useful for diagnosing problems with metrics.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Konstantin Khlebnikov <koct9i@gmail.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20211124001231.3277836-1-irogers@google.com
      
      
      [ Fixed up perf_cpu conflict, i.e. we need to append ".cpu" to cpu__max_present_cpu() result ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f56ef30a