14 Jul, 2013

1 commit

  • Pull perf fixes from Thomas Gleixner:
    - fix for do_div() abuse on x86
    - locking fix in perf core
    - a pile of (build) fixes and cleanups in perf tools

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (27 commits)
    perf/x86: Fix incorrect use of do_div() in NMI warning
    perf: Fix perf_lock_task_context() vs RCU
    perf: Remove WARN_ON_ONCE() check in __perf_event_enable() for valid scenario
    perf: Clone child context from parent context pmu
    perf script: Fix broken include in Context.xs
    perf tools: Fix -ldw/-lelf link test when static linking
    perf tools: Revert regression in configuration of Python support
    perf tools: Fix perf version generation
    perf stat: Fix per-socket output bug for uncore events
    perf symbols: Fix vdso list searching
    perf evsel: Fix missing increment in sample parsing
    perf tools: Update symbol_conf.nr_events when processing attribute events
    perf tools: Fix new_term() missing free on error path
    perf tools: Fix parse_events_terms() segfault on error path
    perf evsel: Fix count parameter to read call in event_format__new
    perf tools: fix a typo of a Power7 event name
    perf tools: Fix -x/--exclude-other option for report command
    perf evlist: Enhance perf_evlist__start_workload()
    perf record: Remove -f/--force option
    perf record: Remove -A/--append option
    ...

    Linus Torvalds
     

12 Jul, 2013

1 commit

  • Pull more power management and ACPI updates from Rafael Wysocki:

    - Fix for a recent cpufreq regression that caused WARN() to trigger
    overzealously in a couple of places and spam the kernel log with
    useless garbage as a result. From Viresh Kumar.

    - ACPI dock fix removing a discrepancy between the definition of
    acpi_dock_init(), which says that the function returns int, and its
    header in the header file, which says that it is a void function.
    The function is now defined as void too.

    - ACPI PM fix for failures to update device power states as needed, for
    example, during resume from system suspend, because the old state was
    deeper than the new one, but the new one is not D0.

    - Fix for two debug messages in the ACPI power resources code that
    don't have a newline at the end and make the kernel log difficult to
    read. From Mika Westerberg.

    - Two ACPI cleanups from Naresh Bhat and Haicheng Li.

    - cpupower updates from Thomas Renninger, including Intel Haswell
    support improvements and a new idle-set subcommand among other
    things.

    * tag 'pm+acpi-3.11-rc1-more' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    ACPI / power: add missing newline to debug messages
    cpupower: Add Haswell family 0x45 specific idle monitor to show PC8,9,10 states
    cpupower: Haswell also supports the C-states introduced with SandyBridge
    cpupower: Introduce idle-set subcommand and C-state enabling/disabling
    cpupower: Implement disabling of cstate interface
    cpupower: Make idlestate usage unsigned
    ACPI / fan: Initialize acpi_state variable
    ACPI / scan: remove unused LIST_HEAD(acpi_device_list)
    ACPI / dock: Actually define acpi_dock_init() as void
    ACPI / PM: Fix corner case in acpi_bus_update_power()
    cpufreq: Fix serialization of frequency transitions

    Linus Torvalds
     

11 Jul, 2013

