1. 30 Jan, 2023 1 commit
    • Naveen N. Rao's avatar
      perf test: Fix DWARF unwind test by adding non-inline to expected function in a backtrace · dfadf8b3
      Naveen N. Rao authored
      'DWARF unwind' 'perf test' can sometimes fail:
      
        $ perf test -v 74
        Couldn't bump rlimit(MEMLOCK), failures may take place when creating BPF maps, etc
         74: Test dwarf unwind                                               :
        --- start ---
        test child forked, pid 3785254
        Problems creating module maps, continuing anyway...
        Problems creating module maps, continuing anyway...
        unwind: test__arch_unwind_sample:ip = 0x102d0ad4c (0x36ad4c)
        unwind: access_mem addr 0x7fffc33128c8, val 1031c3228, offset 120
        unwind: access_mem addr 0x7fffc33128d0, val 12427cc70, offset 128
        <snip>
        unwind: test_dwarf_unwind__krava_3:ip = 0x102b8768b (0x1e768b)
        unwind: access_mem addr 0x7fffc3313048, val 7fffc3313050, offset 2040
        unwind: access_mem addr 0x7fffc3313060, val 102b8777c, offset 2064
        unwind: test_dwarf_unwind__krava_2:ip = 0x102b8770b (0x1e770b)
        unwind: access_mem addr 0x7fffc3313088, val 7fffc3313090, offset 2104
        unwind: access_mem addr 0x7fffc33130a0, val 102b87890, offset 2128
        unwind: test_dwarf_unwind__krava_1:ip = 0x102b8777b (0x1e777b)
        unwind: access_mem addr 0x7fffc3313108, val 10323a274, offset 2232
        unwind: access_mem addr 0x7fffc3313110, val ffffffffffffffff, offset 2240
        unwind: access_mem addr 0x7fffc3313118, val 102c08ed0, offset 2248
        unwind: access_mem addr 0x7fffc3313120, val 1031db000, offset 2256
        unwind: access_mem addr 0x7fffc3313128, val 7fffc3313130, offset 2264
        unwind: access_mem addr 0x7fffc3313140, val 102b45ee8, offset 2288
        unwind: '':ip = 0x102b8788f (0x1e788f)
        failed: got unresolved address 0x102b8788f
        unwind: failed with 'no error'
        got wrong number of stack entries 0 != 8
        test child finished with -1
        ---- end ----
        Test dwarf unwind: FAILED!
      
      We expect to resolve test__dwarf_unwind as the last symbol, but that
      function can be optimized away:
      
        $ objdump -tT /usr/bin/perf | grep dwarf_unwind
        000000000083b018 g    DO .data	0000000000000040  Base        tests__dwarf_unwind
        00000000001e7750 g    DF .text	0000000000000068  Base        0x60 test_dwarf_unwind__krava_1
        00000000001e76e0 g    DF .text	0000000000000068  Base        0x60 test_dwarf_unwind__krava_2
        00000000001e7620 g    DF .text	00000000000000b4  Base        0x60 test_dwarf_unwind__krava_3
        00000000001e74f0 g    DF .text	0000000000000128  Base        0x60 test_dwarf_unwind__compare
        00000000001e7350 g    DF .text	000000000000019c  Base        0x60 test_dwarf_unwind__thread
        000000000083b000 g    DO .data	0000000000000018  Base        suite__dwarf_unwind
      
      Fix this similar to commit fdf7c49c ("perf tests: Fix dwarf
      unwind for stripped binaries") by marking the function as a global and
      adding the 'noinline' attribute to it.
      
      With this patch:
      
        $ objdump -tT perf | grep dwarf_unwind
        000000000083b018 g    DO .data	0000000000000040  Base        tests__dwarf_unwind
        00000000001e80f0 g    DF .text	0000000000000068  Base        0x60 test_dwarf_unwind__krava_1
        00000000001e8080 g    DF .text	0000000000000068  Base        0x60 test_dwarf_unwind__krava_2
        00000000001e7fc0 g    DF .text	00000000000000b4  Base        0x60 test_dwarf_unwind__krava_3
        00000000001e7e90 g    DF .text	0000000000000128  Base        0x60 test_dwarf_unwind__compare
        00000000001e7cf0 g    DF .text	000000000000019c  Base        0x60 test_dwarf_unwind__thread
        00000000001e8160 g    DF .text	0000000000000248  Base        0x60 test__dwarf_unwind
        000000000083b000 g    DO .data	0000000000000018  Base        suite__dwarf_unwind
        $ ./perf test 74
         74: Test dwarf unwind                                               : Ok
      Reported-by: default avatarDisha Goel <disgoel@linux.vnet.ibm.com>
      Signed-off-by: default avatarNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Link: http://lore.kernel.org/lkml/20230125123442.107156-1-naveen.n.rao@linux.vnet.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      dfadf8b3
  2. 27 Jan, 2023 4 commits
  3. 23 Jan, 2023 4 commits
    • Athira Rajeev's avatar
      perf test buildid: Fix shell string substitutions · f1942108
      Athira Rajeev authored
      The perf test named “build id cache operations” skips with below error
      on some distros:
      
        <<>>
         78: build id cache operations                                       :
        test child forked, pid 111101
        WARNING: wine not found. PE binaries will not be run.
        test binaries: /tmp/perf.ex.SHA1.PKz /tmp/perf.ex.MD5.Gt3 ./tests/shell/../pe-file.exe
        DEBUGINFOD_URLS=
        Adding 4abd406f041feb4f10ecde3fc30fd0639e1a91cb /tmp/perf.ex.SHA1.PKz: Ok
        build id: 4abd406f041feb4f10ecde3fc30fd0639e1a91cb
        ./tests/shell/buildid.sh: 69: ./tests/shell/buildid.sh: Bad substitution
        test child finished with -2
        build id cache operations: Skip
        <<>>
      
      The test script "tests/shell/buildid.sh" uses some of the string
      substitution ways which are supported in bash, but not in "sh" or other
      shells. Above error on line number 69 that reports "Bad substitution"
      is:
      
        <<>>
        link=${build_id_dir}/.build-id/${id:0:2}/${id:2}
        <<>>
      
      Here the way of getting first two characters from id ie, ${id:0:2} and
      similarly expressions like ${id:2} is not recognised in "sh". So the
      line errors and instead of hitting failure, the test gets skipped as
      shown in logs.  So the syntax issue causes test not to be executed in
      such cases. Similarly usage : "${@: -1}" [ to pick last argument passed
      to a function] in “test_record” doesn’t work in all distros.
      
      Fix this by using alternative way with shell substitution to pick
      required characters from the string. Also fix the usage of “${@: -1}” to
      work in all cases.
      
      Another usage in “test_record” is:
      
        <<>>
        ${perf} record --buildid-all -o ${data} $@ &> ${log}
        <<>>
      
      This causes the 'perf record' to start in background and Results in the
      data file not being created by the time "check" function is invoked.
      Below log shows 'perf record' result getting displayed after the call to
      "check" function.
      
        <<>>
        running: perf record /tmp/perf.ex.SHA1.EAU
        build id: 4abd406f041feb4f10ecde3fc30fd0639e1a91cb
        link: /tmp/perf.debug.mLT/.build-id/4a/bd406f041feb4f10ecde3fc30fd0639e1a91cb
        failed: link /tmp/perf.debug.mLT/.build-id/4a/bd406f041feb4f10ecde3fc30fd0639e1a91cb does not exist
        test child finished with -1
        build id cache operations: FAILED!
        root@machine:~/athira/linux/tools/perf# Couldn't synthesize bpf events.
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.010 MB /tmp/perf.data.bFF ]
        <<>>
      
      Fix this by redirecting output instead of using “&” which starts the
      command in background.
      Reviewed-by: default avatarDavid Laight <David.Laight@ACULAB.COM>
      Signed-off-by: default avatarAthira Jajeev <atrajeev@linux.vnet.ibm.com>
      Tested-by: default avatarDisha Goel <disgoel@linux.ibm.com>
      Acked-by: default avatarIan Rogers <irogers@google.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Nageswara R Sastry <rnsastry@linux.ibm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: linuxppc-dev@lists.ozlabs.org
      Link: https://lore.kernel.org/r/20230119142719.32628-1-atrajeev@linux.vnet.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f1942108
    • Diederik de Haas's avatar
      perf: Various spelling fixes · fc5d836c
      Diederik de Haas authored
      Fix various spelling errors as reported by Debian's lintian tool.
      
      "amount of times" -> "number of times"
      ocurrence -> occurrence
      upto -> up to
      Signed-off-by: default avatarDiederik de Haas <didi.debian@cknow.org>
      Acked-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      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/20230122122034.48020-1-didi.debian@cknow.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fc5d836c
    • Naveen N. Rao's avatar
      perf test: Switch basic bpf filtering test to use syscall tracepoint · 7158005b
      Naveen N. Rao authored
      BPF filtering tests can sometime fail. Running the test in verbose mode
      shows the following:
      
        $ sudo perf test 42
        42: BPF filter                                                      :
        42.1: Basic BPF filtering                                           : FAILED!
        42.2: BPF pinning                                                   : Skip
        42.3: BPF prologue generation                                       : Skip
        $ perf --version
        perf version 4.18.0-425.3.1.el8.ppc64le
        $ sudo perf test -v 42
        42: BPF filter                                                      :
        42.1: Basic BPF filtering                                           :
        --- start ---
        test child forked, pid 711060
        ...
        bpf: config 'func=do_epoll_wait' is ok
        Looking at the vmlinux_path (8 entries long)
        Using /usr/lib/debug/lib/modules/4.18.0-425.3.1.el8.ppc64le/vmlinux for symbols
        Open Debuginfo file: /usr/lib/debug/.build-id/81/56f5a07f92ccb62c5600ba0e4aacfb5f3a7534.debug
        Try to find probe point from debuginfo.
        Matched function: do_epoll_wait [4ef8cb0]
        found inline addr: 0xc00000000061dbe4
        Probe point found: __se_compat_sys_epoll_pwait+196
        found inline addr: 0xc00000000061d9f4
        Probe point found: __se_sys_epoll_pwait+196
        found inline addr: 0xc00000000061d824
        Probe point found: __se_sys_epoll_wait+36
        Found 3 probe_trace_events.
        Opening /sys/kernel/tracing//kprobe_events write=1
        ...
        BPF filter result incorrect, expected 56, got 56 samples
        test child finished with -1
        ---- end ----
        BPF filter subtest 1: FAILED!
      
      The statement above about the result being incorrect looks weird, and it
      is due to that particular perf build missing commit 3e11300c
      ("perf test: Fix bpf test sample mismatch reporting"). In reality, due
      to commit 4b04e0de ("perf test: Fix basic bpf filtering test"),
      perf expects there to be 56*3 samples.
      
      However, the number of samples we receive is going to be dependent on
      where the probes are installed, which is dependent on where
      do_epoll_wait gets inlined. On s390x, it looks like probes at all the
      inlined locations are hit. But, that is not the case on ppc64le.
      
      Fix this by switching the test to instead use the syscall tracepoint.
      This ensures that we will only ever install a single event enabling us
      to reliably determine the sample count.
      Reported-by: default avatarDisha Goel <disgoel@linux.vnet.ibm.com>
      Signed-off-by: default avatarNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: bpf@vger.kernel.org
      Link: http://lore.kernel.org/lkml/20230123083224.276404-1-naveen.n.rao@linux.vnet.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7158005b
    • Arnaldo Carvalho de Melo's avatar
      Merge remote-tracking branch 'torvalds/master' into perf/core · 91f67b9a
      Arnaldo Carvalho de Melo authored
      To pick fixes that went via perf/urgent.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      91f67b9a
  4. 22 Jan, 2023 26 commits
  5. 21 Jan, 2023 5 commits
    • Linus Torvalds's avatar
      Merge tag 'char-misc-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · f6714402
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are some small char/misc and other subsystem driver fixes for
        6.2-rc5 to resolve a few reported issues. They include:
      
         - long time pending fastrpc fixes (should have gone into 6.1, my
           fault)
      
         - mei driver/bus fixes and new device ids
      
         - interconnect driver fixes for reported problems
      
         - vmci bugfix
      
         - w1 driver bugfixes for reported problems
      
        Almost all of these have been in linux-next with no reported problems,
        the rest have all passed 0-day bot testing in my tree and on the
        mailing lists where they have sat too long due to me taking a long
        time to catch up on my pending patch queue"
      
      * tag 'char-misc-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        VMCI: Use threaded irqs instead of tasklets
        misc: fastrpc: Pass bitfield into qcom_scm_assign_mem
        gsmi: fix null-deref in gsmi_get_variable
        misc: fastrpc: Fix use-after-free race condition for maps
        misc: fastrpc: Don't remove map on creater_process and device_release
        misc: fastrpc: Fix use-after-free and race in fastrpc_map_find
        misc: fastrpc: fix error code in fastrpc_req_mmap()
        mei: me: add meteor lake point M DID
        mei: bus: fix unlink on bus in error path
        w1: fix WARNING after calling w1_process()
        w1: fix deadloop in __w1_remove_master_device()
        comedi: adv_pci1760: Fix PWM instruction handling
        interconnect: qcom: rpm: Use _optional func for provider clocks
        interconnect: qcom: msm8996: Fix regmap max_register values
        interconnect: qcom: msm8996: Provide UFS clocks to A2NoC
        dt-bindings: interconnect: Add UFS clocks to MSM8996 A2NoC
      f6714402
    • Linus Torvalds's avatar
      Merge tag 'driver-core-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · c88a3114
      Linus Torvalds authored
      Pull driver core fixes from Greg KH:
       "Here are three small driver and kernel core fixes for 6.2-rc5. They
        include:
      
         - potential gadget fixup in do_prlimit
      
         - device property refcount leak fix
      
         - test_async_probe bugfix for reported problem"
      
      * tag 'driver-core-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        prlimit: do_prlimit needs to have a speculation check
        driver core: Fix test_async_probe_init saves device in wrong array
        device property: fix of node refcount leak in fwnode_graph_get_next_endpoint()
      c88a3114
    • Linus Torvalds's avatar
      Merge tag 'staging-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · bb86d657
      Linus Torvalds authored
      Pull staging driver fix from Greg KH:
       "Here is a single staging driver fix for 6.2-rc5. It resolves a build
        issue reported and Fixed by Arnd in the vc04_services driver. It's
        been in linux-next this week with no reported problems"
      
      * tag 'staging-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: vchiq_arm: fix enum vchiq_status return types
      bb86d657
    • Linus Torvalds's avatar
      Merge tag 'tty-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · bd5cc6ee
      Linus Torvalds authored
      Pull tty/serial driver fixes from Greg KH:
       "Here are some small tty and serial driver fixes for 6.2-rc5 that
        resolve a number of tiny reported issues and some new device ids. They
        include:
      
         - new device id for the exar serial driver
      
         - speakup tty driver bugfix
      
         - atmel serial driver baudrate fixup
      
         - stm32 serial driver bugfix and then revert as the bugfix broke the
           build. That will come back in a later pull request once it is all
           worked out properly.
      
         - amba-pl011 serial driver rs486 mode bugfix
      
         - qcom_geni serial driver bugfix
      
        Most of these have been in linux-next with no reported problems (well,
        other than the build breakage which generated the revert), the new
        device id passed 0-day testing"
      
      * tag 'tty-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        serial: exar: Add support for Sealevel 7xxxC serial cards
        Revert "serial: stm32: Merge hard IRQ and threaded IRQ handling into single IRQ handler"
        tty: serial: qcom_geni: avoid duplicate struct member init
        serial: atmel: fix incorrect baudrate setup
        tty: fix possible null-ptr-defer in spk_ttyio_release
        serial: stm32: Merge hard IRQ and threaded IRQ handling into single IRQ handler
        serial: amba-pl011: fix high priority character transmission in rs486 mode
        serial: pch_uart: Pass correct sg to dma_unmap_sg()
        tty: serial: qcom-geni-serial: fix slab-out-of-bounds on RX FIFO buffer
      bd5cc6ee
    • Linus Torvalds's avatar
      Merge tag 'usb-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · e67da288
      Linus Torvalds authored
      Pull USB / Thunderbolt fixes from Greg KH:
       "Here are a number of small USB and Thunderbolt driver fixes and new
        device id changes for 6.2-rc5. Included in here are:
      
         - thunderbolt bugfixes for reported problems
      
         - new usb-serial driver ids added
      
         - onboard_hub usb driver fixes for much-reported problems
      
         - xhci bugfixes
      
         - typec bugfixes
      
         - ehci-fsl driver module alias fix
      
         - iowarrior header size fix
      
         - usb gadget driver fixes
      
        All of these, except for the iowarrior fix, have been in linux-next
        with no reported issues. The iowarrior fix passed the 0-day testing
        and is a one digit change based on a reported problem in the driver
        (which was written to a spec, not the real device that is now
        available)"
      
      * tag 'usb-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (40 commits)
        USB: misc: iowarrior: fix up header size for USB_DEVICE_ID_CODEMERCS_IOW100
        usb: host: ehci-fsl: Fix module alias
        usb: dwc3: fix extcon dependency
        usb: core: hub: disable autosuspend for TI TUSB8041
        USB: fix misleading usb_set_intfdata() kernel doc
        usb: gadget: f_ncm: fix potential NULL ptr deref in ncm_bitrate()
        USB: gadget: Add ID numbers to configfs-gadget driver names
        usb: typec: tcpm: Fix altmode re-registration causes sysfs create fail
        usb: gadget: g_webcam: Send color matching descriptor per frame
        usb: typec: altmodes/displayport: Use proper macro for pin assignment check
        usb: typec: altmodes/displayport: Fix pin assignment calculation
        usb: typec: altmodes/displayport: Add pin assignment helper
        usb: gadget: f_fs: Ensure ep0req is dequeued before free_request
        usb: gadget: f_fs: Prevent race during ffs_ep0_queue_wait
        usb: misc: onboard_hub: Move 'attach' work to the driver
        usb: misc: onboard_hub: Invert driver registration order
        usb: ucsi: Ensure connector delayed work items are flushed
        usb: musb: fix error return code in omap2430_probe()
        usb: chipidea: core: fix possible constant 0 if use IS_ERR(ci->role_switch)
        xhci: Detect lpm incapable xHC USB3 roothub ports from ACPI tables
        ...
      e67da288