16 Jan, 2015

2 commits

  • commit f61ff6c06dc8f32c7036013ad802c899ec590607 upstream.

    Linus reported perf report command being interrupted due to processing
    of 'out of order' event, with following error:

    Timestamp below last timeslice flush
    0x5733a8 [0x28]: failed to process type: 3

    I could reproduce the issue and in my case it was caused by one CPU
    (mmap) being behind during record and userspace mmap reader seeing the
    data after other CPUs data were already stored.

    This is expected under some circumstances because we need to limit the
    number of events that we queue for reordering when we receive a
    PERF_RECORD_FINISHED_ROUND or when we force flush due to memory
    pressure.

    Reported-by: Linus Torvalds
    Signed-off-by: Jiri Olsa
    Acked-by: Ingo Molnar
    Cc: Andi Kleen
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Linus Torvalds
    Cc: Matt Fleming
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1417016371-30249-1-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Zhiqiang Zhang
    Signed-off-by: Greg Kroah-Hartman

    Jiri Olsa
     
  • commit 9972fc0b859e7aaeb6d2d33bdb591959d9a436c0 upstream.

    Commit 6071c22e1755 "ktest: Rewrite the config-bisect to actually work"
    fixed the config-bisect to work nicely but in doing so it broke
    make_min_config by changing the way assign_configs works.

    The assign_configs function now adds the config to the hash even if
    it is disabled, but changes the hash value to be that of the
    line "# CONFIG_FOO is not set". Unfortunately, the make_min_config
    test only checks to see if the config is removed. It now needs to
    check if the config is in the hash and not set to be disabled.

    Signed-off-by: Steven Rostedt
    Signed-off-by: Greg Kroah-Hartman

    Steven Rostedt (Red Hat)
     

09 Jan, 2015

2 commits

  • commit db86da7cb76f797a1a8b445166a15cb922c6ff85 upstream.

    A security fix in caused the way the unprivileged remount tests were
    using user namespaces to break. Tweak the way user namespaces are
    being used so the test works again.

    Signed-off-by: "Eric W. Biederman"
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • commit 4a44a19b470a886997d6647a77bb3e38dcbfa8c5 upstream.

    - MNT_NODEV should be irrelevant except when reading back mount flags,
    no longer specify MNT_NODEV on remount.

    - Test MNT_NODEV on devpts where it is meaningful even for unprivileged mounts.

    - Add a test to verify that remount of a prexisting mount with the same flags
    is allowed and does not change those flags.

    - Cleanup up the definitions of MS_REC, MS_RELATIME, MS_STRICTATIME that are used
    when the code is built in an environment without them.

    - Correct the test error messages when tests fail. There were not 5 tests
    that tested MS_RELATIME.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     

14 Nov, 2014

