17 Jan, 2015

10 commits

  • 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: Jiri Olsa
    Signed-off-by: Sukadev Bhattiprolu
    Tested-by: Jiri Olsa
    Cc: Jiri Olsa
    Cc: Michael Ellerman
    Link: http://lkml.kernel.org/r/20150114221045.GA17703@us.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Sukadev Bhattiprolu
     
  • 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: Namhyung Kim
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Masami Hiramatsu
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1421234288-22758-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • 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: Wang Nan
    Acked-by: Jiri Olsa
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Li Zefan
    Cc: Masami Hiramatsu
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1421203007-75799-1-git-send-email-wangnan0@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     
  • 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: Vineet Gupta
    Cc: Alexey Brodkin
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1421156604-30603-4-git-send-email-vgupta@synopsys.com
    Signed-off-by: Arnaldo Carvalho de Melo

    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: Vineet Gupta
    Cc: Alexey Brodkin
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1421156604-30603-3-git-send-email-vgupta@synopsys.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Vineet Gupta
     
  • 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: Alexey Brodkin
    Acked-by: Jiri Olsa
    Cc: Borislav Petkov
    Cc: Cody P Schafer
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Vineet Gupta
    Link: http://lkml.kernel.org/r/1420888254-17504-2-git-send-email-vgupta@synopsys.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Alexey Brodkin
     
  • 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: Jan Beulich
    Cc: Adrian Hunter
    Cc: Borislav Petkov
    Cc: David Ahern
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-a1e91dx3apzqw5kbdt7ut21s@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • 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: David Ahern
    Signed-off-by: Namhyung Kim
    Acked-by: Jiri Olsa
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1420763892-15535-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    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: Namhyung Kim
    Signed-off-by: Wang Nan
    Acked-by: Jiri Olsa
    Cc: Jiri Olsa
    Cc: Li Zefan
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    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: Arnaldo Carvalho de Melo

    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: Namhyung Kim
    Acked-by: Masami Hiramatsu
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Masami Hiramatsu
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1420886028-15135-4-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

14 Jan, 2015

1 commit

  • …el/git/shuah/linux-kselftest

    Pull kselftest fixes from Shuah Khan:
    "This update contains three patches to fix one compile error, and two
    run-time bugs. One of them fixes infinite loop on ARM"

    * tag 'linux-kselftest-3.19-rc-5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
    selftests/vm: fix link error for transhuge-stress test
    tools: testing: selftests: mq_perf_tests: Fix infinite loop on ARM
    selftests/exec: allow shell return code of 126

    Linus Torvalds
     

12 Jan, 2015

1 commit

  • Pull perf fixes from Ingo Molnar:
    "Mostly tooling fixes, but also some kernel side fixes: uncore PMU
    driver fix, user regs sampling fix and an instruction decoder fix that
    unbreaks PEBS precise sampling"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf/x86/uncore/hsw-ep: Handle systems with only two SBOXes
    perf/x86_64: Improve user regs sampling
    perf: Move task_pt_regs sampling into arch code
    x86: Fix off-by-one in instruction decoder
    perf hists browser: Fix segfault when showing callchain
    perf callchain: Free callchains when hist entries are deleted
    perf hists: Fix children sort key behavior
    perf diff: Fix to sort by baseline field by default
    perf list: Fix --raw-dump option
    perf probe: Fix crash in dwarf_getcfi_elf
    perf probe: Fix to fall back to find probe point in symbols
    perf callchain: Append callchains only when requested
    perf ui/tui: Print backtrace symbols when segfault occurs
    perf report: Show progress bar for output resorting

    Linus Torvalds
     

11 Jan, 2015

1 commit


09 Jan, 2015

1 commit


08 Jan, 2015

