20 Dec, 2014

1 commit

  • 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
     

19 Dec, 2014

1 commit

  • 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
     

17 Dec, 2014

16 commits

  • In filename__read_build_id, phdr points to memory in buf, which gets realloced
    before a call to fseek that uses phdr->p_offset. This change stores the value
    of p_offset before buf is realloced, so the fseek can use the value safely.

    Signed-off-by: Mitchell Krome
    Cc: Jiri Olsa
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20141216021612.GA7199@mitchell
    Signed-off-by: Arnaldo Carvalho de Melo

    Mitchell Krome
     
  • And remove the equivalent next_pow2{_l} functions.

    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-hl9ct3wcbs5deai3v5ljmuws@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • If /proc/sys/kernel/perf_event_mlock_kb is not (power of 2 + PAGE_SIZE_in_kb)
    and we let the perf tools do mmap length autosizing based on that, then, for
    non-CAP_IPC_LOCK users when /proc/sys/kernel/perf_event_paranoid is > -1, then
    we get an -EINVAL that ends up in:

    [acme@ssdandy linux]$ trace usleep 1
    Invalid argument
    [acme@ssdandy linux]$ perf record usleep 1
    failed to mmap with 22 (Invalid argument)

    After this fix:

    [acme@ssdandy linux]$ trace usleep 1

    0.806 ( 0.006 ms): munmap(addr: 0x7f7e4740a000, len: 66467) = 0
    0.869 ( 0.002 ms): brk( ) = 0x7bb000
    0.873 ( 0.003 ms): brk(brk: 0x7dc000 ) = 0x7dc000
    0.877 ( 0.001 ms): brk( ) = 0x7dc000
    0.953 ( 0.058 ms): nanosleep(rqtp: 0x7fff26ab9420 ) = 0
    0.959 ( 0.000 ms): exit_group(
    [acme@ssdandy linux]$ perf record usleep 1
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.017 MB perf.data (~759 samples) ]
    [acme@ssdandy linux]$

    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-6p6l5ou6jev6o7ymc4nn1n2a@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Will be used when adopting rounddown_pow_of_two.

    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-9m0tt5300q1ygv51hejjas82@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • So that we better mirror the kernel sources and make it available for
    other tools.

    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-mvfu6x753tksnto3t6412m93@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • In preparation for moving linux/bitops.h from tools/perf/util/ to
    tools/include/.

    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-2wuk8vahl7voz0ie55f07c9k@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • To match the Linux kernel source code structure from where this code came from.

    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-fkbma1h04ki0zzdmp0dpgfyy@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • 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-6xmwcvgm2rvoayv2mf9n5sf8@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • To match the Linux kernel source code structure from where this code came from.

    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-1ldjhvioch1uczilno5e1epl@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • From tools/perf/util/include/linux, so that it becomes accessible to
    other tools/.

    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-uqohgzilp3ebd3cbybnf3luc@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • To match the Linux kernel source code structure from where this code came from.

    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-gubysnp4a8hd98lxoeruak13@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • So far what is in there by default is what we were using: 512KB + the
    control page, but the admin may change that, and if it does to a smaller
    value, all calls to tooling for non root users start failing, requiring
    that the user manually set --mmap_pages/-m.

    Use instead what is in /proc/sys/kernel/perf_event_mlock_kb.

    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-2f6mtm8xu3wo5lhkql6jdblh@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • So that normal users can run 'trace', we were using a hardcoded 1024
    pages value that was more than the default /proc/sys/kernel/perf_event_mlock_kb
    setting.

    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-3banj3yh0sjz41obxtgiel3a@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Considering the per user locked pages limit, improve the message when a
    user uses multiple simultaneous perf mmap calls:

    When the request is more than the current maximum:

    [acme@ssdandy linux]$ trace -m 128 usleep 1
    Error: Operation not permitted.
    Hint: Check /proc/sys/kernel/perf_event_mlock_kb (516 kB) setting.
    Hint: Tried using 516 kB.
    Hint: Try 'sudo sh -c "echo 1032 > /proc/sys/kernel/perf_event_mlock_kb"', or
    Hint: Try using a smaller -m/--mmap-pages value.
    [acme@ssdandy linux]$

    And when the limit is less than that:

    [acme@ssdandy linux]$ trace -m 512 usleep 1
    Error: Operation not permitted.
    Hint: Check /proc/sys/kernel/perf_event_mlock_kb (2056 kB) setting.
    Hint: Tried using 2052 kB.
    Hint: Try using a smaller -m/--mmap-pages value.
    [acme@ssdandy linux]$

    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-yqdie3c8qvdgenwleri267d4@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Prep patch for doing further checks like when the number of pages that
    is being attempted is actually below /proc/sys/kernel/perf_event_mlock_kb but
    the operation fails because the user doesn't have CAP_IPC_LOCK.

    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-wetzlux7mzvofu5cuji5i71i@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • When failing due to asking for a number of mmap pages that is more than
    the max, it was suggesting that an even bigger number of mmap pages
    should be specified, doh, au contraire!

    Before:

    [acme@ssdandy linux]$ trace -m 128 usleep 1
    Error: Operation not permitted.
    Hint: Check /proc/sys/kernel/perf_event_mlock_kb (516 kB) setting.
    Hint: Tried using 516 kB.
    Hint: Try using a bigger -m/--mmap-pages value.
    [acme@ssdandy linux]$

    After:

    [acme@ssdandy linux]$ trace -m 128 usleep 1
    Error: Operation not permitted.
    Hint: Check /proc/sys/kernel/perf_event_mlock_kb (516 kB) setting.
    Hint: Tried using 516 kB.
    Hint: Try using a smaller -m/--mmap-pages value.
    [acme@ssdandy linux]$

    And to (really) clarify what happens above, when what the user requests
    is
    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-8qope8lxb898narnq5kmu2gf@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