1 commit

  • Pull networking fixes from David Miller:

    1) sunhme driver lacks DMA mapping error checks, based upon a report by
    Meelis Roos.

    2) Fix memory leak in mvpp2 driver, from Sudip Mukherjee.

    3) DMA memory allocation sizes are wrong in systemport ethernet driver,
    fix from Florian Fainelli.

    4) Fix use after free in mac80211 defragmentation code, from Johannes
    Berg.

    5) Some networking uapi headers missing from Kbuild file, from Stephen
    Hemminger.

    6) TUN driver gets csum_start offset wrong when VLAN accel is enabled,
    and macvtap has a similar bug, from Herbert Xu.

    7) Adjust several tunneling drivers to set dev->iflink after registry,
    because registry sets that to -1 overwriting whatever we did. From
    Steffen Klassert.

    8) Geneve forgets to set inner tunneling type, causing GSO segmentation
    to fail on some NICs. From Jesse Gross.

    9) Fix several locking bugs in stmmac driver, from Fabrice Gasnier and
    Giuseppe CAVALLARO.

    10) Fix spurious timeouts with NewReno on low traffic connections, from
    Marcelo Leitner.

    11) Fix descriptor updates in enic driver, from Govindarajulu
    Varadarajan.

    12) PPP calls bpf_prog_create() with locks held, which isn't kosher.
    Fix from Takashi Iwai.

    13) Fix NULL deref in SCTP with malformed INIT packets, from Daniel
    Borkmann.

    14) psock_fanout selftest accesses past the end of the mmap ring, fix
    from Shuah Khan.

    15) Fix PTP timestamping for VLAN packets, from Richard Cochran.

    16) netlink_unbind() calls in netlink pass wrong initial argument, from
    Hiroaki SHIMODA.

    17) vxlan socket reuse accidently reuses a socket when the address
    family is different, so we have to explicitly check this, from
    Marcelo Lietner.

    18) Fix missing include in nft_reject_bridge.c breaking the build on ppc
    and other architectures, from Guenter Roeck.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (75 commits)
    vxlan: Do not reuse sockets for a different address family
    smsc911x: power-up phydev before doing a software reset.
    lib: rhashtable - Remove weird non-ASCII characters from comments
    net/smsc911x: Fix delays in the PHY enable/disable routines
    net/smsc911x: Fix rare soft reset timeout issue due to PHY power-down mode
    netlink: Properly unbind in error conditions.
    net: ptp: fix time stamp matching logic for VLAN packets.
    cxgb4 : dcb open-lldp interop fixes
    selftests/net: psock_fanout seg faults in sock_fanout_read_ring()
    net: bcmgenet: apply MII configuration in bcmgenet_open()
    net: bcmgenet: connect and disconnect from the PHY state machine
    net: qualcomm: Fix dependency
    ixgbe: phy: fix uninitialized status in ixgbe_setup_phy_link_tnx
    net: phy: Correctly handle MII ioctl which changes autonegotiation.
    ipv6: fix IPV6_PKTINFO with v4 mapped
    net: sctp: fix memory leak in auth key management
    net: sctp: fix NULL pointer dereference in af->from_addr_param on malformed packet
    net: ppp: Don't call bpf_prog_create() in ppp_lock
    net/mlx4_en: Advertize encapsulation offloads features only when VXLAN tunnel is set
    cxgb4 : Fix bug in DCB app deletion
    ...

    Linus Torvalds
     

12 Nov, 2014

1 commit

  • The while loop in sock_fanout_read_ring() checks mmap region
    bounds after access, causing it to segfault. Fix it to check
    count before accessing header->tp_status. This problem can be
    reproduced consistently when the test in run as follows:

    make -C tools/testing/selftests TARGETS=net run_tests
    or
    make run_tests from tools/testing/selftests
    or
    make run_test from tools/testing/selftests/net

    Signed-off-by: Shuah Khan
    Signed-off-by: David S. Miller

    Shuah Khan
     

05 Nov, 2014

1 commit

  • Pull ftracetest fix from Steven Rostedt:
    "Running the ftracetests on a machine that had the debugfs file system
    mounted in two locations caused the ftracetests to fail. This is
    because the ftracetests script does a grep of the /proc/mounts file to
    find where the debugfs file system is mounted. If it is mounted
    twice, then the grep returns two lines instead of just one. This
    causes the ftracetests to get confused and fail.

    Use "head -1" to only return the first mount point for debugfs"

    * tag 'ftracetest-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    ftracetest: Take the first debugfs mount found

    Linus Torvalds
     

04 Nov, 2014

1 commit

  • Running ftracetests on a box that mounted debugfs in two locations
    made the ftracetests fail. This is because the tests uses a grep
    of debugfs from the /proc/mounts file to find the debugfs mount
    point, and then appends "/tracing" to that string to get the tracing
    directory.

    If the debugfs directory is mounted twice, then that grep will return
    two answers and appending "/tracing" to a string with two lines will
    not work.

    Use "head -1" to only take the first mount point found.

    Acked-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     

01 Nov, 2014