3 commits

  • When perf report on TUI shows callchain it checks first node has
    siblings to determine whether it needs to print percentage value.

    But it missed a case that first node is NULL. So sometimes it segfaults
    like below:

    $ perf top -g
    perf: Segmentation fault
    -------- backtrace --------
    perf[0x4fcefb]
    /usr/lib/libc.so.6(+0x33b20)[0x7f2a35839b20]
    perf(rb_next+0x8)[0x47d3d8]
    perf[0x4f6058]
    perf[0x4f833b]
    perf[0x4f8610]
    perf[0x4f209e]
    perf(ui_browser__run+0x3a)[0x4f2e6a]
    perf[0x4f94ee]
    perf(perf_evlist__tui_browse_hists+0x94)[0x4fbbf4]
    perf[0x444d10]
    /usr/lib/libpthread.so.0(+0x7314)[0x7f2a37070314]
    /usr/lib/libc.so.6(clone+0x6d)[0x7f2a358ee5bd]

    $ addr2line -e `which perf` 0x4f6058
    /home/namhyung/project/linux/tools/perf/ui/browsers/hists.c:553

    I don't know why the backtrace didn't print some symbols..

    Signed-off-by: Namhyung Kim
    Fixes: 4087d11cd945 ("perf hists browser: Print overhead percent value for first-level callchain")
    Cc: Adrian Hunter
    Cc: Andi Kleen
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1419401076-21700-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Markus reported that "perf top -g" can leak ~300MB per second on his
    machine. This is partly because it missed to free callchains when hist
    entries are deleted. Fix it.

    Reported-by: Markus Trippelsdorf
    Signed-off-by: Namhyung Kim
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Markus Trippelsdorf
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20141230053813.GD6081@sejong
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • When perf report --children resorts output fields, it tries to put
    caller above the callee. But this was only meaningful for a same thread
    and doing this requires callchain enabled. So fix its check before
    comparing the callchain depth.

    This also changes the hist accumulation tests: In test 3, xmalloc in
    bash thread should be above than other perf threads due to alphabetical
    order of comm string. Also it's under page_fault in bash thread since
    alphabetical order of dso name. The sys_perf_event_open in perf thread
    is put on the last line since it's self overhead is 0.

    In test 4, the sys_perf_event_open is put above other perf entries that
    have same children overhead since its callchain depth is smaller.

    Signed-off-by: Namhyung Kim
    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1419309381-2593-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

07 Jan, 2015

2 commits


03 Jan, 2015