12 Dec, 2014

6 commits

  • …/acme/linux into perf/urgent

    Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

    User visible changes:

    - Mark events as (x86 only) in help output for 'perf kvm stat live" (Alexander Yarygin)

    - Provide a better explanation when mmap fails in 'trace' (Arnaldo Carvalho de Melo)

    - Add --buildid-dir option to set cache directory, i.e. use:

    $ perf --buildid-dir /path/to/dir tool --tool-options

    (Jiri Olsa)

    - Fix memcpy/memset 'perf bench' output (Rabin Vicent)

    - Fix 'perf test' attr tests size values to cope with machine state on
    interrupt ABI changes (Jiri Olsa)

    - Fixup callchain type parameter handling error message (Kan Liang)

    Infrastructure changes and cleanups:

    - calloc/xcalloc: Fix argument order (Arjun Sreedharan)

    - Move filename__read_int from tools/perf/ to tools/lib, add sysctl__read_int
    there and use it in place of ad-hoc copies (Arnaldo Carvalho de Melo)

    - Use single strcmp call instead of two (Jiri Olsa)

    - Remove extra debugdir variables in 'perf buildid-cache' (Jiri Olsa)

    - Fix -a segfault related to kcore handling in 'perf buildid-cache' (Jiri Olsa)

    - Move cpumode resolve code to add_callchain_ip (Kan Liang)

    - Merge memset into memcpy 'perf bench' (Rabin Vincent)

    - Change print format from %lu to %PRIu64 in the hists browser (Tom Huynh)

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

    Ingo Molnar
     
  • Pull networking updates from David Miller:

    1) New offloading infrastructure and example 'rocker' driver for
    offloading of switching and routing to hardware.

    This work was done by a large group of dedicated individuals, not
    limited to: Scott Feldman, Jiri Pirko, Thomas Graf, John Fastabend,
    Jamal Hadi Salim, Andy Gospodarek, Florian Fainelli, Roopa Prabhu

    2) Start making the networking operate on IOV iterators instead of
    modifying iov objects in-situ during transfers. Thanks to Al Viro
    and Herbert Xu.

    3) A set of new netlink interfaces for the TIPC stack, from Richard
    Alpe.

    4) Remove unnecessary looping during ipv6 routing lookups, from Martin
    KaFai Lau.

    5) Add PAUSE frame generation support to gianfar driver, from Matei
    Pavaluca.

    6) Allow for larger reordering levels in TCP, which are easily
    achievable in the real world right now, from Eric Dumazet.

    7) Add a variable of napi_schedule that doesn't need to disable cpu
    interrupts, from Eric Dumazet.

    8) Use a doubly linked list to optimize neigh_parms_release(), from
    Nicolas Dichtel.

    9) Various enhancements to the kernel BPF verifier, and allow eBPF
    programs to actually be attached to sockets. From Alexei
    Starovoitov.

    10) Support TSO/LSO in sunvnet driver, from David L Stevens.

    11) Allow controlling ECN usage via routing metrics, from Florian
    Westphal.

    12) Remote checksum offload, from Tom Herbert.

    13) Add split-header receive, BQL, and xmit_more support to amd-xgbe
    driver, from Thomas Lendacky.

    14) Add MPLS support to openvswitch, from Simon Horman.

    15) Support wildcard tunnel endpoints in ipv6 tunnels, from Steffen
    Klassert.

    16) Do gro flushes on a per-device basis using a timer, from Eric
    Dumazet. This tries to resolve the conflicting goals between the
    desired handling of bulk vs. RPC-like traffic.

    17) Allow userspace to ask for the CPU upon what a packet was
    received/steered, via SO_INCOMING_CPU. From Eric Dumazet.

    18) Limit GSO packets to half the current congestion window, from Eric
    Dumazet.

    19) Add a generic helper so that all drivers set their RSS keys in a
    consistent way, from Eric Dumazet.

    20) Add xmit_more support to enic driver, from Govindarajulu
    Varadarajan.

    21) Add VLAN packet scheduler action, from Jiri Pirko.

    22) Support configurable RSS hash functions via ethtool, from Eyal
    Perry.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1820 commits)
    Fix race condition between vxlan_sock_add and vxlan_sock_release
    net/macb: fix compilation warning for print_hex_dump() called with skb->mac_header
    net/mlx4: Add support for A0 steering
    net/mlx4: Refactor QUERY_PORT
    net/mlx4_core: Add explicit error message when rule doesn't meet configuration
    net/mlx4: Add A0 hybrid steering
    net/mlx4: Add mlx4_bitmap zone allocator
    net/mlx4: Add a check if there are too many reserved QPs
    net/mlx4: Change QP allocation scheme
    net/mlx4_core: Use tasklet for user-space CQ completion events
    net/mlx4_core: Mask out host side virtualization features for guests
    net/mlx4_en: Set csum level for encapsulated packets
    be2net: Export tunnel offloads only when a VxLAN tunnel is created
    gianfar: Fix dma check map error when DMA_API_DEBUG is enabled
    cxgb4/csiostor: Don't use MASTER_MUST for fw_hello call
    net: fec: only enable mdio interrupt before phy device link up
    net: fec: clear all interrupt events to support i.MX6SX
    net: fec: reset fep link status in suspend function
    net: sock: fix access via invalid file descriptor
    net: introduce helper macro for_each_cmsghdr
    ...

    Linus Torvalds
     
  • If we ask for a mmap lenght than the max configured via the relevant
    sysctl, provide a better warning, instead of just expanding the EPERM
    returned:

    [acme@ssdandy ~]$ trace -m 256 -e nanosleep sleep 2
    Error: Operation not permitted.
    Hint: Check /proc/sys/kernel/perf_event_mlock_kb (516 kB) setting.
    Hint: Tried using 1028 kB.
    Hint: Try using a bigger -m/--mmap-pages value.

    [acme@ssdandy ~]$ trace -m 128 -e nanosleep sleep 2
    2001.280 (2000.403 ms): nanosleep(rqtp: 0x7fff89a8a7f0) = 0
    [acme@ssdandy ~]$

    An upcoming patch will autotune the request for non-root users when -m
    is not used.

    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-cdvxfz2gycetbkopm9sna1qp@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • To pretty print hints about perf_evlist__mmap errors. Will be used in
    'trace' in the next patch.

    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-2g3gczfwyz0xt3we0s15mqqt@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • 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-pt2u7a3b50oddggecx7rwq2n@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Will be useful for new helpers to read sysctl values.

    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
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

