1. 08 1月, 2018 5 次提交
    • J
      perf report: Fix a wrong offset issue when using /proc/kcore · 935f5a9d
      Jin Yao 提交于
      When a valid vmlinux is not found, 'perf report' falls back to look at
      /proc/kcore. In this case, it will report the impossible large offset.
      
      For example:
      
        # perf record -b -e cycles:k find /etc/ > /dev/null
        # perf report --stdio --branch-history
      
          22.77%  _vm_normal_page+18446603336221188162
                  |
                  ---page_remove_rmap +18446603336221188324
                     page_remove_rmap +18446603336221188487 (cycles:5)
                     unlock_page_memcg +18446603336221188096
                     page_remove_rmap +18446603336221188327 (cycles:1)
      
      The issue is the value which is passed to parameter 'addr' in
      __get_srcline() is the objdump address. It's not correct if we calculate
      the offset by using 'addr - sym->start'.
      
      This patch creates a new parameter 'ip' in __get_srcline(). It is not
      converted to objdump address.
      
      With this patch, the perf report output is:
      
          22.77%  _vm_normal_page+66
                  |
                  ---page_remove_rmap +228
                     page_remove_rmap +391 (cycles:5)
                     unlock_page_memcg +0
                     page_remove_rmap +231 (cycles:1)
                     page_remove_rmap +236
      
      Committer testing:
      
      Make sure you get any valid vmlinux out of the way, using '-v' on the
      'perf report' case and deleting it from places where perf searches them,
      like your kernel build dir and the build-id cache, in ~/.debug/.
      Reported-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NJin Yao <yao.jin@linux.intel.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1514564812-17344-1-git-send-email-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      935f5a9d
    • W
      perf tools: Fix compile error with libunwind x86 · 44df1afd
      Wang Nan 提交于
      Fix a compile error:
      
       ...
         CC       util/libunwind/x86_32.o
       In file included from util/libunwind/x86_32.c:33:0:
       util/libunwind/../../arch/x86/util/unwind-libunwind.c: In function 'libunwind__x86_reg_id':
       util/libunwind/../../arch/x86/util/unwind-libunwind.c:110:11: error: 'EINVAL' undeclared (first use in this function)
          return -EINVAL;
                  ^
       util/libunwind/../../arch/x86/util/unwind-libunwind.c:110:11: note: each undeclared identifier is reported only once for each function it appears in
       mv: cannot stat 'util/libunwind/.x86_32.o.tmp': No such file or directory
       make[4]: *** [util/libunwind/x86_32.o] Error 1
       make[3]: *** [util] Error 2
       make[2]: *** [libperf-in.o] Error 2
       make[1]: *** [sub-make] Error 2
       make: *** [all] Error 2
      
      It happens when libunwind-x86 feature is detected.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/20171206015040.114574-1-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      44df1afd
    • A
      perf test bpf: Hook on epoll_pwait() · e0337f4f
      Arnaldo Carvalho de Melo 提交于
      The 'perf test bpf' was hooking a eBPF program on the SyS_epoll_wait()
      kernel function, that was what the epoll_wait() glibc function ended up
      calling, but since at least glibc 2.26, the one that comes with, for
      instance, Fedora 27, glibc ends up calling SyS_epoll_pwait() when
      epoll_wait() is used, causing this 'perf test' entry to fail.
      
      So switch to using epoll_pwait() and hook the eBPF program to the
      SyS_epoll_pwait() kernel function to make it work on a wider range of
      glibc and kernel versions.
      Tested-by: NWang Nan <wangnan0@huawei.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-zynvquy63er8s5mrgsz65pto@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e0337f4f
    • A
      perf test bpf: Use designated struct field initializers · 13cb2d0f
      Arnaldo Carvalho de Melo 提交于
      To follow standard practice in the kernel sources, documenting the
      initialization better and helping quickly finding the value for some
      field in a struct with many entries.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-syn3hz9hz7ukxlxbx5x6hv20@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      13cb2d0f
    • A
      perf test bpf: Improve message about expected samples · 6703c977
      Arnaldo Carvalho de Melo 提交于
      When failing on one of the BPF tests we were just stating:
      
        BPF filter result incorrect
      
      Add some more info to help figuring out the problem:
      
       BPF filter result incorrect, expected 56, got 0 samples
      
      This came out while investigating this failure, first seen after
      updating the kernel to the 4.15.0-rc6 tag:
      
        [root@jouet ~]# perf test bpf
        39: BPF filter               :
        39.1: Basic BPF filtering    : FAILED!
        39.2: BPF pinning            : Skip
        39.3: BPF prologue generation: Skip
        39.4: BPF relocation checker : Skip
        [root@jouet ~]#
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-403npu7daupv6b2bmxliv5pk@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6703c977
  2. 06 1月, 2018 12 次提交
    • I
      perf/x86/msr: Clean up the code · 9128d3ed
      Ingo Molnar 提交于
      Recent changes made a bit of an inconsistent mess out of arch/x86/events/msr.c,
      fix it:
      
       - re-align the initialization tables to be vertically aligned and readable again
      
       - harmonize comment style in terms of punctuation, capitalization and spelling
      
       - use curly braces for multi-condition branches
      
       - remove extra newlines
      
       - simplify the code a bit
      
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: kan.liang@intel.com
      Link: http://lkml.kernel.org/r/1515169132-3980-1-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      9128d3ed
    • S
      perf/x86/msr: Add support for MSR_IA32_THERM_STATUS · 9ae21dd6
      Stephane Eranian 提交于
      This patch adds support for the Digital Readout provided by the
      IA32_THERM_STATUS MSR (0x19C) on Intel X86 processors. The readout
      shows the number of degrees Celcius to the TCC (critical temperature)
      supported by the processor. Thus, the larger, the better.
      
      The perf_event support is provided via the msr PMU. The new
      logical event is called cpu_thermal_margin. It comes with a unit and
      snapshot files. The event shows the current temprature distance (margin).
      It is not an accumulating event. The unit is degrees C. The event
      is provided per logical CPU to make things simpler but it is the
      same for both hyper-threads sharing a physical core.
      
      $ perf stat -I 1000 -a -A -e msr/cpu_thermal_margin/
      
      This will print the temperature for all logical CPUs.
                   time CPU                counts unit events
           1.000123741 CPU0                    38 C    msr/cpu_thermal_margin/
           1.000161837 CPU1                    37 C    msr/cpu_thermal_margin/
           1.000187906 CPU2                    36 C    msr/cpu_thermal_margin/
           1.000189046 CPU3                    39 C    msr/cpu_thermal_margin/
           1.000283044 CPU4                    40 C    msr/cpu_thermal_margin/
           1.000344297 CPU5                    40 C    msr/cpu_thermal_margin/
           1.000365832 CPU6                    39 C    msr/cpu_thermal_margin/
           ...
      
      In case the temperature margin cannot be read, the reported value would be -1.
      
      Works on all processors supporting the Digital Readout (dtherm in cpuinfo)
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: kan.liang@intel.com
      Link: http://lkml.kernel.org/r/1515169132-3980-1-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      9ae21dd6
    • I
      Merge branch 'linus' into perf/core, to pick up fixes · b6815f35
      Ingo Molnar 提交于
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      b6815f35
    • L
      Merge tag 'for-4.15-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 89876f27
      Linus Torvalds 提交于
      Pull btrfs fixes from David Sterba:
       "We have two more fixes for 4.15, both aimed for stable.
      
        The leak fix is obvious, the second patch fixes a bug revealed by the
        refcount API, when it behaves differently than previous atomic_t and
        reports refs going from 0 to 1 in one case"
      
      * tag 'for-4.15-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: fix refcount_t usage when deleting btrfs_delayed_nodes
        btrfs: Fix flush bio leak
      89876f27
    • L
      Merge tag 'xfs-4.15-fixes-10' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 12e971b6
      Linus Torvalds 提交于
      Pull XFS fixes from Darrick Wong:
       "I have just a few fixes for bugs and resource cleanup problems this
        week:
      
         - Fix resource cleanup of failed quota initialization
      
         - Fix integer overflow problems wrt s_maxbytes"
      
      * tag 'xfs-4.15-fixes-10' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: fix s_maxbytes overflow problems
        xfs: quota: check result of register_shrinker()
        xfs: quota: fix missed destroy of qi_tree_lock
      12e971b6
    • L
      Merge tag 'mfd-fixes-4.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd · f842839c
      Linus Torvalds 提交于
      Pull MFD fix from Lee Jones:
       "Late bugfix to plug a leak in rtsx_pcr"
      
      * tag 'mfd-fixes-4.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd:
        mfd: rtsx: Release IRQ during shutdown
      f842839c
    • L
      Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · abb7099d
      Linus Torvalds 提交于
      Pull  more x86 pti fixes from Thomas Gleixner:
       "Another small stash of fixes for fallout from the PTI work:
      
         - Fix the modules vs. KASAN breakage which was caused by making
           MODULES_END depend of the fixmap size. That was done when the cpu
           entry area moved into the fixmap, but now that we have a separate
           map space for that this is causing more issues than it solves.
      
         - Use the proper cache flush methods for the debugstore buffers as
           they are mapped/unmapped during runtime and not statically mapped
           at boot time like the rest of the cpu entry area.
      
         - Make the map layout of the cpu_entry_area consistent for 4 and 5
           level paging and fix the KASLR vaddr_end wreckage.
      
         - Use PER_CPU_EXPORT for per cpu variable and while at it unbreak
           nvidia gfx drivers by dropping the GPL export. The subject line of
           the commit tells it the other way around, but I noticed that too
           late.
      
         - Fix the ASM alternative macros so they can be used in the middle of
           an inline asm block.
      
         - Rename the BUG_CPU_INSECURE flag to BUG_CPU_MELTDOWN so the attack
           vector is properly identified. The Spectre mitigations will come
           with their own bug bits later"
      
      * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/pti: Rename BUG_CPU_INSECURE to BUG_CPU_MELTDOWN
        x86/alternatives: Add missing '\n' at end of ALTERNATIVE inline asm
        x86/tlb: Drop the _GPL from the cpu_tlbstate export
        x86/events/intel/ds: Use the proper cache flush method for mapping ds buffers
        x86/kaslr: Fix the vaddr_end mess
        x86/mm: Map cpu_entry_area at the same place on 4/5 level
        x86/mm: Set MODULES_END to 0xffffffffff000000
      abb7099d
    • L
      Merge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b03acc4c
      Linus Torvalds 提交于
      Pull EFI updates from Thomas Gleixner:
      
       - A fix for a add_efi_memmap parameter regression which ensures that
         the parameter is parsed before it is used.
      
       - Reinstate the virtual capsule mapping as the cached copy turned out
         to break Quark and other things
      
       - Remove Matt Fleming as EFI co-maintainer. He stepped back a few days
         ago. Thanks Matt for all your great work!
      
      * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        MAINTAINERS: Remove Matt Fleming as EFI co-maintainer
        efi/capsule-loader: Reinstate virtual capsule mapping
        x86/efi: Fix kernel param add_efi_memmap regression
      b03acc4c
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 3eac6903
      Linus Torvalds 提交于
      Pull s390 fixes from Martin Schwidefsky:
       "Four bug fixes"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/dasd: fix wrongly assigned configuration data
        s390: fix preemption race in disable_sacf_uaccess
        s390/sclp: disable FORTIFY_SOURCE for early sclp code
        s390/pci: handle insufficient resources during dma tlb flush
      3eac6903
    • L
      Merge tag 'for-linus-4.15-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 925cbd7e
      Linus Torvalds 提交于
      Pull xen fix from Juergen Gross:
       "One minor fix adjusting the kmalloc flags in the new pvcalls driver
        added in rc1"
      
      * tag 'for-linus-4.15-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/pvcalls: use GFP_ATOMIC under spin lock
      925cbd7e
    • L
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 64648a5f
      Linus Torvalds 提交于
      Pull crypto fixes from Herbert Xu:
       "This fixes the following issues:
      
         - racy use of ctx->rcvused in af_alg
      
         - algif_aead crash in chacha20poly1305
      
         - freeing bogus pointer in pcrypt
      
         - build error on MIPS in mpi
      
         - memory leak in inside-secure
      
         - memory overwrite in inside-secure
      
         - NULL pointer dereference in inside-secure
      
         - state corruption in inside-secure
      
         - build error without CRYPTO_GF128MUL in chelsio
      
         - use after free in n2"
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: inside-secure - do not use areq->result for partial results
        crypto: inside-secure - fix request allocations in invalidation path
        crypto: inside-secure - free requests even if their handling failed
        crypto: inside-secure - per request invalidation
        lib/mpi: Fix umul_ppmm() for MIPS64r6
        crypto: pcrypt - fix freeing pcrypt instances
        crypto: n2 - cure use after free
        crypto: af_alg - Fix race around ctx->rcvused by making it atomic_t
        crypto: chacha20poly1305 - validate the digest size
        crypto: chelsio - select CRYPTO_GF128MUL
      64648a5f
    • L
      Merge branch 'akpm' (patches from Andrew) · d8887f1c
      Linus Torvalds 提交于
      Merge misc fixes from Andrew Morton:
       "9 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mailmap: update Mark Yao's email address
        userfaultfd: clear the vma->vm_userfaultfd_ctx if UFFD_EVENT_FORK fails
        mm/sparse.c: wrong allocation for mem_section
        mm/zsmalloc.c: include fs.h
        mm/debug.c: provide useful debugging information for VM_BUG
        kernel/exit.c: export abort() to modules
        mm/mprotect: add a cond_resched() inside change_pmd_range()
        kernel/acct.c: fix the acct->needcheck check in check_free_space()
        mm: check pfn_valid first in zero_resv_unavail
      d8887f1c
  3. 05 1月, 2018 23 次提交