1. 02 1月, 2019 8 次提交
  2. 29 12月, 2018 2 次提交
    • A
      perf script: Fix LBR skid dump problems in brstackinsn · 61f61159
      Andi Kleen 提交于
      This is a fix for another instance of the skid problem Milian recently
      found [1]
      
      The LBRs don't freeze at the exact same time as the PMI is triggered.
      The perf script brstackinsn code that dumps LBR assembler assumes that
      the last branch in the LBR leads to the sample point.  But with skid
      it's possible that the CPU executes one or more branches before the
      sample, but which do not appear in the LBR.
      
      What happens then is either that the sample point is before the last LBR
      branch. In this case the dumper sees a negative length and ignores it.
      Or it the sample point is long after the last branch. Then the dumper
      sees a very long block and dumps it upto its block limit (16k bytes),
      which is noise in the output.
      
      On typical sample session this can happen regularly.
      
      This patch tries to detect and handle the situation. On the last block
      that is dumped by the LBR dumper we always stop on the first branch. If
      the block length is negative just scan forward to the first branch.
      Otherwise scan until a branch is found.
      
      The PT decoder already has a function that uses the instruction decoder
      to detect branches, so we can just reuse it here.
      
      Then when a terminating branch is found print an indication and stop
      dumping. This might miss a few instructions, but at least shows no
      runaway blocks.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Link: http://lkml.kernel.org/r/20181120050617.4119-1-andi@firstfloor.org
      [ Resolved conflict with dd2e18e9 ("perf tools: Support 'srccode' output") ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      61f61159
    • J
      perf python: Do not force closing original perf descriptor in evlist.get_pollfd() · a389aece
      Jiri Olsa 提交于
      Ondřej reported that when compiled with python3, the python extension
      regresses in evlist.get_pollfd function behaviour.
      
      The evlist.get_pollfd function creates file objects from evlist's fds
      and returns them in a list. The python3 version also sets them to 'close
      the original descriptor' when the object dies (is closed), by passing
      True via the 'closefd' arg in the PyFile_FromFd call.
      
      The python's closefd doc says:
      
        If closefd is False, the underlying file descriptor will be kept open
        when the file is closed.
      
      That's why the following line in python3 closes all evlist fds:
      
        evlist.get_pollfd()
      
      the returned list is immediately destroyed and that takes down the
      original events fds.
      
      Passing closefd as False to PyFile_FromFd to fix this.
      Reported-by: NOndřej Lysoněk <olysonek@redhat.com>
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jaroslav Škarvada <jskarvad@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Fixes: 66dfdff0 ("perf tools: Add Python 3 support")
      Link: http://lkml.kernel.org/r/20181226112121.5285-1-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a389aece
  3. 19 12月, 2018 1 次提交
  4. 18 12月, 2018 29 次提交