4 commits

  • Pull kbuild updates from Michal Marek:
    - fix for make headers_install argv explosion with too long path
    - scripts/setlocalversion does not call git update-index needlessly
    - fix for the src.rpm produced by make rpm-pkg. The new make
    image_name can be useful also for other packaging tools.
    - scripts/mod/devicetable-offsets.o is not rebuilt during each make run
    - make modules_install dependency fix
    - scripts/sortextable portability fix
    - fix for kbuild to generate the output directory for all object files
    in subdirs.
    - a couple of minor fixes

    * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    kbuild: create directory for dir/file.o
    tools/include: use stdint types for user-space byteshift headers
    Makefile: Fix install error with make -j option
    Fix a build warning in scripts/mod/file2alias.c
    improve modalias building
    scripts/mod: Spelling s/DEVICEVTABLE/DEVICETABLE/
    kbuild: fix error when building from src rpm
    scripts/setlocalversion on write-protected source tree
    Makefile.lib: align DTB quiet_cmd
    kbuild: fix make headers_install when path is too long

    Linus Torvalds
     
  • Pull virtio updates from Rusty Russell:
    "No real surprises"

    * tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    MAINTAINERS: add tools/virtio/ under virtio
    tools/virtio: move module license stub to module.h
    virtio: include asm/barrier explicitly
    virtio: VIRTIO_F_ANY_LAYOUT feature
    lguest: fix example launcher compilation for broken glibc headers.
    virtio-net: fix the race between channels setting and refill
    tools/lguest: real barriers.
    tools/lguest: fix missing rmb().
    virtio_balloon: leak_balloon(): only tell host if we got pages deflated
    virtio-pci: fix leaks of msix_affinity_masks
    Fix comment typo "CONFIG_PAE"

    Linus Torvalds
     
  • 765532c8 (perf script: Finish the rename from trace to script,
    2010-12-23) made a mistake during find-and-replace replacing
    "../../../util/trace-event.h" with "../../../util/script-event.h", a
    non-existent file. Fix this include.

    Signed-off-by: Ramkumar Ramachandra
    Cc: Namhyung Kim
    Link: http://lkml.kernel.org/r/1373364033-7918-3-git-send-email-artagnon@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ramkumar Ramachandra
     
  • Since libelf sometimes uses libpthread, we have to list that after -lelf
    when someone tries to build statically. Else things go boom:

    Makefile:479: *** No libelf.h/libelf found, please install \
    libelf-dev/elfutils-libelf-devel. Stop.

    Similarly, the -ldw test fails as it often uses -lz:

    Makefile:462: No libdw.h found or old libdw.h found or elfutils is older \
    than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev

    And if we add debugging to try-cc, we see:
    + echo '#include

    int main(void)
    {
    Dwarf *dbg = dwarf_begin(0, DWARF_C_READ);
    return (long)dbg;
    }'
    + i686-pc-linux-gnu-gcc -x c - -O2 -pipe -march=atom -mtune=atom -mfpmath=sse -g \
    -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE \
    -ldw -lelf -static -lpthread -lrt -lelf -lm -o .24368
    /usr/lib/libdw.a(dwarf_begin_elf.o):function check_section.isra.1: error: undefined reference to 'inflateInit_'
    /usr/lib/libdw.a(dwarf_begin_elf.o):function check_section.isra.1: error: undefined reference to 'inflate'
    /usr/lib/libdw.a(dwarf_begin_elf.o):function check_section.isra.1: error: undefined reference to 'inflateReset'
    /usr/lib/libdw.a(dwarf_begin_elf.o):function check_section.isra.1: error: undefined reference to 'inflateEnd'

    + echo '#include

    int main(void)
    {
    Elf *elf = elf_begin(0, ELF_C_READ, 0);
    return (long)elf;
    }'
    + i686-pc-linux-gnu-gcc -x c - -O2 -pipe -march=atom -mtune=atom -mfpmath=sse -g \
    -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE \
    -static -lpthread -lrt -lelf -lm -o .19216
    /usr/lib/libelf.a(elf_begin.o):function file_read_elf: error: undefined reference to 'pthread_rwlock_init'
    /usr/lib/libelf.a(elf_begin.o):function __libelf_read_mmaped_file: error: undefined reference to 'pthread_rwlock_init'
    /usr/lib/libelf.a(elf_begin.o):function __libelf_read_mmaped_file: error: undefined reference to 'pthread_rwlock_init'
    /usr/lib/libelf.a(elf_begin.o):function read_file: error: undefined reference to 'pthread_rwlock_init'
    /usr/lib/libelf.a(elf_begin.o):function lock_dup_elf.8072: error: undefined reference to 'pthread_rwlock_unlock'
    /usr/lib/libelf.a(elf_begin.o):function lock_dup_elf.8072: error: undefined reference to 'pthread_rwlock_wrlock'
    /usr/lib/libelf.a(elf_begin.o):function elf_begin: error: undefined reference to 'pthread_rwlock_rdlock'
    /usr/lib/libelf.a(elf_begin.o):function elf_begin: error: undefined reference to 'pthread_rwlock_unlock'

    Signed-off-by: Mike Frysinger
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1368073064-18276-1-git-send-email-vapier@gentoo.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Mike Frysinger
     

10 Jul, 2013