1 commit

  • Pull perf fixes from Ingo Molnar:
    "Mostly tooling fixes, plus on the kernel side:

    - a revert for a newly introduced PMU driver which isn't complete yet
    and where we ran out of time with fixes (to be tried again in
    v3.19) - this makes up for a large chunk of the diffstat.

    - compilation warning fixes

    - a printk message fix

    - event_idx usage fixes/cleanups"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf probe: Trivial typo fix for --demangle
    perf tools: Fix report -F dso_from for data without branch info
    perf tools: Fix report -F dso_to for data without branch info
    perf tools: Fix report -F symbol_from for data without branch info
    perf tools: Fix report -F symbol_to for data without branch info
    perf tools: Fix report -F mispredict for data without branch info
    perf tools: Fix report -F in_tx for data without branch info
    perf tools: Fix report -F abort for data without branch info
    perf tools: Make CPUINFO_PROC an array to support different kernel versions
    perf callchain: Use global caching provided by libunwind
    perf/x86/intel: Revert incomplete and undocumented Broadwell client support
    perf/x86: Fix compile warnings for intel_uncore
    perf: Fix typos in sample code in the perf_event.h header
    perf: Fix and clean up initialization of pmu::event_idx
    perf: Fix bogus kernel printk
    perf diff: Add missing hists__init() call at tool start

    Linus Torvalds
     

29 Oct, 2014

10 commits

  • Replace "Disable" with "Enable", since --demangle option enables symbol
    demangling, not disable it.

    perf probe has --demangle and --no-demangle options, but the
    command-line help (--help) shows only --demangle option. So it should
    explain about --demangle.

    Signed-off-by: Masami Hiramatsu
    Cc: Hemant Kumar
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Link: http://lkml.kernel.org/r/20141027203124.21219.68278.stgit@localhost.localdomain
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • The branch field sorting code assumes hist_entry::branch_info is
    allocated, which is wrong and following perf session ends up with report
    segfault.

    $ perf record ls
    $ perf report -F dso_from
    perf: Segmentation fault

    Checking that hist_entry::branch_info is valid and display "N/A" string
    in snprint callback if it's not.

    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/r/1413468427-31049-8-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • The branch field sorting code assumes hist_entry::branch_info is
    allocated, which is wrong and following perf session ends up with report
    segfault.

    $ perf record ls
    $ perf report -F dso_to
    perf: Segmentation fault

    Checking that hist_entry::branch_info is valid and display "N/A" string
    in snprint callback if it's not.

    Signed-off-by: Jiri Olsa
    Acked-by: Namhyung Kim
    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/r/1413468427-31049-7-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • The branch field sorting code assumes hist_entry::branch_info is
    allocated, which is wrong and following perf session ends up with report
    segfault.

    $ perf record ls
    $ perf report -F symbol_from
    perf: Segmentation fault

    Checking that hist_entry::branch_info is valid and display "N/A" string
    in snprint callback if it's not.

    Signed-off-by: Jiri Olsa
    Acked-by: Namhyung Kim
    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/r/1413468427-31049-6-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • The branch field sorting code assumes hist_entry::branch_info is
    allocated, which is wrong and following perf session ends up with report
    segfault.

    $ perf record ls
    $ perf report -F symbol_to
    perf: Segmentation fault

    Checking that hist_entry::branch_info is valid and display "N/A" string
    in snprint callback if it's not.

    Signed-off-by: Jiri Olsa
    Acked-by: Namhyung Kim
    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/r/1413468427-31049-5-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • The branch field sorting code assumes hist_entry::branch_info is
    allocated, which is wrong and following perf session ends up with report
    segfault.

    $ perf record ls
    $ perf report -F mispredict
    perf: Segmentation fault

    Checking that hist_entry::branch_info is valid and display "N/A" string
    in snprint callback if it's not.

    Signed-off-by: Jiri Olsa
    Acked-by: Namhyung Kim
    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/r/1413468427-31049-4-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • The branch field sorting code assumes hist_entry::branch_info is
    allocated, which is wrong and following perf session ends up with report
    segfault.

    $ perf record ls
    $ perf report -F in_tx
    perf: Segmentation fault

    Checking that hist_entry::branch_info is valid and display "N/A" string
    in snprint callback if it's not.

    Signed-off-by: Jiri Olsa
    Acked-by: Namhyung Kim
    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/r/1413468427-31049-3-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • The branch field sorting code assumes hist_entry::branch_info is
    allocated, which is wrong and following perf session ends up with report
    segfault.

    $ perf record ls
    $ perf report -F abort
    perf: Segmentation fault

    Checking that hist_entry::branch_info is valid and display "N/A" string
    in snprint callback if it's not.

    Signed-off-by: Jiri Olsa
    Acked-by: Namhyung Kim
    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/r/1413468427-31049-2-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • After kernel 3.7 (commit b4b8f770eb10a1bccaf8aa0ec1956e2dd7ed1e0a),
    /proc/cpuinfo replaces 'Processor' to 'model name'.

    This patch makes CPUINFO_PROC to an array and provides two choices for
    ARM, makes it compatible for different kernel version.

    v1 -> v2: minor changes as suggested by Namhyung Kim:

    - Doesn't pass @h and @evlist to __write_cpudesc;
    - Coding style fix.

    v2 -> v3:
    - Rebase:
    git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git perf/core

    Signed-off-by: Wang Nan
    Acked-by: Namhyung Kim
    Cc: Li Zefan
    Cc: Namhyung Kim
    Link: http://lkml.kernel.org/r/1414115126-7479-1-git-send-email-wangnan0@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     
  • The libunwind provides two caching policy which are global and
    per-thread. As perf unwinds callchains in a single thread, it'd
    sufficient to use global caching.

    This speeds up my perf report from 14s to 7s on a ~260MB data file.
    Although the output sometimes contains a slight difference (~0.01% in
    terms of number of lines printed) on callchains which were not resolved.

    Signed-off-by: Namhyung Kim
    Acked-by: Jean Pihet
    Cc: Arun Sharma
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jean Pihet
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1412556363-26229-4-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

