1. 20 4月, 2017 1 次提交
  2. 12 4月, 2017 1 次提交
    • D
      perf inject: Copy events when reordering events in pipe mode · 1e0d4f02
      David Carrillo-Cisneros 提交于
      __perf_session__process_pipe_events reuses the same memory buffer to
      process all events in the pipe.
      
      When reordering is needed (e.g. -b option), events are not immediately
      flushed, but kept around until reordering is possible, causing
      memory corruption.
      
      The problem is usually observed by a "Unknown sample error" output. It
      can easily be reproduced by:
      
        perf record -o - noploop | perf inject -b > output
      
      Committer testing:
      
      Before:
      
        $ perf record -o - stress -t 2 -c 2 | perf inject -b > /dev/null
        stress: info: [8297] dispatching hogs: 2 cpu, 0 io, 0 vm, 0 hdd
        stress: info: [8297] successful run completed in 2s
        [ perf record: Woken up 3 times to write data ]
        [ perf record: Captured and wrote 0.000 MB - ]
        Warning:
        Found 1 unknown events!
      
        Is this an older tool processing a perf.data file generated by a more recent tool?
      
        If that is not the case, consider reporting to linux-kernel@vger.kernel.org.
      
        $
      
      After:
      
        $ perf record -o - stress -t 2 -c 2 | perf inject -b > /dev/null
        stress: info: [9027] dispatching hogs: 2 cpu, 0 io, 0 vm, 0 hdd
        stress: info: [9027] successful run completed in 2s
        [ perf record: Woken up 3 times to write data ]
        [ perf record: Captured and wrote 0.000 MB - ]
        no symbols found in /usr/bin/stress, maybe install a debug package?
        no symbols found in /usr/bin/stress, maybe install a debug package?
        $
      Signed-off-by: NDavid Carrillo-Cisneros <davidcc@google.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Simon Que <sque@chromium.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/20170410201432.24807-3-davidcc@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1e0d4f02
  3. 14 4月, 2016 1 次提交
  4. 25 8月, 2015 1 次提交
  5. 01 4月, 2015 1 次提交
  6. 12 3月, 2015 2 次提交
  7. 11 3月, 2015 2 次提交
  8. 23 2月, 2015 1 次提交
  9. 16 10月, 2014 1 次提交
    • A
      perf session: Add option to copy events when queueing · 54bf53b1
      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 <dsahern@gmail.com>
      Signed-off-by: NAlexander Yarygin <yarygin@linux.vnet.ibm.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1412347212-28237-2-git-send-email-yarygin@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      54bf53b1
  10. 12 8月, 2014 6 次提交