13 May, 2017

1 commit

  • Pull perf updates/fixes from Ingo Molnar:
    "Mostly tooling updates, but also two kernel fixes: a call chain
    handling robustness fix and an x86 PMU driver event definition fix"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf/callchain: Force USER_DS when invoking perf_callchain_user()
    tools build: Fixup sched_getcpu feature test
    perf tests kmod-path: Don't fail if compressed modules aren't supported
    perf annotate: Fix AArch64 comment char
    perf tools: Fix spelling mistakes
    perf/x86: Fix Broadwell-EP DRAM RAPL events
    perf config: Refactor a duplicated code for obtaining config file name
    perf symbols: Allow user probes on versioned symbols
    perf symbols: Accept symbols starting at address 0
    tools lib string: Adopt prefixcmp() from perf and subcmd
    perf units: Move parse_tag_value() to units.[ch]
    perf ui gtk: Move gtk .so name to the only place where it is used
    perf tools: Move HAS_BOOL define to where perl headers are used
    perf memswap: Split the byteswap memory range wrappers from util.[ch]
    perf tools: Move event prototypes from util.h to event.h
    perf buildid: Move prototypes from util.h to build-id.h

    Linus Torvalds
     

04 May, 2017

3 commits

  • __kmod_path__parse() uses is_supported_compression() to determine and
    parse out compressed module file extensions. On systems without zlib,
    this test fails and __kmod_path__parse() continues to strcmp "ko" with
    "gz". Don't do this on those systems.

    Signed-off-by: Kim Phillips
    Cc: Alexander Shishkin
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Fixes: 3c8a67f50a1e ("perf tools: Add kmod_path__parse function")
    Link: http://lkml.kernel.org/r/20170503131402.c66e314460026c80cd787b34@arm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kim Phillips
     
  • The commit 0fcb1da4aba "perf annotate: AArch64 support" blindly copied
    the comment character from the original:

    https://lkml.org/lkml/2016/5/19/461

    whereas that same commit shows objdump output utilizing the C++ style
    "//" as the comment delimeter. Since '/' doesn't occur elsewhere in
    objdump output, we retain the single character check, but fix it to be
    '/'.

    Signed-off-by: Kim Phillips
    Cc: Alexander Shishkin
    Cc: Chris Riyder
    Cc: Peter Zijlstra
    Fixes: 0fcb1da4aba6 ("perf annotate: AArch64 support")
    Link: http://lkml.kernel.org/r/20170503131356.be88f977094fb3fa0f49b99d@arm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kim Phillips
     
  • Mostly in the documentation.

    Signed-off-by: Kim Phillips
    Cc: Alexander Shishkin
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20170503131350.cebeecd8bd0f2968417626ab@arm.com
    [ Fix spelling of "parameter" in one of the spell-checked lines ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Kim Phillips
     

03 May, 2017

4 commits

  • Pull trivial tree updates from Jiri Kosina.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial:
    tty: fix comment for __tty_alloc_driver()
    init/main: properly align the multi-line comment
    init/main: Fix double "the" in comment
    Fix dead URLs to ftp.kernel.org
    drivers: Clean up duplicated email address
    treewide: Fix typo in xml/driver-api/basics.xml
    tools/testing/selftests/powerpc: remove redundant CFLAGS in Makefile: "-Wall -O2 -Wall" -> "-O2 -Wall"
    selftests/timers: Spelling s/privledges/privileges/
    HID: picoLCD: Spelling s/REPORT_WRTIE_MEMORY/REPORT_WRITE_MEMORY/
    net: phy: dp83848: Fix Typo
    UBI: Fix typos
    Documentation: ftrace.txt: Correct nice value of 120 priority
    net: fec: Fix typo in error msg and comment
    treewide: Fix typos in printk

    Linus Torvalds
     
  • We were doing the same sequence to figure out what is the config
    pathname to use, fix it by doing it before those two uses.

    Signed-off-by: Taeung Song
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Link: http://lkml.kernel.org/r/1493209268-5543-2-git-send-email-treeze.taeung@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Taeung Song
     
  • Symbol versioning, as in glibc, results in symbols being defined as:

    @[@]

    (Note that "@@" identifies a default symbol, if the symbol name is
    repeated.)

    perf is currently unable to deal with this, and is unable to create user
    probes at such symbols:

    --
    $ nm /lib/powerpc64le-linux-gnu/libpthread.so.0 | grep pthread_create
    0000000000008d30 t __pthread_create_2_1
    0000000000008d30 T pthread_create@@GLIBC_2.17
    $ /usr/bin/sudo perf probe -v -x /lib/powerpc64le-linux-gnu/libpthread.so.0 pthread_create
    probe-definition(0): pthread_create
    symbol:pthread_create file:(null) line:0 offset:0 return:0 lazy:(null)
    0 arguments
    Open Debuginfo file: /usr/lib/debug/lib/powerpc64le-linux-gnu/libpthread-2.19.so
    Try to find probe point from debuginfo.
    Probe point 'pthread_create' not found.
    Error: Failed to add events. Reason: No such file or directory (Code: -2)
    --

    One is not able to specify the fully versioned symbol, either, due to
    syntactic conflicts with other uses of "@" by perf:

    --
    $ /usr/bin/sudo perf probe -v -x /lib/powerpc64le-linux-gnu/libpthread.so.0 pthread_create@@GLIBC_2.17
    probe-definition(0): pthread_create@@GLIBC_2.17
    Semantic error :SRC@SRC is not allowed.
    0 arguments
    Error: Command Parse Error. Reason: Invalid argument (Code: -22)
    --

    This patch ignores versioning for default symbols, thus allowing probes to be
    created for these symbols:

    --
    $ /usr/bin/sudo ./perf probe -x /lib/powerpc64le-linux-gnu/libpthread.so.0 pthread_create
    Added new event:
    probe_libpthread:pthread_create (on pthread_create in /lib/powerpc64le-linux-gnu/libpthread-2.19.so)

    You can now use it in all perf tools, such as:

    perf record -e probe_libpthread:pthread_create -aR sleep 1

    $ /usr/bin/sudo ./perf record -e probe_libpthread:pthread_create -aR ./test 2
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.052 MB perf.data (2 samples) ]
    $ /usr/bin/sudo ./perf script
    test 2915 [000] 19124.260729: probe_libpthread:pthread_create: (3fff99248d38)
    test 2916 [000] 19124.260962: probe_libpthread:pthread_create: (3fff99248d38)
    $ /usr/bin/sudo ./perf probe --del=probe_libpthread:pthread_create
    Removed event: probe_libpthread:pthread_create
    --

    Committer note:

    Change the variable storing the result of strlen() to 'int', to fix the build
    on debian:experimental-x-mipsel, fedora:24-x-ARC-uClibc, ubuntu:16.04-x-arm,
    etc:

    util/symbol.c: In function 'symbol__match_symbol_name':
    util/symbol.c:422:11: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
    if (len < versioning - name)
    ^

    Signed-off-by: Paul A. Clarke
    Tested-by: Arnaldo Carvalho de Melo
    Acked-by: Masami Hiramatsu
    Cc: David Ahern
    Link: http://lkml.kernel.org/r/c2b18d9c-17f8-9285-4868-f58b6359ccac@us.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Paul Clarke
     
  • That is the case of _text on s390, and we have some functions that return an
    address, using address zero to report problems, oops.

    This would lead the symbol loading routines to not use "_text" as the reference
    relocation symbol, or the first symbol for the kernel, but use instead
    "_stext", that is at the same address on x86_64 and others, but not on s390:

    [acme@localhost perf-4.11.0-rc6]$ head -15 /proc/kallsyms
    0000000000000000 T _text
    0000000000000418 t iplstart
    0000000000000800 T start
    000000000000080a t .base
    000000000000082e t .sk8x8
    0000000000000834 t .gotr
    0000000000000842 t .cmd
    0000000000000846 t .parm
    000000000000084a t .lowcase
    0000000000010000 T startup
    0000000000010010 T startup_kdump
    0000000000010214 t startup_kdump_relocated
    0000000000011000 T startup_continue
    00000000000112a0 T _ehead
    0000000000100000 T _stext
    [acme@localhost perf-4.11.0-rc6]$

    Which in turn would make 'perf test vmlinux' to fail because it wouldn't find
    the symbols before "_stext" in kallsyms.

    Fix it by using the return value only for errors and storing the
    address, when the symbol is successfully found, in a provided pointer
    arg.

    Before this patch:

    After:

    [acme@localhost perf-4.11.0-rc6]$ tools/perf/perf test -v 1
    1: vmlinux symtab matches kallsyms :
    --- start ---
    test child forked, pid 40693
    Looking at the vmlinux_path (8 entries long)
    Using /usr/lib/debug/lib/modules/3.10.0-654.el7.s390x/vmlinux for symbols
    ERR : 0: _text not on kallsyms
    ERR : 0x418: iplstart not on kallsyms
    ERR : 0x800: start not on kallsyms
    ERR : 0x80a: .base not on kallsyms
    ERR : 0x82e: .sk8x8 not on kallsyms
    ERR : 0x834: .gotr not on kallsyms
    ERR : 0x842: .cmd not on kallsyms
    ERR : 0x846: .parm not on kallsyms
    ERR : 0x84a: .lowcase not on kallsyms
    ERR : 0x10000: startup not on kallsyms
    ERR : 0x10010: startup_kdump not on kallsyms
    ERR : 0x10214: startup_kdump_relocated not on kallsyms
    ERR : 0x11000: startup_continue not on kallsyms
    ERR : 0x112a0: _ehead not on kallsyms

    test child finished with -1
    ---- end ----
    vmlinux symtab matches kallsyms: FAILED!
    [acme@localhost perf-4.11.0-rc6]$

    After:

    [acme@localhost perf-4.11.0-rc6]$ tools/perf/perf test -v 1
    1: vmlinux symtab matches kallsyms :
    --- start ---
    test child forked, pid 47160

    test child finished with 0
    ---- end ----
    vmlinux symtab matches kallsyms: Ok
    [acme@localhost perf-4.11.0-rc6]$

    Reported-by: Michael Petlan
    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-9x9bwgd3btwdk1u51xie93fz@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

27 Apr, 2017

4 commits


26 Apr, 2017

2 commits


25 Apr, 2017

12 commits


24 Apr, 2017

4 commits


21 Apr, 2017

4 commits


20 Apr, 2017

6 commits