23 Oct, 2014

1 commit

  • It also uses hists/hist_entries, hists__init() should be called before
    creating any evsels.

    Otherwise no extra space will be allocated per perf_evsel nor this space
    will be initialized when allocating a new perf_evsel instance, resulting
    in reads/writes to non allocated space, oops. Fix it.

    Signed-off-by: Kan Liang
    Link: http://lkml.kernel.org/r/1414004561-22096-1-git-send-email-kan.liang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kan Liang
     

21 Oct, 2014

2 commits

  • Eliminate an error message for batch-mode processing on unix
    systems. ACPICA BZ 1114.

    This patch is mainly for fixing the issues of acpiexec which is not in the
    Linux upstream.

    Link: https://bugs.acpica.org/show_bug.cgi?id=1114
    Signed-off-by: Bob Moore
    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Bob Moore
     
  • The acpidump currently always uses ACPI 2.0 format to dump RSDP, this patch
    adds ACPI 1.0 RSDP support.

    Link: https://bugs.acpica.org/show_bug.cgi?id=1097
    Link: https://bugs.acpica.org/show_bug.cgi?id=1103
    Signed-off-by: Lv Zheng
    Reported-and-tested-by: Rudolf Marek
    Reported-and-tested-by: Rafal
    Signed-off-by: Bob Moore
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

18 Oct, 2014

2 commits

  • Adding period as a default output column in script command fo hardware,
    software and raw events.

    If PERF_SAMPLE_PERIOD sample type is defined in perf.data, following
    will be displayed in perf script output:

    $ perf script
    ls 8034 57477.887209: 250000 task-clock: ffffffff81361d72 memset ([kernel.kallsyms])
    ls 8034 57477.887464: 250000 task-clock: ffffffff816f6d92 _raw_spin_unlock_irqrestore ([kernel.kallsyms])
    ls 8034 57477.887708: 250000 task-clock: ffffffff811a94f0 do_munmap ([kernel.kallsyms])
    ls 8034 57477.887959: 250000 task-clock: 34080916c6 get_next_seq (/usr/lib64/libc-2.17.so)
    ls 8034 57477.888208: 250000 task-clock: 3408079230 _IO_doallocbuf (/usr/lib64/libc-2.17.so)
    ls 8034 57477.888717: 250000 task-clock: ffffffff814242c8 n_tty_write ([kernel.kallsyms])
    ls 8034 57477.889285: 250000 task-clock: 3408076402 fwrite_unlocked (/usr/lib64/libc-2.17.so)

    Signed-off-by: Jiri Olsa
    Cc: David Ahern
    Cc: "Jen-Cheng(Tommy) Huang"
    Cc: Andi Kleen
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jen-Cheng(Tommy) Huang
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1408977943-16594-10-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Adding period data column to be displayed in perf script. It's possible
    to get period values using -f option, like:

    $ perf script -f comm,tid,time,period,ip,sym,dso
    :26019 26019 52414.329088: 3707 ffffffff8105443a native_write_msr_safe ([kernel.kallsyms])
    :26019 26019 52414.329088: 44 ffffffff8105443a native_write_msr_safe ([kernel.kallsyms])
    :26019 26019 52414.329093: 1987 ffffffff8105443a native_write_msr_safe ([kernel.kallsyms])
    :26019 26019 52414.329093: 6 ffffffff8105443a native_write_msr_safe ([kernel.kallsyms])
    ls 26019 52414.329442: 537558 3407c0639c _dl_map_object_from_fd (/usr/lib64/ld-2.17.so)
    ls 26019 52414.329442: 2099 3407c0639c _dl_map_object_from_fd (/usr/lib64/ld-2.17.so)
    ls 26019 52414.330181: 1242100 34080917bb get_next_seq (/usr/lib64/libc-2.17.so)
    ls 26019 52414.330181: 3774 34080917bb get_next_seq (/usr/lib64/libc-2.17.so)
    ls 26019 52414.331427: 1083662 ffffffff810c7dc2 update_curr ([kernel.kallsyms])
    ls 26019 52414.331427: 360 ffffffff810c7dc2 update_curr ([kernel.kallsyms])

    Signed-off-by: Jiri Olsa
    Acked-by: David Ahern
    Cc: "Jen-Cheng(Tommy) Huang"
    Cc: Andi Kleen
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jen-Cheng(Tommy) Huang
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1408977943-16594-9-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

