1. 18 1月, 2015 7 次提交
  2. 17 1月, 2015 20 次提交
    • I
      Merge tag 'perf-urgent-for-mingo' of... · d01de238
      Ingo Molnar 提交于
      Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
      
        - Fix segfault when using both the map symtab viewer and annotation
          in the TUI (Namhyung Kim).
      
        - uClibc build fixes (Alexey Brodkin, Vineet Gupta).
      
        - bitops/hweight were moved from tools/perf/ too tools/include, move
          some leftovers (Arnaldo Carvalho de Melo)
      
        - Fix dwarf unwind x86_64 build error (Namhyung Kim)
      
        - Fix __machine__findnew_thread() error path (Namhyung Kim)
      
        - Propagate error code when write(2) failed in 'perf probe' (Namhyung Kim)
      
        - Use dwfl_report_elf() instead of offline in powerpc bits to
          properly handle non prelinked DSOs (Sukadev Bhattiprolu).
      
        - Fix dwarf unwind using libunwind in 'perf test' (Wang Nan)
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      d01de238
    • L
      kernel: avoid overflow in cmp_range · fc7f0dd3
      Louis Langholtz 提交于
      Avoid overflow possibility.
      
      [ The overflow is purely theoretical, since this is used for memory
        ranges that aren't even close to using the full 64 bits, but this is
        the right thing to do regardless.  - Linus ]
      Signed-off-by: NLouis Langholtz <lou_langholtz@me.com>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: Peter Anvin <hpa@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fc7f0dd3
    • S
      perf tools powerpc: Use dwfl_report_elf() instead of offline. · 6bcf9c1f
      Sukadev Bhattiprolu 提交于
      dwfl_report_offline() works only when libraries are prelinked.
      
      Replace dwfl_report_offline() with dwfl_report_elf() so we correctly
      extract debug info even from libraries that are not prelinked.
      Reported-by: NJiri Olsa <jolsa@redhat.com>
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Tested-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Link: http://lkml.kernel.org/r/20150114221045.GA17703@us.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6bcf9c1f
    • N
      perf tools: Fix segfault for symbol annotation on TUI · 813ccd15
      Namhyung Kim 提交于
      Currently the symbol structure is allocated with symbol_conf.priv_size
      to carry sideband information like annotation, map browser on TUI and
      sort-by-name tree node.  So retrieving these information from symbol
      needs to care about the details of such placement.
      
      However the annotation code just assumes that the symbol is placed after
      the struct annotation.  But actually there's other info between them.
      So accessing those struct will lead to an undefined behavior (usually a
      crash) after they write their info to the same location.
      
      To reproduce the problem, please follow the steps below:
      
        1. run perf report (TUI of course) with -v option
        2. open map browser (by pressing right arrow key for any entry)
        3. search any function (by pressing '/' key and input whatever..)
        4. return to the hist browser (by pressing 'q' or left arrow key)
        5. open annotation window for the same entry (by pressing 'a' key)
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1421234288-22758-1-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      813ccd15
    • W
      perf test: Fix dwarf unwind using libunwind. · b93b0967
      Wang Nan 提交于
      Perf tool fails to unwind user stack if the event raises in a shared
      object. This patch improves tests/dwarf-unwind.c to demonstrate the
      problem by utilizing commonly used glibc function "bsearch". If perf is
      not statically linked, the testcase will try to unwind a mixed call
      trace.
      
      By debugging libunwind I found that there is a bug in unwind-libunwind:
      it always passes 0 as segbase to libunwind, cause libunwind unable to
      locate debug_frame entry fir first level ip address (I add some more
      debugging output into libunwind to make things clear):
      
                     >_Uarm_dwarf_find_debug_frame: start_ip = 10be98, end_ip = 10c2a4
                     >_Uarm_dwarf_find_debug_frame: found debug_frame table `/lib/libc-2.18.so': segbase=0x0, len=7, gp=0x0, table_data=0x449388
                     >_Uarm_dwarf_search_unwind_table: call lookup:ip = b6cd3bcc, segbase = 0, rel_ip = b6cd3bcc
                     >lookup: e->start_ip_offset = bcf18 (rel_ip = b6cd3bcc)
                     >lookup: e->start_ip_offset = 6d314 (rel_ip = b6cd3bcc)
                     >lookup: e->start_ip_offset = 33d0c (rel_ip = b6cd3bcc)
                      ...
                     >lookup: e->start_ip_offset = 15d0c (rel_ip = b6cd3bcc)
                     >lookup: e->start_ip_offset = 15c40 (rel_ip = b6cd3bcc)
       >_Uarm_dwarf_search_unwind_table: IP b6cd3bcc inside range b6c12000-b6d4c000, but no explicit unwind info found
                      >put_rs_cache: unmasking signals/interrupts and releasing lock
                     >_Uarm_dwarf_step: returning -10
       >_Uarm_step: dwarf_step()=-10
      
      This patch passes map->start as segbase to dwarf_find_debug_frame(), so
      di will be initialized correctly.
      
      In addition, dso and executable are different when setting segbase. This
      patch first check whether the elf is executable, and pass segbase only
      for shared object.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1421203007-75799-1-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b93b0967
    • V
      perf tools: Avoid build splat for syscall numbers with uclibc · ea1fe3a8
      Vineet Gupta 提交于
      This is due to duplicated unistd inclusion (via uClibc headers + kernel headers)
      Also seen on ARM uClibc based tools
      
         ------- ARC build ---------->8-------------
      
        CC       util/evlist.o
      In file included from
      ~/arc/k.org/arch/arc/include/uapi/asm/unistd.h:25:0,
                       from util/../perf-sys.h:10,
                       from util/../perf.h:15,
                       from util/event.h:7,
                       from util/event.c:3:
      ~/arc/k.org/include/uapi/asm-generic/unistd.h:906:0:
      warning: "__NR_fcntl64" redefined [enabled by default]
       #define __NR_fcntl64 __NR3264_fcntl
       ^
      In file included from
      ~/arc/gnu/INSTALL_1412-arc-2014.12-rc1/arc-snps-linux-uclibc/sysroot/usr/include/sys/syscall.h:24:0,
                       from util/../perf-sys.h:6,
         ----------------->8-------------------
      
         ------- ARM build ---------->8-------------
      
        CC FPIC  plugin_scsi.o
      In file included from util/../perf-sys.h:9:0,
                       from util/../perf.h:15,
                       from util/cache.h:7,
                       from perf.c:12:
      ~/arc/k.org/arch/arm/include/uapi/asm/unistd.h:28:0:
      warning: "__NR_restart_syscall" redefined [enabled by default]
      In file included from
      ~/buildroot/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/sys/syscall.h:25:0,
                       from util/../perf-sys.h:6,
                       from util/../perf.h:15,
                       from util/cache.h:7,
                       from perf.c:12:
      ~/buildroot/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/bits/sysnum.h:17:0:
      note: this is the location of the previous definition
         ----------------->8-------------------
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1421156604-30603-4-git-send-email-vgupta@synopsys.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ea1fe3a8
    • V
      perf tools: Elide strlcpy warning with uclibc · a83d869f
      Vineet Gupta 提交于
         ----------------->8------------------
        CC       bench/sched-pipe.o
      In file included from builtin-annotate.c:13:0:
      util/cache.h:76:15: warning: redundant redeclaration of 'strlcpy'
      [-Wredundant-decls]
       extern size_t strlcpy(char *dest, const char *src, size_t size);
                     ^
      In file included from util/util.h:55:0,
                       from builtin.h:4,
                       from builtin-annotate.c:8:
      ~/vineetg/arc/gnu/INSTALL_1412-arc-2014.12-rc1/arc-snps-linux-uclibc/sysroot/usr/include/string.h:396:15:
      note: previous declaration of 'strlcpy' was here
       extern size_t strlcpy(char *__restrict dst, const char *__restrict src,
         ----------------->8------------------
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1421156604-30603-3-git-send-email-vgupta@synopsys.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a83d869f
    • A
      perf tools: Fix statfs.f_type data type mismatch build error with uclibc · db1806ed
      Alexey Brodkin 提交于
      ARC Linux uses the no legacy syscalls abi and corresponding uClibc headers
      statfs defines f_type to be U32 which causes perf build breakage
      
      http://git.uclibc.org/uClibc/tree/libc/sysdeps/linux/common-generic/bits/statfs.h
      
        ----------->8---------------
          CC       fs/fs.o
        fs/fs.c: In function 'fs__valid_mount':
        fs/fs.c:82:24: error: comparison between signed and unsigned integer
        expressions [-Werror=sign-compare]
          else if (st_fs.f_type != magic)
                                ^
        cc1: all warnings being treated as errors
        ----------->8---------------
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Cody P Schafer <dev@codyps.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Link: http://lkml.kernel.org/r/1420888254-17504-2-git-send-email-vgupta@synopsys.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      db1806ed
    • A
      tools: Remove bitops/hweight usage of bits in tools/perf · 25cd480e
      Arnaldo Carvalho de Melo 提交于
      We need to use lib/hweight.c for that, just like we do for lib/rbtree.c,
      so tools need to link hweight.o. For now do it directly, but we need to
      have a tools/lib/lk.a or .so that collects these goodies...
      Reported-by: NJan Beulich <JBeulich@suse.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-a1e91dx3apzqw5kbdt7ut21s@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      25cd480e
    • N
      perf machine: Fix __machine__findnew_thread() error path · 260d819e
      Namhyung Kim 提交于
      When thread__init_map_groups() fails, a new thread should be removed
      from the rbtree since it's gonna be freed.  Also update last match cache
      only if the function succeeded.
      Reported-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1420763892-15535-1-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      260d819e
    • N
      perf tools: Fix building error in x86_64 when dwarf unwind is on · c6e5e9fb
      Namhyung Kim 提交于
      When build with 'make ARCH=x86' and dwarf unwind is on, there is a
      compiling error:
      
         CC       /home/wn/perf/arch/x86/util/unwind-libdw.o
         CC       /home/wn/perf/arch/x86/tests/regs_load.o
       arch/x86/tests/regs_load.S: Assembler messages:
       arch/x86/tests/regs_load.S:65: Error: operand type mismatch for `push'
       arch/x86/tests/regs_load.S:72: Error: operand type mismatch for `pop'
       make[1]: *** [/home/wn/perf/arch/x86/tests/regs_load.o] Error 1
       make[1]: INTERNAL: Exiting with 25 jobserver tokens available; should be 24!
       make: *** [all] Error 2
       ...
      
      Which is caused by incorrectly undefine macro HAVE_ARCH_X86_64_SUPPORT.
      'config/Makefile.arch' tests __x86_64__ only when 'ARCH=x86_64'.
      However, when building x86_64 kernel, ARCH=x86 is valid and commonly
      used. Build systems, such as yocto, uses x86_64 compiler with 'ARCH=x86'
      to build x86_64 perf, which causes mismatching.
      
      As __LP64__ is defined for x86_64 as well, we can consolidate the
      __x86_64__ check to the __LP64__ check and get rid of the IS_X86_64
      IMHO.
      
      (This patch is made by Namhyung Kim when replying my v1 patch:
      
      https://lkml.org/lkml/2015/1/7/17
      
      I modified the code to remove dependency on RAW_ARCH:
      
      https://lkml.org/lkml/2015/1/7/865
      
      Namhyung Kim didn't provide his SOB in his original email. I add
      mine only for my modification.)
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/1421029255-23039-1-git-send-email-wangnan0@huawei.com
      [ Namhyung provided his S-o-B on a followup to this patch thread on lkml ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c6e5e9fb
    • N
      perf probe: Propagate error code when write(2) failed · 7949ba1f
      Namhyung Kim 提交于
      When it failed to write probe commands to the probe_event file in
      debugfs, it needs to propagate the error code properly.  Current code
      blindly uses the return value of the write(2) so it always uses
      -1 (-EPERM) and it might confuse users.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1420886028-15135-4-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7949ba1f
    • L
      Merge tag 'char-misc-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 7ad4b4ae
      Linus Torvalds 提交于
      Pull char/misc driver fixes from Greg KH:
       "Here are three small driver fixes for reported issues for 3.19-rc5.
      
        All of these have been in linux-next for a while with no reported
        problems"
      
      * tag 'char-misc-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        mcb: mcb-pci: Only remap the 1st 0x200 bytes of BAR 0
        mei: add ABI documentation for fw_status exported through sysfs
        mei: clean reset bit before reset
      7ad4b4ae
    • L
      Merge tag 'driver-core-3.19-rc5' of... · 62b15300
      Linus Torvalds 提交于
      Merge tag 'driver-core-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core fix from Greg KH:
       "Here is one kernfs fix for a reported issue for 3.19-rc5.
      
        It has been in linux-next for a while"
      
      * tag 'driver-core-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        kernfs: Fix kernfs_name_compare
      62b15300
    • L
      Merge tag 'tty-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 7b78de8c
      Linus Torvalds 提交于
      Pull tty/serial driver fixes from Greg KH:
       "Here are some tty and serial driver fixes for 3.19-rc5 that resolve
        some reported issues, and add a new device id to the 8250 serial port
        driver.
      
        All have been in linux-next with no reported problems"
      
      * tag 'tty-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        serial: samsung: Add the support for Exynos5433 SoC
        Revert "tty: Fix pty master poll() after slave closes v2"
        tty: Prevent hw state corruption in exclusive mode reopen
        tty: Add support for the WCH384 4S multi-IO card
        serial: fix parisc boot hang
      7b78de8c
    • L
      Merge tag 'staging-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 937102fe
      Linus Torvalds 提交于
      Pull staging driver fixes from Greg KH:
       "Here are 6 staging driver fixes for 3.19-rc5.
      
        They fix some reported issues with some IIO drivers, as well as some
        issues with the vt6655 wireless driver.
      
        All have been in linux-next for a while"
      
      * tag 'staging-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: vt6655: fix sparse warning: argument type
        staging: vt6655: Fix loss of distant/weak access points on channel change.
        staging: vt6655: vnt_tx_packet Fix corrupted tx packets.
        staging: vt6655: fix sparse warnings: incorrect argument type
        iio: iio: Fix iio_channel_read return if channel havn't info
        iio: ad799x: Fix ad7991/ad7995/ad7999 config setup
      937102fe
    • L
      Merge tag 'usb-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 79600d4b
      Linus Torvalds 提交于
      Pull USB fixes from Greg KH:
       "Here is a bunch of USB fixes for 3.19-rc5.
      
        Most of these are gadget driver fixes, along with the xhci driver fix
        that we both reported having problems with, as well as some new device
        ids and other tiny fixes.
      
        All have been in linux-next with no problems"
      
      * tag 'usb-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (43 commits)
        usb: dwc3: gadget: Stop TRB preparation after limit is reached
        usb: dwc3: gadget: Fix TRB preparation during SG
        usb: phy: mv-usb: fix usb_phy build errors
        usb: serial: handle -ENODEV quietly in generic_submit_read_urb
        usb: serial: silence all non-critical read errors
        USB: console: fix potential use after free
        USB: console: fix uninitialised ldisc semaphore
        usb: gadget: udc: atmel: fix possible oops when unloading module
        usb: gadget: gadgetfs: fix an oops in ep_write()
        usb: phy: Fix deferred probing
        OHCI: add a quirk for ULi M5237 blocking on reset
        uas: Add US_FL_NO_ATA_1X for 2 more Seagate disk enclosures
        uas: Do not blacklist ASM1153 disk enclosures
        usb: gadget: udc: avoid dereference before NULL check in ep_queue
        usb: host: ehci-tegra: request deferred probe when failing to get phy
        uas: disable UAS on Apricorn SATA dongles
        uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS566 with usb-id 0bc2:a013
        uas: Add US_FL_NO_ATA_1X for Seagate devices with usb-id 0bc2:a013
        xhci: Add broken-streams quirk for Fresco Logic FL1000G xhci controllers
        USB: EHCI: adjust error return code
        ...
      79600d4b
    • L
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · fa818dc4
      Linus Torvalds 提交于
      Pull arm64 fixes from Will Deacon:
       - Wire up compat_sys_execveat for compat (AArch32) tasks
       - Revert 421520ba, as this breaks our side of the boot protocol
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: partially revert "ARM: 8167/1: extend the reserved memory for initrd to be page aligned"
        arm64: compat: wire up compat_sys_execveat
      fa818dc4
    • L
      Merge tag 'nfs-for-3.19-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · a2a32cd1
      Linus Torvalds 提交于
      Pull NFS client bugfixes from Trond Myklebust:
       "Highlights include:
      
         - Stable fix for a NFSv3/lockd race
         - Fixes for several NFSv4.1 client id trunking bugs
         - Remove an incorrect test when checking for delegated opens"
      
      * tag 'nfs-for-3.19-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        NFSv4: Remove incorrect check in can_open_delegated()
        NFS: Ignore transport protocol when detecting server trunking
        NFSv4/v4.1: Verify the client owner id during trunking detection
        NFSv4: Cache the NFSv4/v4.1 client owner_id in the struct nfs_client
        NFSv4.1: Fix client id trunking on Linux
        LOCKD: Fix a race when initialising nlmsvc_timeout
      a2a32cd1
    • L
      Merge tag 'trace-fixes-v3.19-rc3' of... · 23aa4b41
      Linus Torvalds 提交于
      Merge tag 'trace-fixes-v3.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
      
      Pull ftrace fixes from Steven Rostedt:
       "This holds a few fixes to the ftrace infrastructure as well as the
        mixture of function graph tracing and kprobes.
      
        When jprobes and function graph tracing is enabled at the same time it
        will crash the system:
      
            # modprobe jprobe_example
            # echo function_graph > /sys/kernel/debug/tracing/current_tracer
      
        After the first fork (jprobe_example probes it), the system will
        crash.
      
        This is due to the way jprobes copies the stack frame and does not do
        a normal function return.  This messes up with the function graph
        tracing accounting which hijacks the return address from the stack and
        replaces it with a hook function.  It saves the return addresses in a
        separate stack to put back the correct return address when done.  But
        because the jprobe functions do not do a normal return, their stack
        addresses are not put back until the function they probe is called,
        which means that the probed function will get the return address of
        the jprobe handler instead of its own.
      
        The simple fix here was to disable function graph tracing while the
        jprobe handler is being called.
      
        While debugging this I found two minor bugs with the function graph
        tracing.
      
        The first was about the function graph tracer sharing its function
        hash with the function tracer (they both get filtered by the same
        input).  The changing of the set_ftrace_filter would not sync the
        function recording records after a change if the function tracer was
        disabled but the function graph tracer was enabled.  This was due to
        the update only checking one of the ops instead of the shared ops to
        see if they were enabled and should perform the sync.  This caused the
        ftrace accounting to break and a ftrace_bug() would be triggered,
        disabling ftrace until a reboot.
      
        The second was that the check to update records only checked one of
        the filter hashes.  It needs to test both the "filter" and "notrace"
        hashes.  The "filter" hash determines what functions to trace where as
        the "notrace" hash determines what functions not to trace (trace all
        but these).  Both hashes need to be passed to the update code to find
        out what change is being done during the update.  This also broke the
        ftrace record accounting and triggered a ftrace_bug().
      
        This patch set also include two more fixes that were reported
        separately from the kprobe issue.
      
        One was that init_ftrace_syscalls() was called twice at boot up.  This
        is not a major bug, but that call performed a rather large kmalloc
        (NR_syscalls * sizeof(*syscalls_metadata)).  The second call made the
        first one a memory leak, and wastes memory.
      
        The other fix is a regression caused by an update in the v3.19 merge
        window.  The moving to enable events early, moved the enabling before
        PID 1 was created.  The syscall events require setting the
        TIF_SYSCALL_TRACEPOINT for all tasks.  But for_each_process_thread()
        does not include the swapper task (PID 0), and ended up being a nop.
      
        A suggested fix was to add the init_task() to have its flag set, but I
        didn't really want to mess with PID 0 for this minor bug.  Instead I
        disable and re-enable events again at early_initcall() where it use to
        be enabled.  This also handles any other event that might have its own
        reg function that could break at early boot up"
      
      * tag 'trace-fixes-v3.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Fix enabling of syscall events on the command line
        tracing: Remove extra call to init_ftrace_syscalls()
        ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing
        ftrace: Check both notrace and filter for old hash
        ftrace: Fix updating of filters for shared global_ops filters
      23aa4b41
  3. 16 1月, 2015 8 次提交
  4. 15 1月, 2015 5 次提交
    • S
      tracing: Fix enabling of syscall events on the command line · ce1039bd
      Steven Rostedt (Red Hat) 提交于
      Commit 5f893b26 "tracing: Move enabling tracepoints to just after
      rcu_init()" broke the enabling of system call events from the command
      line. The reason was that the enabling of command line trace events
      was moved before PID 1 started, and the syscall tracepoints require
      that all tasks have the TIF_SYSCALL_TRACEPOINT flag set. But the
      swapper task (pid 0) is not part of that. Since the swapper task is the
      only task that is running at this early in boot, no task gets the
      flag set, and the tracepoint never gets reached.
      
      Instead of setting the swapper task flag (there should be no reason to
      do that), re-enabled trace events again after the init thread (PID 1)
      has been started. It requires disabling all command line events and
      re-enabling them, as just enabling them again will not reset the logic
      to set the TIF_SYSCALL_TRACEPOINT flag, as the syscall tracepoint will
      be fooled into thinking that it was already set, and wont try setting
      it again. For this reason, we must first disable it and re-enable it.
      
      Link: http://lkml.kernel.org/r/1421188517-18312-1-git-send-email-mpe@ellerman.id.au
      Link: http://lkml.kernel.org/r/20150115040506.216066449@goodmis.orgReported-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      ce1039bd
    • S
      tracing: Remove extra call to init_ftrace_syscalls() · 83829b74
      Steven Rostedt (Red Hat) 提交于
      trace_init() calls init_ftrace_syscalls() and then calls trace_event_init()
      which also calls init_ftrace_syscalls(). It makes more sense to only
      call it from trace_event_init().
      
      Calling it twice wastes memory, as it allocates the syscall events twice,
      and loses the first copy of it.
      
      Link: http://lkml.kernel.org/r/54AF53BD.5070303@huawei.com
      Link: http://lkml.kernel.org/r/20150115040505.930398632@goodmis.orgReported-by: NWang Nan <wangnan0@huawei.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      83829b74
    • S
      ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing · 237d28db
      Steven Rostedt (Red Hat) 提交于
      If the function graph tracer traces a jprobe callback, the system will
      crash. This can easily be demonstrated by compiling the jprobe
      sample module that is in the kernel tree, loading it and running the
      function graph tracer.
      
       # modprobe jprobe_example.ko
       # echo function_graph > /sys/kernel/debug/tracing/current_tracer
       # ls
      
      The first two commands end up in a nice crash after the first fork.
      (do_fork has a jprobe attached to it, so "ls" just triggers that fork)
      
      The problem is caused by the jprobe_return() that all jprobe callbacks
      must end with. The way jprobes works is that the function a jprobe
      is attached to has a breakpoint placed at the start of it (or it uses
      ftrace if fentry is supported). The breakpoint handler (or ftrace callback)
      will copy the stack frame and change the ip address to return to the
      jprobe handler instead of the function. The jprobe handler must end
      with jprobe_return() which swaps the stack and does an int3 (breakpoint).
      This breakpoint handler will then put back the saved stack frame,
      simulate the instruction at the beginning of the function it added
      a breakpoint to, and then continue on.
      
      For function tracing to work, it hijakes the return address from the
      stack frame, and replaces it with a hook function that will trace
      the end of the call. This hook function will restore the return
      address of the function call.
      
      If the function tracer traces the jprobe handler, the hook function
      for that handler will not be called, and its saved return address
      will be used for the next function. This will result in a kernel crash.
      
      To solve this, pause function tracing before the jprobe handler is called
      and unpause it before it returns back to the function it probed.
      
      Some other updates:
      
      Used a variable "saved_sp" to hold kcb->jprobe_saved_sp. This makes the
      code look a bit cleaner and easier to understand (various tries to fix
      this bug required this change).
      
      Note, if fentry is being used, jprobes will change the ip address before
      the function graph tracer runs and it will not be able to trace the
      function that the jprobe is probing.
      
      Link: http://lkml.kernel.org/r/20150114154329.552437962@goodmis.org
      
      Cc: stable@vger.kernel.org # 2.6.30+
      Acked-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      237d28db
    • S
      ftrace: Check both notrace and filter for old hash · 7485058e
      Steven Rostedt (Red Hat) 提交于
      Using just the filter for checking for trampolines or regs is not enough
      when updating the code against the records that represent all functions.
      Both the filter hash and the notrace hash need to be checked.
      
      To trigger this bug (using trace-cmd and perf):
      
       # perf probe -a do_fork
       # trace-cmd start -B foo -e probe
       # trace-cmd record -p function_graph -n do_fork sleep 1
      
      The trace-cmd record at the end clears the filter before it disables
      function_graph tracing and then that causes the accounting of the
      ftrace function records to become incorrect and causes ftrace to bug.
      
      Link: http://lkml.kernel.org/r/20150114154329.358378039@goodmis.org
      
      Cc: stable@vger.kernel.org
      [ still need to switch old_hash_ops to old_ops_hash ]
      Reviewed-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      7485058e
    • S
      ftrace: Fix updating of filters for shared global_ops filters · 8f86f837
      Steven Rostedt (Red Hat) 提交于
      As the set_ftrace_filter affects both the function tracer as well as the
      function graph tracer, the ops that represent each have a shared
      ftrace_ops_hash structure. This allows both to be updated when the filter
      files are updated.
      
      But if function graph is enabled and the global_ops (function tracing) ops
      is not, then it is possible that the filter could be changed without the
      update happening for the function graph ops. This will cause the changes
      to not take place and may even cause a ftrace_bug to occur as it could mess
      with the trampoline accounting.
      
      The solution is to check if the ops uses the shared global_ops filter and
      if the ops itself is not enabled, to check if there's another ops that is
      enabled and also shares the global_ops filter. In that case, the
      modification still needs to be executed.
      
      Link: http://lkml.kernel.org/r/20150114154329.055980438@goodmis.org
      
      Cc: stable@vger.kernel.org # 3.17+
      Reviewed-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      8f86f837