2 commits

  • Pull networking updates from David Miller:
    "This is a re-do of the net-next pull request for the current merge
    window. The only difference from the one I made the other day is that
    this has Eliezer's interface renames and the timeout handling changes
    made based upon your feedback, as well as a few bug fixes that have
    trickeled in.

    Highlights:

    1) Low latency device polling, eliminating the cost of interrupt
    handling and context switches. Allows direct polling of a network
    device from socket operations, such as recvmsg() and poll().

    Currently ixgbe, mlx4, and bnx2x support this feature.

    Full high level description, performance numbers, and design in
    commit 0a4db187a999 ("Merge branch 'll_poll'")

    From Eliezer Tamir.

    2) With the routing cache removed, ip_check_mc_rcu() gets exercised
    more than ever before in the case where we have lots of multicast
    addresses. Use a hash table instead of a simple linked list, from
    Eric Dumazet.

    3) Add driver for Atheros CQA98xx 802.11ac wireless devices, from
    Bartosz Markowski, Janusz Dziedzic, Kalle Valo, Marek Kwaczynski,
    Marek Puzyniak, Michal Kazior, and Sujith Manoharan.

    4) Support reporting the TUN device persist flag to userspace, from
    Pavel Emelyanov.

    5) Allow controlling network device VF link state using netlink, from
    Rony Efraim.

    6) Support GRE tunneling in openvswitch, from Pravin B Shelar.

    7) Adjust SOCK_MIN_RCVBUF and SOCK_MIN_SNDBUF for modern times, from
    Daniel Borkmann and Eric Dumazet.

    8) Allow controlling of TCP quickack behavior on a per-route basis,
    from Cong Wang.

    9) Several bug fixes and improvements to vxlan from Stephen
    Hemminger, Pravin B Shelar, and Mike Rapoport. In particular,
    support receiving on multiple UDP ports.

    10) Major cleanups, particular in the area of debugging and cookie
    lifetime handline, to the SCTP protocol code. From Daniel
    Borkmann.

    11) Allow packets to cross network namespaces when traversing tunnel
    devices. From Nicolas Dichtel.

    12) Allow monitoring netlink traffic via AF_PACKET sockets, in a
    manner akin to how we monitor real network traffic via ptype_all.
    From Daniel Borkmann.

    13) Several bug fixes and improvements for the new alx device driver,
    from Johannes Berg.

    14) Fix scalability issues in the netem packet scheduler's time queue,
    by using an rbtree. From Eric Dumazet.

    15) Several bug fixes in TCP loss recovery handling, from Yuchung
    Cheng.

    16) Add support for GSO segmentation of MPLS packets, from Simon
    Horman.

    17) Make network notifiers have a real data type for the opaque
    pointer that's passed into them. Use this to properly handle
    network device flag changes in arp_netdev_event(). From Jiri
    Pirko and Timo Teräs.

    18) Convert several drivers over to module_pci_driver(), from Peter
    Huewe.

    19) tcp_fixup_rcvbuf() can loop 500 times over loopback, just use a
    O(1) calculation instead. From Eric Dumazet.

    20) Support setting of explicit tunnel peer addresses in ipv6, just
    like ipv4. From Nicolas Dichtel.

    21) Protect x86 BPF JIT against spraying attacks, from Eric Dumazet.

    22) Prevent a single high rate flow from overruning an individual cpu
    during RX packet processing via selective flow shedding. From
    Willem de Bruijn.

    23) Don't use spinlocks in TCP md5 signing fast paths, from Eric
    Dumazet.

    24) Don't just drop GSO packets which are above the TBF scheduler's
    burst limit, chop them up so they are in-bounds instead. Also
    from Eric Dumazet.

    25) VLAN offloads are missed when configured on top of a bridge, fix
    from Vlad Yasevich.

    26) Support IPV6 in ping sockets. From Lorenzo Colitti.

    27) Receive flow steering targets should be updated at poll() time
    too, from David Majnemer.

    28) Fix several corner case regressions in PMTU/redirect handling due
    to the routing cache removal, from Timo Teräs.

    29) We have to be mindful of ipv4 mapped ipv6 sockets in
    upd_v6_push_pending_frames(). From Hannes Frederic Sowa.

    30) Fix L2TP sequence number handling bugs, from James Chapman."

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1214 commits)
    drivers/net: caif: fix wrong rtnl_is_locked() usage
    drivers/net: enic: release rtnl_lock on error-path
    vhost-net: fix use-after-free in vhost_net_flush
    net: mv643xx_eth: do not use port number as platform device id
    net: sctp: confirm route during forward progress
    virtio_net: fix race in RX VQ processing
    virtio: support unlocked queue poll
    net/cadence/macb: fix bug/typo in extracting gem_irq_read_clear bit
    Documentation: Fix references to defunct linux-net@vger.kernel.org
    net/fs: change busy poll time accounting
    net: rename low latency sockets functions to busy poll
    bridge: fix some kernel warning in multicast timer
    sfc: Fix memory leak when discarding scattered packets
    sit: fix tunnel update via netlink
    dt:net:stmmac: Add dt specific phy reset callback support.
    dt:net:stmmac: Add support to dwmac version 3.610 and 3.710
    dt:net:stmmac: Allocate platform data only if its NULL.
    net:stmmac: fix memleak in the open method
    ipv6: rt6_check_neigh should successfully verify neigh if no NUD information are available
    net: ipv6: fix wrong ping_v6_sendmsg return value
    ...

    Linus Torvalds
     
  • Among other things, the following:

    commit 31160d7feab786c991780d7f0ce2755a469e0e5e
    Date: Tue Jan 8 16:22:36 2013 -0500
    perf tools: Fix GNU make v3.80 compatibility issue

    attempts to aid the user by tapping into an existing error message,
    as described in the commit message:

    ... Also fix an issue where _get_attempt was called with only
    one argument. This prevented the error message from printing
    the name of the variable that can be used to fix the problem.

    or more precisely:

    -$(if $($(1)),$(call _ge_attempt,$($(1)),$(1)),$(call _ge_attempt,$(2)))
    +$(if $($(1)),$(call _ge_attempt,$($(1)),$(1)),$(call _ge_attempt,$(2),$(1)))

    However, The "missing" argument was in fact missing on purpose; it's
    absence is a signal that the error message should be skipped, because
    the failure would be due to the default value, not any user-supplied
    value. This can be seen in how `_ge_attempt' uses `gea_err' (in the
    config/utilities.mak file):

    _ge_attempt = $(if $(get-executable),$(get-executable),$(_gea_warn)$(call _gea_err,$(2)))
    _gea_warn = $(warning The path '$(1)' is not executable.)
    _gea_err = $(if $(1),$(error Please set '$(1)' appropriately))

    That is, because the argument is no longer missing, the value `$(1)'
    (associated with `_gea_err') always evaluates to true, thus always
    triggering the error condition that is meant to be reserved for
    only the case when a user explicitly supplies an invalid value.

    Concretely, the result is a regression in the Makefile's configuration
    of python support; rather than gracefully disable support when the
    relevant executables cannot be found according to default values, the
    build process halts in error as though the user explicitly supplied
    the values.

    This new commit simply reverts the offending one-line change.

    Reported-by: Pekka Enberg
    Link: http://lkml.kernel.org/r/CAOJsxLHv17Ys3M7P5q25imkUxQW6LE_vABxh1N3Tt7Mv6Ho4iw@mail.gmail.com
    Signed-off-by: Michael Witten

    Michael Witten
     