2 commits

  • The currently perf diff didn't add the baseline and delta (or other
    compute) fields to the sort list so output will be sorted by other
    fields like alphabetical order of DSO or symbol as below example.

    Fix it by adding hpp formats for the fields and provides default compare
    functions.

    Before:

    $ perf diff
    # Event 'cycles'
    #
    # Baseline Delta Shared Object Symbol
    # ........ ....... .................. ...............................
    #
    [bridge] [k] ip_sabotage_in
    [btrfs] [k] __etree_search.constprop.47
    0.01% [btrfs] [k] btrfs_file_mmap
    0.01% -0.01% [btrfs] [k] btrfs_getattr
    [e1000e] [k] e1000_watchdog
    0.00% [kernel.vmlinux] [k] PageHuge
    0.00% [kernel.vmlinux] [k] __acct_update_integrals
    0.00% [kernel.vmlinux] [k] __activate_page
    [kernel.vmlinux] [k] __alloc_fd
    0.02% +0.02% [kernel.vmlinux] [k] __alloc_pages_nodemask
    ...

    After:

    # Baseline Delta Shared Object Symbol
    # ........ ....... .................. ................................
    #
    24.73% -4.62% perf [.] append_chain_children
    7.96% -1.29% perf [.] dso__find_symbol
    6.97% -2.07% libc-2.20.so [.] vfprintf
    4.61% +0.88% libc-2.20.so [.] __fprintf_chk
    4.41% +2.43% perf [.] sort__comm_cmp
    4.10% -0.16% perf [.] comm__str
    4.03% -0.93% perf [.] machine__findnew_thread_time
    3.82% +3.09% perf [.] __hists__add_entry
    2.95% -0.18% perf [.] sort__dso_cmp
    ...

    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1419656793-32756-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Currently, 'perf list --raw-dump' requires extra arguments
    (e.g., hw) to invoke, which breaks bash/zsh completion
    (perf-completion.sh).

    $ perf list --raw-dump
    Error: unknown option `raw-dump'

    usage: perf list [hw|sw|cache|tracepoint|pmu|event_glob]

    After,

    $ perf list --raw-dump
    cpu-cycles instructions cache-references cache-misses ...

    Signed-off-by: Taesoo Kim
    Acked-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Taesoo kim
    Link: http://lkml.kernel.org/r/1419997015-11071-1-git-send-email-tsgatesv@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Taesoo Kim
     

02 Jan, 2015

3 commits

  • David reported that perf can segfault when adding an uprobe event like
    this:

    $ perf probe -x /lib64/libc-2.14.90.so -a 'malloc size=%di'

    (gdb) bt
    #0 parse_eh_frame_hdr (hdr=0x0, hdr_size=2596, hdr_vaddr=71788,
    ehdr=0x7fffffffd390, eh_frame_vaddr=
    0x7fffffffd378, table_entries=0x8808d8, table_encoding=0x8808e0 "") at
    dwarf_getcfi_elf.c:79
    #1 0x000000385f81615a in getcfi_scn_eh_frame (hdr_vaddr=71788,
    hdr_scn=0x8839b0, shdr=0x7fffffffd2f0, scn=,
    ehdr=0x7fffffffd390, elf=0x882b30) at dwarf_getcfi_elf.c:231
    #2 getcfi_shdr (ehdr=0x7fffffffd390, elf=0x882b30) at dwarf_getcfi_elf.c:283
    #3 dwarf_getcfi_elf (elf=0x882b30) at dwarf_getcfi_elf.c:309
    #4 0x00000000004d5bac in debuginfo__find_probes (pf=0x7fffffffd4f0,
    dbg=Unhandled dwarf expression opcode 0xfa) at util/probe-finder.c:993
    #5 0x00000000004d634a in debuginfo__find_trace_events (dbg=0x880840,
    pev=, tevs=0x880f88, max_tevs=) at
    util/probe-finder.c:1200
    #6 0x00000000004aed6b in try_to_find_probe_trace_events (target=0x881b20
    "/lib64/libpthread-2.14.90.so",
    max_tevs=128, tevs=0x880f88, pev=0x859b30) at util/probe-event.c:482
    #7 convert_to_probe_trace_events (target=0x881b20
    "/lib64/libpthread-2.14.90.so", max_tevs=128, tevs=0x880f88,
    pev=0x859b30) at util/probe-event.c:2356
    #8 add_perf_probe_events (pevs=, npevs=1, max_tevs=128,
    target=0x881b20 "/lib64/libpthread-2.14.90.so", force_add=false) at
    util/probe-event.c:2391
    #9 0x000000000044014f in __cmd_probe (argc=,
    argv=0x7fffffffe2f0, prefix=Unhandled dwarf expression opcode 0xfa) at
    at builtin-probe.c:488
    #10 0x0000000000440313 in cmd_probe (argc=5, argv=0x7fffffffe2f0,
    prefix=) at builtin-probe.c:506
    #11 0x000000000041d133 in run_builtin (p=0x805680, argc=5,
    argv=0x7fffffffe2f0) at perf.c:341
    #12 0x000000000041c8b2 in handle_internal_command (argv=,
    argc=) at perf.c:400
    #13 run_argv (argv=, argcp=) at perf.c:444
    #14 main (argc=5, argv=0x7fffffffe2f0) at perf.c:559

    And I found a related commit (5704c8c4fa71 "getcfi_scn_eh_frame: Don't
    crash and burn when .eh_frame bits aren't there.") in elfutils that can
    lead to a unexpected crash like this. To safely use the function, it
    needs to check the .eh_frame section is a PROGBITS type.

    Reported-by: David Ahern
    Tested-by: David Ahern
    Signed-off-by: Namhyung Kim
    Acked-by: Masami Hiramatsu
    Cc: David Ahern
    Cc: Mark Wielaard
    Cc: Masami Hiramatsu
    Link: http://lkml.kernel.org/r/20141230090533.GH6081@sejong
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Fix to fall back to find a probe point in symbols if perf fails to find
    it in debuginfo.

    This can happen when the target function is an alias of another
    function. Such alias doesn't have an entry in debuginfo but in symbols.

    David Ahern reported this problem in https://lkml.org/lkml/2014/12/29/355

    I ensured the problem and deeper investigation discovers it.
    -----
    eu-readelf --debug-dump=info /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.19.so | grep \"malloc\" -A6
    name (strp) "malloc"
    decl_file (data1) 25
    decl_line (data2) 466
    prototyped (flag_present)
    type (ref4) [ 81b5]
    declaration (flag_present)
    [ 8f58] formal_parameter
    --
    name (strp) "malloc"
    decl_file (data1) 23
    decl_line (data2) 466
    prototyped (flag_present)
    type (ref4) [ 9f4a]
    declaration (flag_present)
    sibling (ref4) [ bb29]
    ...
    -----
    All these entires have no instances (all of them are declarations)
    This is why the perf probe failed to find it in debuginfo.

    However, there are some malloc instances in symbols.
    -----
    eu-readelf --symbols /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.19.so | grep malloc$
    1181: 0000000000080700 5332 FUNC LOCAL DEFAULT 12 _int_malloc
    4537: 00000000000831d0 339 FUNC LOCAL DEFAULT 12 __GI___libc_malloc
    5545: 00000000000831d0 339 FUNC LOCAL DEFAULT 12 __malloc
    6063: 00000000000831d0 339 FUNC GLOBAL DEFAULT 12 malloc
    7302: 00000000000831d0 339 FUNC GLOBAL DEFAULT 12 __libc_malloc
    -----
    As you an see, malloc and __libc_malloc have same address, and actually
    __libc_malloc has an entry in debuginfo. So you can set up a probe on
    __libc_malloc.

    To fix this problem shortly, perf probe simply falls back to find probe
    point(malloc) in symbols if it is not found in debuginfo.

    Reported-by: David Ahern
    Signed-off-by: Masami Hiramatsu
    Acked-by: Namhyung Kim
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: yrl.pp-manager.tt@hitachi.com
    Link: http://lkml.kernel.org/r/20141231062747.2087.80961.stgit@localhost.localdomain
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • …it/acme/linux into perf/urgent

    Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

    User visible fixes:

    - Show progress bar in more places while doing histogram processing
    in the hists browser (Namhyung Kim)

    - Print backtrace symbols when segfault occurs in 'report' (Namhyung Kim)

    Infrastructure fixes:

    - Append callchains only when requested (Namhyung Kim)

    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar
     

31 Dec, 2014

1 commit


30 Dec, 2014

1 commit


23 Dec, 2014

5 commits

  • The perf report --children can be called with callchain disabled so no
    need to append callchains. Actually the root of callchain tree is not
    initialized properly in this case.

    Signed-off-by: Namhyung Kim
    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1419223455-4362-7-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • The output will look like below. (I added an error into ui__init() for
    the test).

    $ perf report
    perf: Segmentation fault
    -------- backtrace --------
    perf[0x503781]
    /usr/lib/libc.so.6(+0x33b20)[0x7f1a14f04b20]
    perf(ui__init+0xd5)[0x503645]
    perf(setup_browser+0x97)[0x4ce4e7]
    perf(cmd_report+0xcea)[0x4392ba]
    perf[0x428493]
    perf(main+0x60a)[0x427c0a]
    /usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7f1a14ef1040]
    perf[0x427d29]
    [0x0]

    Signed-off-by: Namhyung Kim
    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1419223455-4362-4-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Sometimes it takes a long time to resort hist entries for output in case
    of a large data file. Show a progress bar window and inform user.

    Signed-off-by: Namhyung Kim
    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1419223455-4362-3-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • …l/git/sashal/linux into core/urgent

    Pull a liblockdep fix from Sasha Levin:

    "A small (but important) fix to the way we detect freeing live locks. We would
    pass a wrong memory region when testing for locks inside freed memory spaces,
    which would trigger false positives."

    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar
     
  • On 32-bit:

    execveat.c: In function 'check_execveat_pathmax':
    execveat.c:183: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'size_t'
    execveat.c:187: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'size_t'

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Shuah Khan

    Geert Uytterhoeven
     

20 Dec, 2014

4 commits

  • sysfs_get_idlestate_count() returns an unsigned int. Returning -ENODEV
    is not the right thing to do here, and in any case is handled the same
    way as if there are no states found.

    Signed-off-by: Prarit Bhargava
    Acked-by: Thomas Renninger
    Signed-off-by: Rafael J. Wysocki

    Prarit Bhargava
     
  • Some operations, like frequency-set, need root privileges. However,
    the way that this is detected is not correct. The getuid() is called,
    while in fact geteuid() should be. This way we can allow
    distributions or users to set SETUID flags on the cpupower binary if
    they want to and let regular users change the cpu frequency governor.

    Signed-off-by: Michal Privoznik
    Acked-by: Thomas Renninger
    Signed-off-by: Rafael J. Wysocki

    Michal Privoznik
     
  • Pull perf fixes and cleanups from Ingo Molnar:
    "A kernel fix plus mostly tooling fixes, but also some tooling
    restructuring and cleanups"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (39 commits)
    perf: Fix building warning on ARM 32
    perf symbols: Fix use after free in filename__read_build_id
    perf evlist: Use roundup_pow_of_two
    tools: Adopt roundup_pow_of_two
    perf tools: Make the mmap length autotuning more robust
    tools: Adopt rounddown_pow_of_two and deps
    tools: Adopt fls_long and deps
    tools: Move bitops.h from tools/perf/util to tools/
    tools: Introduce asm-generic/bitops.h
    tools lib: Move asm-generic/bitops/find.h code to tools/include and tools/lib
    tools: Whitespace prep patches for moving bitops.h
    tools: Move code originally from asm-generic/atomic.h into tools/include/asm-generic/
    tools: Move code originally from linux/log2.h to tools/include/linux/
    tools: Move __ffs implementation to tools/include/asm-generic/bitops/__ffs.h
    perf evlist: Do not use hard coded value for a mmap_pages default
    perf trace: Let the perf_evlist__mmap autosize the number of pages to use
    perf evlist: Improve the strerror_mmap method
    perf evlist: Clarify sterror_mmap variable names
    perf evlist: Fixup brown paper bag on "hint" for --mmap-pages cmdline arg
    perf trace: Provide a better explanation when mmap fails
    ...

    Linus Torvalds
     
  • In mutex destroy code currently we pass to debug_check_no_locks_freed()

    [mem_from, mem_end)

    address region. But debug_check_no_locks_freed() accepts

    mem_from, mem_*len*

    i.e. second parameter is region length, not end address. And it was
    always so, starting from 2006 (fbb9ce95 "lockdep: core").

    Fix it, or else on a mutex destroy we wrongly check
    much-wider-than-mutex region and can find not-yet-released other locks
    there and wrongly report BUGs on them.

    Signed-off-by: Kirill Smelkov
    Signed-off-by: Sasha Levin

    Kirill Smelkov
     

19 Dec, 2014

5 commits

  • Commit 85c116a6cb91 ("perf callchain: Make get_srcline fall back to sym+offset")
    introduces asprintf() call and matches '%ld' to a u64 argument, which is
    incorrect on ARM:

    CC /home/wn/util/srcline.o
    util/srcline.c: In function 'get_srcline':
    util/srcline.c:297:6: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'u64' [-Werror=format]
    cc1: all warnings being treated as errors
    make[1]: *** [/home/wn/util/srcline.o] Error 1

    In addition, all users of get_srcline() use u64 addr, and libbfd
    also use 64 bit bfd_vma as address. This patch also fix
    prototype of get_srcline() and addr2line() to use u64 addr
    instead of unsigned long.

    Signed-off-by: Wang Nan
    Acked-by: Namhyung Kim
    Cc:
    Cc:
    Cc:
    Cc:
    Cc:
    Link: http://lkml.kernel.org/r/1418710746-35943-1-git-send-email-wangnan0@huawei.com
    Signed-off-by: Ingo Molnar

    Wang Nan
     
  • Pull virtio fixes from Michael S Tsirkin:
    "virtio 1.0 related fixes

    Most importantly, this fixes using virtio_pci as a module.

    Further, the big virtio 1.0 conversion missed a couple of places.
    This fixes them up.

    This isn't 100% sparse-clean yet because on many architectures
    get_user triggers sparse warnings when used with __bitwise tag (when
    same tag is on both pointer and value read).

    I posted a patchset to fix it up by adding __force on all arches that
    don't already have it (many do), when that's merged these warnings
    will go away"

    * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    virtio_pci: restore module attributes
    mic/host: fix up virtio 1.0 APIs
    vringh: update for virtio 1.0 APIs
    vringh: 64 bit features
    tools/virtio: add virtio 1.0 in vringh_test
    tools/virtio: add virtio 1.0 in virtio_test
    tools/virtio: enable -Werror
    tools/virtio: 64 bit features
    tools/virtio: fix vringh test
    tools/virtio: more stubs
    virtio: core support for config generation
    virtio_pci: add VIRTIO_PCI_NO_LEGACY
    virtio_pci: move probe to common file
    virtio_pci_common.h: drop VIRTIO_PCI_NO_LEGACY
    virtio_config: fix virtio_cread_bytes
    virtio: set VIRTIO_CONFIG_S_FEATURES_OK on restore

    Linus Torvalds
     
  • Pull more ACPI and power management updates from Rafael Wysocki:
    "These are regression fixes (leds-gpio, ACPI backlight driver,
    operating performance points library, ACPI device enumeration
    messages, cpupower tool), other bug fixes (ACPI EC driver, ACPI device
    PM), some cleanups in the operating performance points (OPP)
    framework, continuation of CONFIG_PM_RUNTIME elimination, a couple of
    minor intel_pstate driver changes, a new MAINTAINERS entry for it and
    an ACPI fan driver change needed for better support of thermal
    management in user space.

    Specifics:

    - Fix a regression in leds-gpio introduced by a recent commit that
    inadvertently changed the name of one of the properties used by the
    driver (Fabio Estevam).

    - Fix a regression in the ACPI backlight driver introduced by a
    recent fix that missed one special case that had to be taken into
    account (Aaron Lu).

    - Drop the level of some new kernel messages from the ACPI core
    introduced by a recent commit to KERN_DEBUG which they should have
    used from the start and drop some other unuseful KERN_ERR messages
    printed by ACPI (Rafael J Wysocki).

    - Revert an incorrect commit modifying the cpupower tool (Prarit
    Bhargava).

    - Fix two regressions introduced by recent commits in the OPP library
    and clean up some existing minor issues in that code (Viresh
    Kumar).

    - Continue to replace CONFIG_PM_RUNTIME with CONFIG_PM throughout the
    tree (or drop it where that can be done) in order to make it
    possible to eliminate CONFIG_PM_RUNTIME (Rafael J Wysocki, Ulf
    Hansson, Ludovic Desroches).

    There will be one more "CONFIG_PM_RUNTIME removal" batch after this
    one, because some new uses of it have been introduced during the
    current merge window, but that should be sufficient to finally get
    rid of it.

    - Make the ACPI EC driver more robust against race conditions related
    to GPE handler installation failures (Lv Zheng).

    - Prevent the ACPI device PM core code from attempting to disable
    GPEs that it has not enabled which confuses ACPICA and makes it
    report errors unnecessarily (Rafael J Wysocki).

    - Add a "force" command line switch to the intel_pstate driver to
    make it possible to override the blacklisting of some systems in
    that driver if needed (Ethan Zhao).

    - Improve intel_pstate code documentation and add a MAINTAINERS entry
    for it (Kristen Carlson Accardi).

    - Make the ACPI fan driver create cooling device interfaces witn
    names that reflect the IDs of the ACPI device objects they are
    associated with, except for "generic" ACPI fans (PNP ID "PNP0C0B").

    That's necessary for user space thermal management tools to be able
    to connect the fans with the parts of the system they are supposed
    to be cooling properly. From Srinivas Pandruvada"

    * tag 'pm+acpi-3.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits)
    MAINTAINERS: add entry for intel_pstate
    ACPI / video: update the skip case for acpi_video_device_in_dod()
    power / PM: Eliminate CONFIG_PM_RUNTIME
    NFC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    ACPI / EC: Fix unexpected ec_remove_handlers() invocations
    Revert "tools: cpupower: fix return checks for sysfs_get_idlestate_count()"
    tracing / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    x86 / PM: Replace CONFIG_PM_RUNTIME in io_apic.c
    PM: Remove the SET_PM_RUNTIME_PM_OPS() macro
    mmc: atmel-mci: use SET_RUNTIME_PM_OPS() macro
    PM / Kconfig: Replace PM_RUNTIME with PM in dependencies
    ARM / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    sound / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    phy / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    video / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    tty / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    spi: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    ACPI / PM: Do not disable wakeup GPEs that have not been enabled
    ACPI / utils: Drop error messages from acpi_evaluate_reference()
    ...

    Linus Torvalds
     
  • This list is supposed to be sorted, to reduce patch collisions.

    Cc: Shuah Khan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • * pm-opp:
    PM / OPP: do error handling at the bottom of dev_pm_opp_add_dynamic()
    PM / OPP: handle allocation of device_opp in a separate routine
    PM / OPP: reuse find_device_opp() instead of duplicating code
    PM / OPP: Staticize __dev_pm_opp_remove()
    PM / OPP: replace kfree with kfree_rcu while freeing 'struct device_opp'

    * pm-cpufreq:
    MAINTAINERS: add entry for intel_pstate
    intel_pstate: Add a few comments
    intel_pstate: add kernel parameter to force loading

    * pm-tools:
    Revert "tools: cpupower: fix return checks for sysfs_get_idlestate_count()"

    Rafael J. Wysocki