1. 30 Aug, 2021 8 commits
    • Namhyung Kim's avatar
      perf stat: Do not allow --for-each-cgroup without cpu · 1c02f6c9
      Namhyung Kim authored
      The cgroup mode should work with cpu events.  Warn if --for-each-cgroup
      option is used with a task target like existing -G option.
      
        # perf stat --for-each-cgroup . sleep 1
        both cgroup and no-aggregation modes only available in system-wide mode
      
         Usage: perf stat [<options>] [<command>]
      
            -G, --cgroup <name>   monitor event in cgroup name only
            -A, --no-aggr         disable CPU count aggregation
            -a, --all-cpus        system-wide collection from all CPUs
                --for-each-cgroup <name>
                                  expand events for each cgroup
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20210830170200.55652-1-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1c02f6c9
    • Arnaldo Carvalho de Melo's avatar
      perf bench evlist-open-close: Use PRIu64 with u64 to fix build on 32-bit architectures · a32762b8
      Arnaldo Carvalho de Melo authored
        73     9.00 ubuntu:18.04-x-powerpc        : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
          bench/evlist-open-close.c: In function 'bench_evlist_open_close__run':
          bench/evlist-open-close.c:173:12: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'u64 {aka long long unsigned int}' [-Werror=format=]
             pr_debug("Iteration %d took:\t%ldus\n", i, runtime_us);
                      ^
          bench/../util/debug.h:18:21: note: in definition of macro 'pr_fmt'
           #define pr_fmt(fmt) fmt
                               ^~~
          bench/evlist-open-close.c:173:3: note: in expansion of macro 'pr_debug'
             pr_debug("Iteration %d took:\t%ldus\n", i, runtime_us);
             ^~~~~~~~
          cc1: all warnings being treated as errors
          /git/perf-5.14.0/tools/build/Makefile.build:139: recipe for target 'bench' failed
      
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Fixes: 4241eabf ("perf bench: Add benchmark for evlist open/close operations")
      Link: http://lore.kernel.org/lkml/YS0oTcA9Zuy8Wjm9@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a32762b8
    • James Clark's avatar
      perf tests: Fix *probe_vfs_getname.sh test failures · a05b4270
      James Clark authored
      The commit 4d6101f5 ("perf probe: Clarify error message about
      not finding kernel modules debuginfo") changed the error message "Failed
      to find the path for kernel" to "Failed to find the path for the
      kernel".
      
      Update the regex so that the tests still skip rather than fail when
      kernel debug symbols aren't present.
      Signed-off-by: default avatarJames Clark <james.clark@arm.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Link: http://lore.kernel.org/lkml/20210825164259.833222-1-james.clark@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a05b4270
    • Arnaldo Carvalho de Melo's avatar
      perf bench inject-buildid: Handle writen() errors · edf7b4a2
      Arnaldo Carvalho de Melo authored
      The build on fedora:35 and fedora:rawhide with clang is failing with:
      
        49    41.00 fedora:35                     : FAIL clang version 13.0.0 (Fedora 13.0.0~rc1-1.fc35)
          bench/inject-buildid.c:351:6: error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable]
                  u64 len = 0;
                      ^
          1 error generated.
          make[3]: *** [/git/perf-5.14.0-rc7/tools/build/Makefile.build:139: bench] Error 2
        50    41.11 fedora:rawhide                : FAIL clang version 13.0.0 (Fedora 13.0.0~rc1-1.fc35)
          bench/inject-buildid.c:351:6: error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable]
                  u64 len = 0;
                      ^
          1 error generated.
          make[3]: *** [/git/perf-5.14.0-rc7/tools/build/Makefile.build:139: bench] Error 2
      
      That 'len' variable is not used at all, so just make sure all the
      synthesize_RECORD() routines return ssize_t to propagate the writen()
      return, as it may fail, ditch the 'ret' var and bail out if those
      routines fail.
      
      Fixes: 0bf02a0d ("perf bench: Add build-id injection benchmark")
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Link: http://lore.kernel.org/lkml/CAM9d7cgEZNSor+B+7Y2C+QYGme_v5aH0Zn0RLfxoQ+Fy83EHrg@mail.gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      edf7b4a2
    • Li Huafei's avatar
      perf unwind: Do not overwrite FEATURE_CHECK_LDFLAGS-libunwind-{x86,aarch64} · cdf32b44
      Li Huafei authored
      When setting LIBUNWIND_DIR, we first set
      
       FEATURE_CHECK_LDFLAGS-libunwind-{aarch64,x86} = -L$(LIBUNWIND_DIR)/lib.
      
      <committer note>
      This happens a bit before, the overwritting, in:
      
        libunwind_arch_set_flags = $(eval $(libunwind_arch_set_flags_code))
        define libunwind_arch_set_flags_code
          FEATURE_CHECK_CFLAGS-libunwind-$(1)  = -I$(LIBUNWIND_DIR)/include
          FEATURE_CHECK_LDFLAGS-libunwind-$(1) = -L$(LIBUNWIND_DIR)/lib
        endef
      
        ifdef LIBUNWIND_DIR
          LIBUNWIND_CFLAGS  = -I$(LIBUNWIND_DIR)/include
          LIBUNWIND_LDFLAGS = -L$(LIBUNWIND_DIR)/lib
          LIBUNWIND_ARCHS = x86 x86_64 arm aarch64 debug-frame-arm debug-frame-aarch64
          $(foreach libunwind_arch,$(LIBUNWIND_ARCHS),$(call libunwind_arch_set_flags,$(libunwind_arch)))
        endif
      
      Look at that 'foreach' on all the LIBUNWIND_ARCHS.
      </>
      
      After commit 5c4d7c82 ("perf unwind: Do not put libunwind-{x86,aarch64}
      in FEATURE_TESTS_BASIC"), FEATURE_CHECK_LDFLAGS-libunwind-{x86,aarch64} is
      overwritten. As a result, the remote libunwind libraries cannot be searched
      from $(LIBUNWIND_DIR)/lib directory during feature check tests. Fix it with
      variable appending.
      
      Before this patch:
      
        perf$ make VF=1 LIBUNWIND_DIR=/opt/libunwind_aarch64
         BUILD:   Doing 'make -j16' parallel build
        <SNIP>
        ...
        ...                    libopencsd: [ OFF ]
        ...                 libunwind-x86: [ OFF ]
        ...              libunwind-x86_64: [ OFF ]
        ...                 libunwind-arm: [ OFF ]
        ...             libunwind-aarch64: [ OFF ]
        ...         libunwind-debug-frame: [ OFF ]
        ...     libunwind-debug-frame-arm: [ OFF ]
        ... libunwind-debug-frame-aarch64: [ OFF ]
        ...                           cxx: [ OFF ]
        <SNIP>
      
        perf$ cat ../build/feature/test-libunwind-aarch64.make.output
        /usr/bin/ld: cannot find -lunwind-aarch64
        /usr/bin/ld: cannot find -lunwind-aarch64
        collect2: error: ld returned 1 exit status
      
      After this patch:
      
        perf$ make VF=1 LIBUNWIND_DIR=/opt/libunwind_aarch64
         BUILD:   Doing 'make -j16' parallel build
        <SNIP>
        ...                    libopencsd: [ OFF ]
        ...                 libunwind-x86: [ OFF ]
        ...              libunwind-x86_64: [ OFF ]
        ...                 libunwind-arm: [ OFF ]
        ...             libunwind-aarch64: [ on  ]
        ...         libunwind-debug-frame: [ OFF ]
        ...     libunwind-debug-frame-arm: [ OFF ]
        ... libunwind-debug-frame-aarch64: [ OFF ]
        ...                           cxx: [ OFF ]
        <SNIP>
      
        perf$ cat ../build/feature/test-libunwind-aarch64.make.output
      
        perf$ ldd ./perf
              linux-vdso.so.1 (0x00007ffdf07da000)
              libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f30953dc000)
              librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f30951d4000)
              libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3094e36000)
              libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3094c32000)
              libelf.so.1 => /usr/lib/x86_64-linux-gnu/libelf.so.1 (0x00007f3094a18000)
              libdw.so.1 => /usr/lib/x86_64-linux-gnu/libdw.so.1 (0x00007f30947cc000)
              libunwind-x86_64.so.8 => /usr/lib/x86_64-linux-gnu/libunwind-x86_64.so.8 (0x00007f30945ad000)
              libunwind.so.8 => /usr/lib/x86_64-linux-gnu/libunwind.so.8 (0x00007f3094392000)
              liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f309416c000)
              libunwind-aarch64.so.8 => not found
              libslang.so.2 => /lib/x86_64-linux-gnu/libslang.so.2 (0x00007f3093c8a000)
              libpython2.7.so.1.0 => /usr/local/lib/libpython2.7.so.1.0 (0x00007f309386b000)
              libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f309364e000)
              libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007f3093443000)
              libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3093052000)
              /lib64/ld-linux-x86-64.so.2 (0x00007f3096097000)
              libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f3092e42000)
              libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f3092c3f000)
      
      Fixes: 5c4d7c82 ("perf unwind: Do not put libunwind-{x86,aarch64} in FEATURE_TESTS_BASIC")
      Signed-off-by: default avatarLi Huafei <lihuafei1@huawei.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: He Kuang <hekuang@huawei.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: Zhang Jinhao <zhangjinhao2@huawei.com>
      Link: http://lore.kernel.org/lkml/20210823134340.60955-1-lihuafei1@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cdf32b44
    • Arnaldo Carvalho de Melo's avatar
      perf config: Fix caching and memory leak in perf_home_perfconfig() · 261f4911
      Arnaldo Carvalho de Melo authored
      Acaict, perf_home_perfconfig() is supposed to cache the result of
      home_perfconfig, which returns the default location of perfconfig for
      the user, given the HOME environment variable.
      
      However, the current implementation calls home_perfconfig every time
      perf_home_perfconfig() is called (so no caching is actually performed),
      replacing the previous pointer, thus also causing a memory leak.
      
      This patch adds a check of whether either config or failed is set and,
      in that case, directly returns config without calling home_perfconfig at
      each invocation.
      
      Fixes: f5f03e19 ("perf config: Add perf_home_perfconfig function")
      Signed-off-by: default avatarRiccardo Mancini <rickyman7@gmail.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jin Yao <yao.jin@linux.intel.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: Song Liu <song@kernel.org>
      Link: http://lore.kernel.org/lkml/20210820130817.740536-1-rickyman7@gmail.com
      [ Removed needless double check for the 'failed' variable ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      261f4911
    • Alexey Dobriyan's avatar
      perf tools: Fixup get_current_dir_name() compilation · 128dbd78
      Alexey Dobriyan authored
      strdup() prototype doesn't live in stdlib.h .
      
      Add limits.h for PATH_MAX definition as well.
      
      This fixes the build on Android.
      Signed-off-by: default avatarAlexey Dobriyan (SK hynix) <adobriyan@gmail.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Link: http://lore.kernel.org/lkml/YRukaQbrgDWhiwGr@localhost.localdomainSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      128dbd78
    • Arnaldo Carvalho de Melo's avatar
      c635813f
  2. 29 Aug, 2021 8 commits
  3. 28 Aug, 2021 3 commits
  4. 27 Aug, 2021 18 commits
  5. 26 Aug, 2021 3 commits
    • Marek Marczykowski-Górecki's avatar
      PCI/MSI: Skip masking MSI-X on Xen PV · 1a519dc7
      Marek Marczykowski-Górecki authored
      When running as Xen PV guest, masking MSI-X is a responsibility of the
      hypervisor. The guest has no write access to the relevant BAR at all - when
      it tries to, it results in a crash like this:
      
          BUG: unable to handle page fault for address: ffffc9004069100c
          #PF: supervisor write access in kernel mode
          #PF: error_code(0x0003) - permissions violation
          RIP: e030:__pci_enable_msix_range.part.0+0x26b/0x5f0
           e1000e_set_interrupt_capability+0xbf/0xd0 [e1000e]
           e1000_probe+0x41f/0xdb0 [e1000e]
           local_pci_probe+0x42/0x80
          (...)
      
      The recently introduced function msix_mask_all() does not check the global
      variable pci_msi_ignore_mask which is set by XEN PV to bypass the masking
      of MSI[-X] interrupts.
      
      Add the check to make this function XEN PV compatible.
      
      Fixes: 7d5ec3d3 ("PCI/MSI: Mask all unused MSI-X entries")
      Signed-off-by: default avatarMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20210826170342.135172-1-marmarek@invisiblethingslab.com
      1a519dc7
    • Linus Torvalds's avatar
      Merge tag 'nfsd-5.14-1' of git://linux-nfs.org/~bfields/linux · 73367f05
      Linus Torvalds authored
      Pull nfsd fix from Bruce Fields:
       "This is a one-liner fix for a serious bug that can cause the server to
        become unresponsive to a client, so I think it's worth the last-minute
        inclusion for 5.14"
      
      * tag 'nfsd-5.14-1' of git://linux-nfs.org/~bfields/linux:
        SUNRPC: Fix XPT_BUSY flag leakage in svc_handle_xprt()...
      73367f05
    • Linus Torvalds's avatar
      Merge tag 'net-5.14-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 8a2cb8bd
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Networking fixes, including fixes from can and bpf.
      
        Closing three hw-dependent regressions. Any fixes of note are in the
        'old code' category. Nothing blocking release from our perspective.
      
        Current release - regressions:
      
         - stmmac: revert "stmmac: align RX buffers"
      
         - usb: asix: ax88772: move embedded PHY detection as early as
           possible
      
         - usb: asix: do not call phy_disconnect() for ax88178
      
         - Revert "net: really fix the build...", from Kalle to fix QCA6390
      
        Current release - new code bugs:
      
         - phy: mediatek: add the missing suspend/resume callbacks
      
        Previous releases - regressions:
      
         - qrtr: fix another OOB Read in qrtr_endpoint_post
      
         - stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings
      
        Previous releases - always broken:
      
         - inet: use siphash in exception handling
      
         - ip_gre: add validation for csum_start
      
         - bpf: fix ringbuf helper function compatibility
      
         - rtnetlink: return correct error on changing device netns
      
         - e1000e: do not try to recover the NVM checksum on Tiger Lake"
      
      * tag 'net-5.14-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (43 commits)
        Revert "net: really fix the build..."
        net: hns3: fix get wrong pfc_en when query PFC configuration
        net: hns3: fix GRO configuration error after reset
        net: hns3: change the method of getting cmd index in debugfs
        net: hns3: fix duplicate node in VLAN list
        net: hns3: fix speed unknown issue in bond 4
        net: hns3: add waiting time before cmdq memory is released
        net: hns3: clear hardware resource when loading driver
        net: fix NULL pointer reference in cipso_v4_doi_free
        rtnetlink: Return correct error on changing device netns
        net: dsa: hellcreek: Adjust schedule look ahead window
        net: dsa: hellcreek: Fix incorrect setting of GCL
        cxgb4: dont touch blocked freelist bitmap after free
        ipv4: use siphash instead of Jenkins in fnhe_hashfun()
        ipv6: use siphash in rt6_exception_hash()
        can: usb: esd_usb2: esd_usb2_rx_event(): fix the interchange of the CAN RX and TX error counters
        net: usb: asix: ax88772: fix boolconv.cocci warnings
        net/sched: ets: fix crash when flipping from 'strict' to 'quantum'
        qede: Fix memset corruption
        net: stmmac: fix kernel panic due to NULL pointer dereference of buf->xdp
        ...
      8a2cb8bd