09 Jul, 2013

20 commits

  • This fixes build for the vringh test:
    [linux]$ make -C tools/virtio/
    make: Entering directory `/home/mst/scm/linux/tools/virtio'
    cc -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign
    -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD
    -U_FORTIFY_SOURCE -c -o vringh.o ../../drivers/vhost/vringh.c
    ../../drivers/vhost/vringh.c:1010:16: error: expected declaration
    specifiers or ‘...’ before string constant

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • The tag of the perf version is wrongly determined, always the latest tag
    is taken regardless of the HEAD commit:

    $ perf --version
    perf version 3.9.rc8.gd7f5d3
    $ git describe d7f5d3
    v3.9-rc7-154-gd7f5d33
    $ head -n 4 Makefile
    VERSION = 3
    PATCHLEVEL = 9
    SUBLEVEL = 0
    EXTRAVERSION = -rc7

    In other cases no tag might be found.

    This patch fixes this.

    This new implementation handles also the case if there are no tags at
    all found in the git repo but there is a commit id.

    Signed-off-by: Robert Richter
    Link: http://lkml.kernel.org/r/1368006214-12912-1-git-send-email-rric@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Robert Richter
     
  • This patch fixes a problem reported by Andi Kleen on perf
    stat when measuring uncore events:

    # perf stat --per-socket -e uncore_pcu/event=0x0/ -I1000 -a sleep 2

    It would not report counts for the second socket. That was due to a
    cpu mapping bug in print_aggr().

    This patch also fixes the socket numbering bug for
    events.

    Reported-by: Andi Kleen
    Signed-off-by: Stephane Eranian
    Tested-by: Andi Kleen
    Cc: Andi Kleen
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: zheng.z.yan@intel.com
    Link: http://lkml.kernel.org/r/20130705170645.GA32519@quad
    Signed-off-by: Arnaldo Carvalho de Melo

    Stephane Eranian
     
  • When "perf record" was used on a large machine with a lot of CPUs, the
    perf post-processing time (the time after the workload was done until
    the perf command itself exited) could take a lot of minutes and even
    hours depending on how large the resulting perf.data file was.

    While running AIM7 1500-user high_systime workload on a 80-core x86-64
    system with a 3.9 kernel (with only the -s -a options used), the
    workload itself took about 2 minutes to run and the perf.data file had a
    size of 1108.746 MB. However, the post-processing step took more than 10
    minutes.

    With a gprof-profiled perf binary, the time spent by perf was as
    follows:

    % cumulative self self total
    time seconds seconds calls s/call s/call name
    96.90 822.10 822.10 192156 0.00 0.00 dsos__find
    0.81 828.96 6.86 172089958 0.00 0.00 rb_next
    0.41 832.44 3.48 48539289 0.00 0.00 rb_erase

    So 97% (822 seconds) of the time was spent in a single dsos_find()
    function. After analyzing the call-graph data below:

    -----------------------------------------------
    0.00 822.12 192156/192156 map__new [6]
    [7] 96.9 0.00 822.12 192156 vdso__dso_findnew [7]
    822.10 0.00 192156/192156 dsos__find [8]
    0.01 0.00 192156/192156 dsos__add [62]
    0.01 0.00 192156/192366 dso__new [61]
    0.00 0.00 1/45282525 memdup [31]
    0.00 0.00 192156/192230 dso__set_long_name [91]
    -----------------------------------------------
    822.10 0.00 192156/192156 vdso__dso_findnew [7]
    [8] 96.9 822.10 0.00 192156 dsos__find [8]
    -----------------------------------------------

    It was found that the vdso__dso_findnew() function failed to locate
    VDSO__MAP_NAME ("[vdso]") in the dso list and have to insert a new
    entry at the end for 192156 times. This problem is due to the fact that
    there are 2 types of name in the dso entry - short name and long name.
    The initial dso__new() adds "[vdso]" to both the short and long names.
    After that, vdso__dso_findnew() modifies the long name to something
    like /tmp/perf-vdso.so-NoXkDj. The dsos__find() function only compares
    the long name. As a result, the same vdso entry is duplicated many
    time in the dso list. This bug increases memory consumption as well
    as slows the symbol processing time to a crawl.

    To resolve this problem, the dsos__find() function interface was
    modified to enable searching either the long name or the short
    name. The vdso__dso_findnew() will now search only the short name
    while the other call sites search for the long name as before.

    With this change, the cpu time of perf was reduced from 848.38s to
    15.77s and dsos__find() only accounted for 0.06% of the total time.

    0.06 15.73 0.01 192151 0.00 0.00 dsos__find

    Signed-off-by: Waiman Long
    Acked-by: Ingo Molnar
    Cc: "Chandramouleeswaran, Aswin"
    Cc: "Norton, Scott J"
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1368110568-64714-1-git-send-email-Waiman.Long@hp.com
    [ replaced TRUE/FALSE with stdbool.h equivalents, fixing builds where
    those macros are not present (NO_LIBPYTHON=1 NO_LIBPERL=1), fix from Jiri Olsa ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Waiman Long
     
  • The final sample format bit used to be PERF_SAMPLE_STACK_USER which
    neglected to do a final increment of the array pointer. The result is
    that the following parsing might start at the wrong place.

    Signed-off-by: Adrian Hunter
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1372944040-32690-16-git-send-email-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Adrian Hunter
     
  • Signed-off-by: Adrian Hunter
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1372944040-32690-11-git-send-email-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Adrian Hunter
     
  • On the error path, newly allocated 'term' must be freed.

    Signed-off-by: Adrian Hunter
    Acked-by: Jiri Olsa
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1372944040-32690-6-git-send-email-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Adrian Hunter
     
  • On the error path, 'data.terms' may not have been initialised.

    Signed-off-by: Adrian Hunter
    Acked-by: Jiri Olsa
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1372944040-32690-5-git-send-email-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Adrian Hunter
     
  • per realloc above the length of the buffer is alloc_size, not BUFSIZ.
    Adjust length per size as done for buf start.

    Addresses some valgrind complaints:

    ==1870== Syscall param read(buf) points to unaddressable byte(s)
    ==1870== at 0x4E3F610: __read_nocancel (in /lib64/libpthread-2.14.90.so)
    ==1870== by 0x44AEE1: event_format__new (unistd.h:45)
    ==1870== by 0x44B025: perf_evsel__newtp (evsel.c:158)
    ==1870== by 0x451919: add_tracepoint_event (parse-events.c:395)
    ==1870== by 0x479815: parse_events_parse (parse-events.y:292)
    ==1870== by 0x45463A: parse_events_option (parse-events.c:861)
    ==1870== by 0x44FEE4: get_value (parse-options.c:113)
    ==1870== by 0x450767: parse_options_step (parse-options.c:192)
    ==1870== by 0x450C40: parse_options (parse-options.c:422)
    ==1870== by 0x42735F: cmd_record (builtin-record.c:918)
    ==1870== by 0x419D72: run_builtin (perf.c:319)
    ==1870== by 0x4195F2: main (perf.c:376)
    ==1870== Address 0xcffebf0 is 0 bytes after a block of size 8,192 alloc'd
    ==1870== at 0x4C2A62F: malloc (vg_replace_malloc.c:270)
    ==1870== by 0x4C2A7A3: realloc (vg_replace_malloc.c:662)
    ==1870== by 0x44AF07: event_format__new (evsel.c:121)
    ==1870== by 0x44B025: perf_evsel__newtp (evsel.c:158)
    ==1870== by 0x451919: add_tracepoint_event (parse-events.c:395)
    ==1870== by 0x479815: parse_events_parse (parse-events.y:292)
    ==1870== by 0x45463A: parse_events_option (parse-events.c:861)
    ==1870== by 0x44FEE4: get_value (parse-options.c:113)
    ==1870== by 0x450767: parse_options_step (parse-options.c:192)
    ==1870== by 0x450C40: parse_options (parse-options.c:422)
    ==1870== by 0x42735F: cmd_record (builtin-record.c:918)
    ==1870== by 0x419D72: run_builtin (perf.c:319)

    Signed-off-by: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1372793245-4136-2-git-send-email-dsahern@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Currently we have symbol_conf.exclude_other being set as true every time
    so the -x/--exclude-other has nothing to do.

    Also we have no way to see the data with symbol_conf.exclude_other being
    false which is useful sometimes.

    Fixing it by making symbol_conf.exclude_other false by default.

    1) Example without -x option:

    $ perf report -i perf.data.delete -p perf_session__delete -s parent

    + 99.91% [other]
    + 0.08% perf_session__delete
    + 0.00% perf_session__delete_dead_threads
    + 0.00% perf_session__delete_threads

    2) Example with -x option:

    $ ./perf report -i perf.data.delete -p perf_session__delete -s parent -x

    + 96.22% perf_session__delete
    + 1.89% perf_session__delete_dead_threads
    + 1.89% perf_session__delete_threads

    In Example 1) we get the sorted out data together with the rest
    "[other]". This could help us estimate how much time we spent in the
    sorted data.

    In Example 2) the total is just the sorted data.

    Signed-off-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/n/tip-sg8fvu0fyqohf9ur9l38lhkw@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • When perf tries to start a workload, it relies on a pipe which the
    workload was blocked for reading. After closing the pipe on the parent,
    the workload (child) can start the actual work via exec().

    However, if another process was forked after creating a workload, this
    mechanism cannot work since the other process (child) also inherits the
    pipe, so that closing the pipe in parent cannot unblock the workload.
    Fix it by using explicit write call can then closing it.

    For similar reason, the pipe fd on parent should be marked as CLOEXEC so
    that it can be closed after another child exec'ed.

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

    Namhyung Kim
     
  • It no longer have any affect on the processing and is marked as obsolete
    anyway.

    Signed-off-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/n/tip-tvwyspiqr4getzfib2lw06ty@git.kernel.org
    Link: http://lkml.kernel.org/r/1372307120-737-1-git-send-email-namhyung@kernel.org
    [ combined patch removing the -f usage in various sub-commands, such as 'perf sched', etc, by Namhyung Kim ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • It's no longer working and needed.

    Quite straightforward discussion/vote was in here:
    http://marc.info/?t=137028288300004&r=1&w=2

    Signed-off-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/n/tip-8fgdva12hl8w3xzzpsvvg7nx@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • This patch fixes a problem with perf stat whereby on termination it may
    send a SIGTERM signal to random processes on systems with high PID
    recycling. I got some actual bug reports on this.

    There is race between the SIGCHLD and sig_atexit() handlers. This patch
    addresses this problem by clearing child_pid in the SIGCHLD handler.

    Signed-off-by: Stephane Eranian
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20130604154426.GA2928@quad
    Signed-off-by: Arnaldo Carvalho de Melo

    Stephane Eranian
     
  • Currently, lib lk doesn't use CROSS_COMPILE environment variable, so
    cross build always fails.

    This is a quick fix for this problem.

    Signed-off-by: Joonsoo Kim
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1371603750-15053-2-git-send-email-iamjoonsoo.kim@lge.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Joonsoo Kim
     
  • Building perf for android fails because it can't find the definition of
    struct winsize.

    This definition is in termios.h, so I add this header to util.h to solve
    the problem.

    It is missed by commit '2c803e52' which moves get_term_dimensions() from
    builtin-top.c to util.c, but missed to move termios.h header.

    Signed-off-by: Joonsoo Kim
    Acked-by: David Ahern
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1371603750-15053-3-git-send-email-iamjoonsoo.kim@lge.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Joonsoo Kim
     
  • Addresses of allocated memory areas saved to '*src' and '*dst', so we
    need to check them for NULL, not 'src' and 'dst'.

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Hitoshi Mitake
    Cc: Hitoshi Mitake
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1370518503-4230-1-git-send-email-kirill.shutemov@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kirill A. Shutemov
     
  • Fixing build errors with O and DESTDIR make vars set:

    $ make prefix=/usr/local O=$builddir DESTDIR=$destdir -C tools/ perf
    ...
    make[1]: Entering directory `.../.source/perf/tools/perf'
    CC .../.build/perf/perf/util/parse-events.o
    util/parse-events.c:14:32: fatal error: parse-events-bison.h: No such file or directory
    compilation terminated.
    make[1]: *** [.../.build/perf/perf/util/parse-events.o] Error 1
    ...

    and:

    LINK /.../.build/perf/perf/perf
    gcc: error: /.../.build/perf/perf//.../.source/perf/tools/lib/lk/liblk.a: No such file or directory

    Signed-off-by: Robert Richter
    Signed-off-by: Robert Richter
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Robert Richter
    Link: http://lkml.kernel.org/r/1370964158-4135-1-git-send-email-rric@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Robert Richter
     
  • The OUTPUT directory is wrongly determind leading to:

    make[3]: *** No rule to make target `.../.build/perf/PERF-VERSION-FILE'. Stop.

    Fixing this by using the generic approach in script/Makefile.include.

    Signed-off-by: Robert Richter
    Link: http://lkml.kernel.org/r/1367865614-30876-1-git-send-email-rric@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Robert Richter
     
  • Fix having verbose build with V=0, e.g:

    make V=0 -C tools/ perf

    Signed-off-by: Robert Richter
    Link: http://lkml.kernel.org/r/20130503134953.GU8356@rric.localhost
    Signed-off-by: Arnaldo Carvalho de Melo

    Robert Richter
     

07 Jul, 2013

1 commit

  • Pull timer core updates from Thomas Gleixner:
    "The timer changes contain:

    - posix timer code consolidation and fixes for odd corner cases

    - sched_clock implementation moved from ARM to core code to avoid
    duplication by other architectures

    - alarm timer updates

    - clocksource and clockevents unregistration facilities

    - clocksource/events support for new hardware

    - precise nanoseconds RTC readout (Xen feature)

    - generic support for Xen suspend/resume oddities

    - the usual lot of fixes and cleanups all over the place

    The parts which touch other areas (ARM/XEN) have been coordinated with
    the relevant maintainers. Though this results in an handful of
    trivial to solve merge conflicts, which we preferred over nasty cross
    tree merge dependencies.

    The patches which have been committed in the last few days are bug
    fixes plus the posix timer lot. The latter was in akpms queue and
    next for quite some time; they just got forgotten and Frederic
    collected them last minute."

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (59 commits)
    hrtimer: Remove unused variable
    hrtimers: Move SMP function call to thread context
    clocksource: Reselect clocksource when watchdog validated high-res capability
    posix-cpu-timers: don't account cpu timer after stopped thread runtime accounting
    posix_timers: fix racy timer delta caching on task exit
    posix-timers: correctly get dying task time sample in posix_cpu_timer_schedule()
    selftests: add basic posix timers selftests
    posix_cpu_timers: consolidate expired timers check
    posix_cpu_timers: consolidate timer list cleanups
    posix_cpu_timer: consolidate expiry time type
    tick: Sanitize broadcast control logic
    tick: Prevent uncontrolled switch to oneshot mode
    tick: Make oneshot broadcast robust vs. CPU offlining
    x86: xen: Sync the CMOS RTC as well as the Xen wallclock
    x86: xen: Sync the wallclock when the system time is set
    timekeeping: Indicate that clock was set in the pvclock gtod notifier
    timekeeping: Pass flags instead of multiple bools to timekeeping_update()
    xen: Remove clock_was_set() call in the resume path
    hrtimers: Support resuming with two or more CPUs online (but stopped)
    timer: Fix jiffies wrap behavior of round_jiffies_common()
    ...

    Linus Torvalds
     

05 Jul, 2013

6 commits

  • This specific processor supports 3 new package sleep states.
    Provide a monitor, so that the user can see their usage.

    Signed-off-by: Thomas Renninger
    Signed-off-by: Rafael J. Wysocki

    Thomas Renninger
     
  • Add Haswell model numbers to snb_register() as it also supports the
    C-states introduced in SandyBridge processors.

    [rjw: Changelog]
    Signed-off-by: Thomas Renninger
    Signed-off-by: Rafael J. Wysocki

    Thomas Renninger
     
  • Example:

    cpupower idle-set -d 3

    will disable C-state 3 on all processors (set commands are active on
    all CPUs by default), same as:

    cpupower -c all idle-set -d 3

    Signed-off-by: Thomas Renninger
    Signed-off-by: Rafael J. Wysocki

    Thomas Renninger
     
  • Latest kernel allows to disable C-states via:
    /sys/devices/system/cpu/cpuX/cpuidle/stateY/disable

    This patch provides lower level sysfs access functions to make use of
    this interface. A later patch will implement the higher level stuff.

    Signed-off-by: Thomas Renninger
    Signed-off-by: Rafael J. Wysocki

    Thomas Renninger
     
  • Use unsigned int as the data type for some variables related to CPU
    idle states which allows the code to be simplified slightly.

    [rjw: Changelog]
    Signed-off-by: Thomas Renninger
    Signed-off-by: Rafael J. Wysocki

    Thomas Renninger
     
  • Pull trivial tree updates from Jiri Kosina:
    "The usual stuff from trivial tree"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (34 commits)
    treewide: relase -> release
    Documentation/cgroups/memory.txt: fix stat file documentation
    sysctl/net.txt: delete reference to obsolete 2.4.x kernel
    spinlock_api_smp.h: fix preprocessor comments
    treewide: Fix typo in printk
    doc: device tree: clarify stuff in usage-model.txt.
    open firmware: "/aliasas" -> "/aliases"
    md: bcache: Fixed a typo with the word 'arithmetic'
    irq/generic-chip: fix a few kernel-doc entries
    frv: Convert use of typedef ctl_table to struct ctl_table
    sgi: xpc: Convert use of typedef ctl_table to struct ctl_table
    doc: clk: Fix incorrect wording
    Documentation/arm/IXP4xx fix a typo
    Documentation/networking/ieee802154 fix a typo
    Documentation/DocBook/media/v4l fix a typo
    Documentation/video4linux/si476x.txt fix a typo
    Documentation/virtual/kvm/api.txt fix a typo
    Documentation/early-userspace/README fix a typo
    Documentation/video4linux/soc-camera.txt fix a typo
    lguest: fix CONFIG_PAE -> CONFIG_x86_PAE in comment
    ...

    Linus Torvalds
     

04 Jul, 2013

5 commits