11 Dec, 2014

1 commit

  • As there are now no remaining users of arch_fast_hash(), lets kill
    it entirely.

    This basically reverts commit 71ae8aac3e19 ("lib: introduce arch
    optimized hash library") and follow-up work, that is f.e., commit
    237217546d44 ("lib: hash: follow-up fixups for arch hash"),
    commit e3fec2f74f7f ("lib: Add missing arch generic-y entries for
    asm-generic/hash.h") and last but not least commit 6a02652df511
    ("perf tools: Fix include for non x86 architectures").

    Cc: Francesco Fusco
    Cc: Thomas Graf
    Cc: Arnaldo Carvalho de Melo
    Signed-off-by: Daniel Borkmann
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

10 Dec, 2014

2 commits


09 Dec, 2014

12 commits

  • Following change adjusted 'struct perf_event_attr', but let
    the attr test's sizes untouched:
    60e2364e60e8 perf: Add ability to sample machine state on interrupt

    [jolsa@krava perf]$ ./perf test attr -vv
    --- start ---
    test child forked, pid 9719
    running './tests/attr/test-stat-group1'
    'PERF_TEST_ATTR=/tmp/tmp4drvul ./perf stat -o /tmp/tmp4drvul/perf.data -e '{cycles,instructions}' kill >/dev/null 2>&1' ret 1
    expected size=96, got 104
    FAILED './tests/attr/test-stat-group1' - match failure

    Adjusting test size values for attr test.

    Reported-by: Arnaldo Carvalho de Melo
    Signed-off-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/20141209135301.GC6784@krava.brq.redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • The calloc() and xcalloc() functions takes @nmemb first and then @size. Fix all w/
    pattern "calloc\s*(\s*sizeof".

    Signed-off-by: Arjun Sreedharan
    Cc: "Yann E. MORIN"
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1417866043-1877-1-git-send-email-arjun024@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Arjun Sreedharan
     
  • Using flag to distinguish between branch_history and normal callchain.

    Move the cpumode to add_callchain_ip function.

    No change in behavior.

    Signed-off-by: Kan Liang
    Acked-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1417532814-26208-3-git-send-email-kan.liang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kan Liang
     
  • Fix up parse_callchain_record_opt error message for 'fp', in the past using '-g
    fp' was a valid alternative to '--call-graph fp', which is not the case since:

    commit 09b0fd45ff63413df94cbd832a765076b201edbb
    Author: Jiri Olsa
    Date: Sat Oct 26 16:25:33 2013 +0200

    perf record: Split -g and --call-graph

    I.e. -g means "use the configured unwind data collection method" which has as
    default 'fp', while --call-graph requires passing the method to use.

    Signed-off-by: Kan Liang
    Acked-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1417532814-26208-2-git-send-email-kan.liang@intel.com
    [ split this from a larger patch related to LBR based unwinding ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Kan Liang
     
  • Adding --buildid-dir to be able to set specific cache directory. It's
    going to be handy for buildid tests coming in shortly.

    Signed-off-by: Jiri Olsa
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1417460789-13874-4-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • The kcore_filename is uninitialized and trash value could trigger
    build_id_cache__add_kcore function ending up with segfault.

    Signed-off-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1417460789-13874-7-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • There's no need to copy over the buildid_dir into separate variable with
    no change.

    This is leftover from commit:
    45de34bbe3e1 perf buildid: add perfconfig option to specify buildid cache dir

    that added global buildid_dir variable that holds cache directory, but
    did not cleanup the debugdir copies.

    Signed-off-by: Jiri Olsa
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1417460789-13874-3-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • There's no need to use 2 strcmp calls, one is enough.

    Signed-off-by: Jiri Olsa
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1417460789-13874-2-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • The nr_events variable in tools/perf/ui/browsers/hists.c is of type u64,
    so the print format (%lu) causes 'perf report' to show 0 event count
    when running with 32-bit userspace without redirection.

    This patch fixes that problem by printing nr_events as PRIu64.

    Signed-off-by: Tom Huynh
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Kim Phillips
    Cc: Matt Mullins
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1417541842-9747-1-git-send-email-tom.huynh@freescale.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Tom Huynh
     
  • The memcpy and memset benchmarks return bogus results when iterations >
    0 because the iterations value is not taken into account when
    calculating the final result:

    $ perf bench mem memset --only-prefault --length 1GB --iterations 1
    # Running 'mem/memset' benchmark:
    # Copying 1GB Bytes ...

    20.798669 GB/Sec (with prefault)
    $ perf bench mem memset --only-prefault --length 1GB --iterations 10
    # Running 'mem/memset' benchmark:
    # Copying 1GB Bytes ...

    2.086576 GB/Sec (with prefault)
    $ perf bench mem memset --only-prefault --length 1GB --iterations 100
    # Running 'mem/memset' benchmark:
    # Copying 1GB Bytes ...

    212.840917 MB/Sec (with prefault)

    Fix this.

    Signed-off-by: Rabin Vincent
    Acked-by: Ingo Molnar
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Rabin Vincent
    Cc: Rabin Vincent
    Link: http://lkml.kernel.org/r/1417535441-3965-3-git-send-email-rabin.vincent@axis.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Rabin Vincent
     
  • The memset benchmark is largely copy-pasted from the memcpy benchmark.
    Merge the two now that memcpy is made more generic.

    Signed-off-by: Rabin Vincent
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Rabin Vincent
    Link: http://lkml.kernel.org/r/1417535441-3965-2-git-send-email-rabin.vincent@axis.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Rabin Vincent
     
  • The memset benchmark is largely copy-pasted from the memcpy benchmark.
    Prepare the memcpy file for merge with memset by extracting out a
    generic function.

    Signed-off-by: Rabin Vincent
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Rabin Vincent
    Link: http://lkml.kernel.org/r/1417535441-3965-1-git-send-email-rabin.vincent@axis.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Rabin Vincent
     

02 Dec, 2014

1 commit

  • Enable CCKEY_ADDRESS address history sorting with --branch-history.
    This makes get_srcline display the source lines correctly, otherwise all
    history entries for a function a hunked into one.

    Signed-off-by: Andi Kleen
    Link: http://lkml.kernel.org/r/1416275935-20971-1-git-send-email-andi@firstfloor.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Andi Kleen