1. 03 Feb, 2021 4 commits
    • Jin Yao's avatar
      perf script: Support DSO filter like in other perf tools · 4b799a9b
      Jin Yao authored
      Other perf tool builtins already supported a DSO filter.
      
      For example:
      
        $ perf report --dsos a,b,c
      
      which only considers symbols in these dsos.
      
      Now the DSO filter is supported in 'perf script':
      
        root@kbl-ppc:~# ./perf script --dsos "[kernel.kallsyms]"
                  perf 18123 [000] 6142863.075104:          1   cycles:  ffffffff9ca77308 native_write_msr+0x8 ([kernel.kallsyms])
                  perf 18123 [000] 6142863.075107:          1   cycles:  ffffffff9ca77308 native_write_msr+0x8 ([kernel.kallsyms])
                  perf 18123 [000] 6142863.075108:         10   cycles:  ffffffff9ca77308 native_write_msr+0x8 ([kernel.kallsyms])
                  perf 18123 [000] 6142863.075109:        273   cycles:  ffffffff9ca7730a native_write_msr+0xa ([kernel.kallsyms])
                  perf 18123 [000] 6142863.075110:       7684   cycles:  ffffffff9ca3c9c0 native_sched_clock+0x50 ([kernel.kallsyms])
                  perf 18123 [000] 6142863.075112:     213017   cycles:  ffffffff9d765a92 syscall_exit_to_user_mode+0x32 ([kernel.kallsyms])
                  perf 18123 [001] 6142863.075156:          1   cycles:  ffffffff9ca77308 native_write_msr+0x8 ([kernel.kallsyms])
                  perf 18123 [001] 6142863.075158:          1   cycles:  ffffffff9ca77308 native_write_msr+0x8 ([kernel.kallsyms])
                  perf 18123 [001] 6142863.075159:         17   cycles:  ffffffff9ca77308 native_write_msr+0x8 ([kernel.kallsyms])
      
      Committer testing:
      
        $ perf script
                      ls 2364888 29303.010949:          1 cycles:u:  ffffffffa4bbc6a9 [unknown] ([unknown])
                      ls 2364888 29303.010957:          1 cycles:u:  ffffffffa429ef48 [unknown] ([unknown])
                      ls 2364888 29303.010961:          1 cycles:u:  ffffffffa4260133 [unknown] ([unknown])
                      ls 2364888 29303.010964:          5 cycles:u:  ffffffffa429efad [unknown] ([unknown])
                      ls 2364888 29303.010967:         41 cycles:u:  ffffffffa42a4586 [unknown] ([unknown])
                      ls 2364888 29303.010972:        435 cycles:u:  ffffffffa429efe0 [unknown] ([unknown])
                      ls 2364888 29303.010978:       5142 cycles:u:      7f9b95bc2abf __GI___tunables_init+0x11f (/usr/lib64/ld-2.32.so)
                      ls 2364888 29303.011006:      38551 cycles:u:  ffffffffa4290f61 [unknown] ([unknown])
                      ls 2364888 29303.011486:     238234 cycles:u:      7f9b95bb7741 _dl_relocate_object+0xa71 (/usr/lib64/ld-2.32.so)
                      ls 2364888 29303.011937:     415870 cycles:u:      7f9b95a1c80e __strcoll_l+0xe (/usr/lib64/libc-2.32.so)
        $
      
      Before:
      
        $ perf script --dsos /usr/lib64/libc-2.32.so |& head -5
          Error: unknown option `dsos'
      
         Usage: perf script [<options>]
            or: perf script [<options>] record <script> [<record-options>] <command>
            or: perf script [<options>] report <script> [script-args]
        $
      
      After:
      
        $ perf script --dsos /usr/lib64/libc-2.32.so
                      ls 2364888 29303.011937:     415870 cycles:u:      7f9b95a1c80e __strcoll_l+0xe (/usr/lib64/libc-2.32.so)
        $
      Signed-off-by: default avatarJin Yao <yao.jin@linux.intel.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jin Yao <yao.jin@intel.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20210124232750.19170-2-yao.jin@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4b799a9b
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Fix DSO filtering when not finding a map for a sampled address · c69bf11a
      Arnaldo Carvalho de Melo authored
      When we lookup an address and don't find a map we should filter that
      sample if the user specified a list of --dso entries to filter on, fix
      it.
      
      Before:
      
        $ perf script
                   sleep 274800  2843.556162:          1 cycles:u:  ffffffffbb26bff4 [unknown] ([unknown])
                   sleep 274800  2843.556168:          1 cycles:u:  ffffffffbb2b047d [unknown] ([unknown])
                   sleep 274800  2843.556171:          1 cycles:u:  ffffffffbb2706b2 [unknown] ([unknown])
                   sleep 274800  2843.556174:          6 cycles:u:  ffffffffbb2b0267 [unknown] ([unknown])
                   sleep 274800  2843.556176:         59 cycles:u:  ffffffffbb2b03b1 [unknown] ([unknown])
                   sleep 274800  2843.556180:        691 cycles:u:  ffffffffbb26bff4 [unknown] ([unknown])
                   sleep 274800  2843.556189:       9160 cycles:u:      7fa9550eeaa3 __GI___tunables_init+0xf3 (/usr/lib64/ld-2.32.so)
                   sleep 274800  2843.556312:      86937 cycles:u:      7fa9550e157b _dl_lookup_symbol_x+0x4b (/usr/lib64/ld-2.32.so)
        $
      
      So we have some samples we somehow didn't find in a map for, if we now
      do:
      
        $ perf report --stdio --dso /usr/lib64/ld-2.32.so
        # dso: /usr/lib64/ld-2.32.so
        #
        # Total Lost Samples: 0
        #
        # Samples: 8  of event 'cycles:u'
        # Event count (approx.): 96856
        #
        # Overhead  Command  Symbol
        # ........  .......  ........................
        #
            89.76%  sleep    [.] _dl_lookup_symbol_x
             9.46%  sleep    [.] __GI___tunables_init
             0.71%  sleep    [k] 0xffffffffbb26bff4
             0.06%  sleep    [k] 0xffffffffbb2b03b1
             0.01%  sleep    [k] 0xffffffffbb2b0267
             0.00%  sleep    [k] 0xffffffffbb2706b2
             0.00%  sleep    [k] 0xffffffffbb2b047d
        $
      
      After this patch we get the right output with just entries for the DSOs
      specified in --dso:
      
        $ perf report --stdio --dso /usr/lib64/ld-2.32.so
        # dso: /usr/lib64/ld-2.32.so
        #
        # Total Lost Samples: 0
        #
        # Samples: 8  of event 'cycles:u'
        # Event count (approx.): 96856
        #
        # Overhead  Command  Symbol
        # ........  .......  ........................
        #
            89.76%  sleep    [.] _dl_lookup_symbol_x
             9.46%  sleep    [.] __GI___tunables_init
        $
        #
      
      Fixes: 96415e4d ("perf symbols: Avoid unnecessary symbol loading when dso list is specified")
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20210128131209.GD775562@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c69bf11a
    • Kan Liang's avatar
      perf stat: Add Topdown metrics events as default events · 42641d6f
      Kan Liang authored
      The Topdown Microarchitecture Analysis (TMA) Method is a structured
      analysis methodology to identify critical performance bottlenecks in
      out-of-order processors. From the Ice Lake and later platforms, the
      Topdown information can be retrieved from the dedicated "metrics"
      register, which isn't impacted by other events. Also, the Topdown
      metrics support both per thread/process and per core measuring.  Adding
      Topdown metrics events as default events can enrich the default
      measuring information, and would not cost any extra multiplexing.
      
      Introduce arch_evlist__add_default_attrs() to allow architecture
      specific default events. Add the Topdown metrics events in the X86
      specific arch_evlist__add_default_attrs(). Other architectures can add
      their own default events later separately.
      
      With the patch:
      
       $ perf stat sleep 1
      
       Performance counter stats for 'sleep 1':
      
                 0.82 msec task-clock:u              #    0.001 CPUs utilized
                    0      context-switches:u        #    0.000 K/sec
                    0      cpu-migrations:u          #    0.000 K/sec
                   61      page-faults:u             #    0.074 M/sec
              319,941      cycles:u                  #    0.388 GHz
              242,802      instructions:u            #    0.76  insn per cycle
               54,380      branches:u                #   66.028 M/sec
                4,043      branch-misses:u           #    7.43% of all branches
            1,585,555      slots:u                   # 1925.189 M/sec
              238,941      topdown-retiring:u        #     15.0% retiring
              410,378      topdown-bad-spec:u        #     25.8% bad speculation
              634,222      topdown-fe-bound:u        #     39.9% frontend bound
              304,675      topdown-be-bound:u        #     19.2% backend bound
      
             1.001791625 seconds time elapsed
      
             0.000000000 seconds user
             0.001572000 seconds sys
      Signed-off-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lore.kernel.org/lkml/20210121133752.118327-1-kan.liang@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      42641d6f
    • John Garry's avatar
      perf test: Add parse-metric memory bandwidth testcase · 7efce5c2
      John Garry authored
      Event duration_time in a metric expression requires special handling.
      
      Improve test coverage by including a metric whose expression includes
      duration_time. The actual metric is a copied from the L1D_Cache_Fill_BW
      metric on my broadwell machine.
      Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
      Acked-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: linuxarm@openeuler.org
      Link: http://lore.kernel.org/lkml/1611578842-5749-1-git-send-email-john.garry@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7efce5c2
  2. 27 Jan, 2021 2 commits
  3. 26 Jan, 2021 7 commits
  4. 25 Jan, 2021 20 commits
  5. 24 Jan, 2021 7 commits
    • Linus Torvalds's avatar
      Merge tag 'sh-for-5.11' of git://git.libc.org/linux-sh · 228a65d4
      Linus Torvalds authored
      Pull arch/sh updates from Rich Felker:
       "Cleanup and warning fixes"
      
      * tag 'sh-for-5.11' of git://git.libc.org/linux-sh:
        sh/intc: Restore devm_ioremap() alignment
        sh: mach-sh03: remove duplicate include
        arch: sh: remove duplicate include
        sh: Drop ARCH_NR_GPIOS definition
        sh: Remove unused HAVE_COPY_THREAD_TLS macro
        sh: remove CONFIG_IDE from most defconfig
        sh: mm: Convert to DEFINE_SHOW_ATTRIBUTE
        sh: intc: Convert to DEFINE_SHOW_ATTRIBUTE
        arch/sh: hyphenate Non-Uniform in Kconfig prompt
        sh: dma: fix kconfig dependency for G2_DMA
      228a65d4
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.11-2021-01-24' of git://git.kernel.dk/linux-block · ef7b1a0e
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "Still need a final cancelation fix that isn't quite done done,
        expected in the next day or two. That said, this contains:
      
         - Wakeup fix for IOPOLL requests
      
         - SQPOLL split close op handling fix
      
         - Ensure that any use of io_uring fd itself is marked as inflight
      
         - Short non-regular file read fix (Pavel)
      
         - Fix up bad false positive warning (Pavel)
      
         - SQPOLL fixes (Pavel)
      
         - In-flight removal fix (Pavel)"
      
      * tag 'io_uring-5.11-2021-01-24' of git://git.kernel.dk/linux-block:
        io_uring: account io_uring internal files as REQ_F_INFLIGHT
        io_uring: fix sleeping under spin in __io_clean_op
        io_uring: fix short read retries for non-reg files
        io_uring: fix SQPOLL IORING_OP_CLOSE cancelation state
        io_uring: fix skipping disabling sqo on exec
        io_uring: fix uring_flush in exit_files() warning
        io_uring: fix false positive sqo warning on flush
        io_uring: iopoll requests should also wake task ->in_idle state
      ef7b1a0e
    • Linus Torvalds's avatar
      Merge tag 'block-5.11-2021-01-24' of git://git.kernel.dk/linux-block · a692a610
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - NVMe pull request from Christoph:
            - fix a status code in nvmet (Chaitanya Kulkarni)
            - avoid double completions in nvme-rdma/nvme-tcp (Chao Leng)
            - fix the CMB support to cope with NVMe 1.4 controllers (Klaus Jensen)
            - fix PRINFO handling in the passthrough ioctl (Revanth Rajashekar)
            - fix a double DMA unmap in nvme-pci
      
       - lightnvm error path leak fix (Pan)
      
       - MD pull request from Song:
            - Flush request fix (Xiao)
      
      * tag 'block-5.11-2021-01-24' of git://git.kernel.dk/linux-block:
        lightnvm: fix memory leak when submit fails
        nvme-pci: fix error unwind in nvme_map_data
        nvme-pci: refactor nvme_unmap_data
        md: Set prev_flush_start and flush_bio in an atomic way
        nvmet: set right status on error in id-ns handler
        nvme-pci: allow use of cmb on v1.4 controllers
        nvme-tcp: avoid request double completion for concurrent nvme_tcp_timeout
        nvme-rdma: avoid request double completion for concurrent nvme_rdma_timeout
        nvme: check the PRINFO bit before deciding the host buffer length
      a692a610
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 51306806
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "18 patches.
      
        Subsystems affected by this patch series: mm (pagealloc, memcg, kasan,
        memory-failure, and highmem), ubsan, proc, and MAINTAINERS"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        MAINTAINERS: add a couple more files to the Clang/LLVM section
        proc_sysctl: fix oops caused by incorrect command parameters
        powerpc/mm/highmem: use __set_pte_at() for kmap_local()
        mips/mm/highmem: use set_pte() for kmap_local()
        mm/highmem: prepare for overriding set_pte_at()
        sparc/mm/highmem: flush cache and TLB
        mm: fix page reference leak in soft_offline_page()
        ubsan: disable unsigned-overflow check for i386
        kasan, mm: fix resetting page_alloc tags for HW_TAGS
        kasan, mm: fix conflicts with init_on_alloc/free
        kasan: fix HW_TAGS boot parameters
        kasan: fix incorrect arguments passing in kasan_add_zero_shadow
        kasan: fix unaligned address is unhandled in kasan_remove_zero_shadow
        mm: fix numa stats for thp migration
        mm: memcg: fix memcg file_dirty numa stat
        mm: memcg/slab: optimize objcg stock draining
        mm: fix initialization of struct page for holes in memory layout
        x86/setup: don't remove E820_TYPE_RAM for pfn 0
      51306806
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · fdbc80bd
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are some small char/misc driver fixes for 5.11-rc5:
      
         - habanalabs driver fixes
      
         - phy driver fixes
      
         - hwtracing driver fixes
      
         - rtsx cardreader driver fix
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'char-misc-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        misc: rtsx: init value of aspm_enabled
        habanalabs: disable FW events on device removal
        habanalabs: fix backward compatibility of idle check
        habanalabs: zero pci counters packet before submit to FW
        intel_th: pci: Add Alder Lake-P support
        stm class: Fix module init return on allocation failure
        habanalabs: prevent soft lockup during unmap
        habanalabs: fix reset process in case of failures
        habanalabs: fix dma_addr passed to dma_mmap_coherent
        phy: mediatek: allow compile-testing the dsi phy
        phy: cpcap-usb: Fix warning for missing regulator_disable
        PHY: Ingenic: fix unconditional build of phy-ingenic-usb
      fdbc80bd
    • Linus Torvalds's avatar
      Merge tag 'driver-core-5.11-rc5' of... · 443d1129
      Linus Torvalds authored
      Merge tag 'driver-core-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core fixes from Greg KH:
       "Here are some small driver core fixes for 5.11-rc5 that resolve some
        reported problems:
      
         - revert of a -rc1 patch that was causing problems with some machines
      
         - device link device name collision problem fix (busses only have to
           name devices unique to their bus, not unique to all busses)
      
         - kernfs splice bugfixes to resolve firmware loading problems for
           Qualcomm systems.
      
         - other tiny driver core fixes for minor issues reported.
      
        All of these have been in linux-next with no reported problems"
      
      * tag 'driver-core-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        driver core: Fix device link device name collision
        driver core: Extend device_is_dependent()
        kernfs: wire up ->splice_read and ->splice_write
        kernfs: implement ->write_iter
        kernfs: implement ->read_iter
        Revert "driver core: Reorder devices on successful probe"
        Driver core: platform: Add extra error check in devm_platform_get_irqs_affinity()
        drivers core: Free dma_range_map when driver probe failed
      443d1129
    • Linus Torvalds's avatar
      Merge tag 'staging-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 832bceef
      Linus Torvalds authored
      Pull staging/IIO driver fixes from Greg KH:
       "Here are some IIO driver fixes for 5.11-rc5 to resolve some reported
        problems.
      
        Nothing major, just a few small fixes, all of these have been in
        linux-next for a while and full details are in the shortlog"
      
      * tag 'staging-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        iio: sx9310: Fix semtech,avg-pos-strength setting when > 16
        iio: common: st_sensors: fix possible infinite loop in st_sensors_irq_thread
        iio: ad5504: Fix setting power-down state
        counter:ti-eqep: remove floor
        drivers: iio: temperature: Add delay after the addressed reset command in mlx90632.c
        iio: adc: ti_am335x_adc: remove omitted iio_kfifo_free()
        dt-bindings: iio: accel: bma255: Fix bmc150/bmi055 compatible
        iio: sx9310: Off by one in sx9310_read_thresh()
      832bceef