1. 20 9月, 2019 2 次提交
  2. 01 9月, 2019 1 次提交
  3. 30 8月, 2019 2 次提交
  4. 29 8月, 2019 1 次提交
  5. 27 8月, 2019 5 次提交
  6. 30 7月, 2019 14 次提交
  7. 26 6月, 2019 1 次提交
  8. 02 4月, 2019 1 次提交
  9. 29 12月, 2018 1 次提交
    • 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
  10. 18 12月, 2018 1 次提交
  11. 20 9月, 2018 3 次提交
  12. 20 8月, 2018 1 次提交
    • J
      perf python: Fix pyrf_evlist__read_on_cpu() interface · 721f0dfc
      Jiri Olsa 提交于
      Jaroslav reported errors from valgrind over perf python script:
      
        # echo 0 > /sys/devices/system/cpu/cpu4/online
        # valgrind ./test.py
        ==7524== Memcheck, a memory error detector
        ...
        ==7524== Command: ./test.py
        ==7524==
        pid 7526 exited
        ==7524== Invalid read of size 8
        ==7524==    at 0xCC2C2B3: perf_mmap__read_forward (evlist.c:780)
        ==7524==    by 0xCC2A681: pyrf_evlist__read_on_cpu (python.c:959)
        ...
        ==7524==  Address 0x65c4868 is 16 bytes after a block of size 459,36..
        ==7524==    at 0x4C2B955: calloc (vg_replace_malloc.c:711)
        ==7524==    by 0xCC2F484: zalloc (util.h:35)
        ==7524==    by 0xCC2F484: perf_evlist__alloc_mmap (evlist.c:978)
        ...
      
      The reason for this is in the python interface, that allows a script to
      pass arbitrary cpu number, which is then used to access struct
      perf_evlist::mmap array. That's obviously wrong and works only when if
      all cpus are available and fails if some cpu is missing, like in the
      example above.
      
      This patch makes pyrf_evlist__read_on_cpu() search the evlist's maps
      array for the proper map to access.
      
      It's linear search at the moment. Based on the way how is the
      read_on_cpu used, I don't think we need to be fast in here.  But we
      could add some hash in the middle to make it fast/er.
      
      We don't allow python interface to set write_backward event attribute,
      so it's safe to check only evlist's mmaps.
      Reported-by: NJaroslav Škarvada <jskarvad@redhat.com>
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Joe Mario <jmario@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180817114556.28000-3-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      721f0dfc
  13. 14 8月, 2018 2 次提交
  14. 11 8月, 2018 1 次提交
  15. 24 3月, 2018 1 次提交
  16. 08 3月, 2018 3 次提交