17 Oct, 2014

3 commits

  • The only thing we need is a forward declaration for 'struct cgroup_sel',
    that is inside 'struct perf_evsel'.

    Include cgroup.h instead on the tools that support cgroups.

    Cc: Adrian Hunter
    Cc: Borislav Petkov
    Cc: David Ahern
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Jean Pihet
    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-b7kuymbgf0zxi5viyjjtu5hk@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • It was being found, by chance, because evsel.h needlessly includes
    util/cgroup.h, which will be sorted out in a following patch.

    Cc: Adrian Hunter
    Cc: Borislav Petkov
    Cc: David Ahern
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Jean Pihet
    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-xsvxr747wkkpg1ay9dramorr@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • So that when an evsel is embedded into other struct it can free up
    resources calling perf_evsel__exit().

    Cc: Adrian Hunter
    Cc: Borislav Petkov
    Cc: David Ahern
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Jean Pihet
    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-n1w68pfe9m2vkhm4sqs8y1en@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

16 Oct, 2014

13 commits

  • Process of analyzing events caused by 2 functions: mmap_read() and
    finished_round().

    During mmap_read(), perf receives events from shared memory, queues
    their pointers for further processing in finished_round() and notifies
    the kernel that the events have been processed.

    By the time when finished_round() is invoked, queued events can be
    overwritten by the kernel, so the finished_round() occurs on potentially
    corrupted memory.

    Since there is no place where the event can be safely consumed, let's
    copy events when queueing.

    Signed-off-by: Alexander Yarygin
    Cc: Christian Borntraeger
    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/1412347212-28237-3-git-send-email-yarygin@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Alexander Yarygin
     
  • When processing events the session code has an ordered samples queue
    which is used to time-sort events coming in across multiple mmaps. At a
    later point in time samples on the queue are flushed up to some
    timestamp at which point the event is actually processed.

    When analyzing events live (ie., record/analysis path in the same
    command) there is a race that leads to corrupted events and parse errors
    which cause perf to terminate. The problem is that when the event is
    placed in the ordered samples queue it is only a reference to the event
    which is really sitting in the mmap buffer. Even though the event is
    queued for later processing the mmap tail pointer is updated which
    indicates to the kernel that the event has been processed. The race is
    flushing the event from the queue before it gets overwritten by some
    other event. For commands trying to process events live (versus just
    writing to a file) and processing a high rate of events this leads to
    parse failures and perf terminates.

    Examples hitting this problem are 'perf kvm stat live', especially with
    nested VMs which generate 100,000+ traces per second, and a command
    processing scheduling events with a high rate of context switching --
    e.g., running 'perf bench sched pipe'.

    This patch offers live commands an option to copy the event when it is
    placed in the ordered samples queue.

    Based on a patch from David Ahern

    Signed-off-by: Alexander Yarygin
    Acked-by: Jiri Olsa
    Cc: Christian Borntraeger
    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/1412347212-28237-2-git-send-email-yarygin@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Alexander Yarygin
     
  • This patch fix spelling typos found in tool/perf/Documentation.

    Signed-off-by: Masanari Iida
    Acked-by: Randy Dunlap
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Randy Dunlap
    Link: http://lkml.kernel.org/r/1410275930-17207-1-git-send-email-standby24x7@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Masanari Iida
     
  • This is mechanical changes only for accounting access to thread->priv
    properly in the source level.

    Signed-off-by: Namhyung Kim
    Acked-by: Jiri Olsa
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1412556363-26229-6-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • This is mechanical changes only for accounting access to thread->priv
    properly in the source level.

    Signed-off-by: Namhyung Kim
    Acked-by: Jiri Olsa
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1412556363-26229-5-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • The unw_addr_space_t in libunwind represents an address space to be used
    for stack unwinding. It doesn't need to be create/destory everytime to
    unwind callchain (as in get_entries) and can have a same lifetime as
    thread (unless exec called).

    So move the address space construction/destruction logic to the thread
    lifetime handling functions. This is a preparation to enable caching in
    the unwind library.

    Note that it saves unw_addr_space_t object using thread__set_priv(). It
    seems currently only used by perf trace and perf kvm stat commands which
    don't use callchain.

    Signed-off-by: Namhyung Kim
    Acked-by: Jean Pihet
    Acked-by: Jiri Olsa
    Cc: Arun Sharma
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jean Pihet
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1412556363-26229-3-git-send-email-namhyung@kernel.org
    [ Fixup unwind-libunwind.c missing CALLCHAIN_DWARF definition, added
    missing __maybe_unused on unused parameters in stubs at util/unwind.h ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Normally the callchain_param.record_mode is used only for record path.
    But as it might need to prepare something for dwarf unwinding, setup
    this info for perf report too.

    Signed-off-by: Namhyung Kim
    Acked-by: Jiri Olsa
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jean Pihet
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1412556363-26229-2-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Fix for double free bug in tools/perf due to dangling thread_map pointer
    in perf_evlist struct.

    Code path excercised when perf stat -C switch is used but not set and is
    followed by another switch.

    Example:

    perf stat -C -e.

    Signed-off-by: Yasser Shalabi
    Acked-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1412437077-13109-1-git-send-email-yassershalabi@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Yasser Shalabi
     
  • Add test case in automated tests suite. It checks not only the two types
    of pmu event stytle formats "pmu_event_name" and "cpu/pmu_event_name/",
    but also the different formats mixtures which are more likely to trigger
    parse issue.

    The patch set including this one has been tested by the perf automated
    test:

    ./perf test parse -v"

    On haswell, ivybridge and Romley platform.

    The patch set also has been tested on haswell by the following script.

    Note: please make sure that your test system support TSX and
    L1-dcache-loads events. Otherwise, you may want to change the events to
    other pmu events.

    [lk@localhost ~]$ cat perf_style_test.sh
    # hardware events + kernel pmu event with different style
    perf stat -x, -e cycles,mem-stores,tx-start sleep 2
    perf stat -x, -e cpu-cycles,cycles-ct,cycles-t sleep 2
    perf stat -x, -e cycles,cpu/cycles-ct/,cpu/cycles-t/ sleep 2
    perf stat -x, -e instructions,cpu/tx-start/ sleep 2
    perf stat -x, -e '{cycles,tx-start}' sleep 2
    perf stat -x, -e '{cycles,cpu/tx-start/}' sleep 2

    # HW Cache event + kernel pmu event with different style
    perf stat -x, -e L1-dcache-loads,cpu/mem-stores/,tx-start sleep 2
    perf stat -x, -e L1-dcache-loads,mem-stores,cpu/tx-start/ sleep 2
    perf stat -x, -e '{L1-dcache-loads,mem-stores}' sleep 2
    perf stat -x, -e '{L1-dcache-loads,cpu/tx-start/}' sleep 2

    # Raw event + kernel pmu event with different style:
    perf stat -x, -e cpu/event=0xc0,umask=0x00/,mem-loads,cpu/mem-stores/ sleep 2
    perf stat -x, -e cpu/event=0xc0,umask=0x00/,tx-start,cpu/el-start/ sleep 2
    perf stat -x, -e '{cpu/event=0xc0,umask=0x00/,tx-start}' sleep 2

    Signed-off-by: Kan Liang
    Acked-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Link: http://lkml.kernel.org/r/1412694532-23391-5-git-send-email-kan.liang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kan Liang
     
  • Add new rules for kernel PMU event.

    Currently, the patch only want to handle the PMU event name as "a-b" and
    "a".

    event_pmu:
    PE_KERNEL_PMU_EVENT sep_dc
    |
    PE_PMU_EVENT_PRE '-' PE_PMU_EVENT_SUF sep_dc

    PE_KERNEL_PMU_EVENT token is for
    cycles-ct/cycles-t/mem-loads/mem-stores.

    The prefix cycles is mixed up with cpu-cycles. loads and stores are
    mixed up with cache event So they have to be hardcode in lex.

    PE_PMU_EVENT_PRE and PE_PMU_EVENT_SUF tokens are for other PMU events.

    The lex looks generic identifier up in the table and return the matched
    token. If there is no match, generic PE_NAME token will be return.

    Using the rules, kernel PMU event could use new style format without //

    so you can use:

    perf record -e mem-loads ...

    instead of:

    perf record -e cpu/mem-loads/

    Signed-off-by: Kan Liang
    Acked-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Link: http://lkml.kernel.org/r/1412694532-23391-4-git-send-email-kan.liang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kan Liang
     
  • There are two types of event formats for PMU events. E.g. el-abort OR
    cpu/el-abort/. However, the lexer mistakenly recognizes the simple style
    format as two events.

    The parse_events_pmu_check function uses bsearch to search the name in
    known pmu event list. It can tell the lexer that the name is a PE_NAME
    or a PMU event name prefix or a PMU event name suffix. All these
    information will be used for accurately parsing kernel PMU events.

    The pmu events list will be read from sysfs at runtime.

    Note: Currently, the patch only want to handle the PMU event name as
    "a-b" and "a". The only exception, "stalled-cycles-frontend" and
    "stalled-cycles-fronted", are already hardcoded in lexer.

    Signed-off-by: Kan Liang
    Acked-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Link: http://lkml.kernel.org/r/1412694532-23391-3-git-send-email-kan.liang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kan Liang
     
  • This reverts commit 50e200f07948 ("perf tools: Default to cpu// for
    events v5")

    The fixup cannot handle the case that
    new style format(which without //) mixed with
    other different formats.

    For example,
    group events with new style format: {mem-stores,mem-loads}
    some hardware event + new style event: cycles,mem-loads
    Cache event + new style event: LLC-loads,mem-loads
    Raw event + new style event:
    cpu/event=0xc8,umask=0x08/,mem-loads
    old style event and new stytle mixture: mem-stores,cpu/mem-loads/

    Signed-off-by: Kan Liang
    Acked-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Link: http://lkml.kernel.org/r/1412694532-23391-2-git-send-email-kan.liang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kan Liang
     
  • When 'perf top' is run, one can't easily find a difference
    between -z option and normal output.
    So I added a visual cue to know whether it is the zeroing or not.

    Output is as below.

    Before:
    $ perf top

    Samples: 61K of event 'cycles', Event count (approx.): 3908136933
    Overhead Shared Object Symbol
    1.42% firefox [.] 0x0000000000011e76
    1.32% libpthread-2.17.so [.] pthread_mutex_lock

    If you press key 'z' or run with zero option like '$ perf top --zero', it is as below.

    After:
    Samples: 61K of event 'cycles', Event count (approx.): 3908136933 [z]
    Overhead Shared Object Symbol
    1.42% firefox [.] 0x0000000000011e76
    1.32% libpthread-2.17.so [.] pthread_mutex_lock

    Signed-off-by: Taeung Song
    Acked-by: Namhyung Kim
    Cc: Namhyung Kim
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1412665995-26359-1-git-send-email-treeze.taeung@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Taeung Song