1. 06 Oct, 2015 2 commits
    • Brenden Blanco's avatar
      Avoid infinite loops in BPF.Table destructor · 0d93605b
      Brenden Blanco authored
      In the case that python process tries to clear() a table object while
      the bpf program is still running and doing lookup_or_init, the python
      clean() routine will race with the bpf program (and bpf will win in the
      case of frequent kprobe hits) causing a hang. Instead, first get the
      full list of keys and then delete them rather than rely on the default
      popitem implementation.
      
      Fixes: #233
      Signed-off-by: default avatarBrenden Blanco <bblanco@plumgrid.com>
      0d93605b
    • Brenden Blanco's avatar
      Support iterating from a 0-filled table key · 14915e05
      Brenden Blanco authored
      In the case that 0-filled keys are valid in the table, the previous
      algorithm did not properly iterate.
      
      The API of the bpf_get_next_key routine is such that the iteration
      over a map should start with an invalid key. When a 0 key is valid, this
      causes iteration to start anywhere inside the hash table, skipping some
      entries. So, add logic to the Iter object to test if the init key is
      invalid. If otherwise, try a few alternatives until an invalid key is
      found. If none found, raise an exception.
      
      Also adds a test for indexing arrays from 0, which nows works with this
      too.
      
      Fixes: #260
      Signed-off-by: default avatarBrenden Blanco <bblanco@plumgrid.com>
      14915e05
  2. 01 Oct, 2015 2 commits
  3. 29 Sep, 2015 2 commits
  4. 28 Sep, 2015 3 commits
    • 4ast's avatar
      Merge pull request #255 from iovisor/bblanco_dev · 4d97f7fa
      4ast authored
      Add ability to consume perf events in python
      4d97f7fa
    • Brenden Blanco's avatar
      c61e75b4
    • Brenden Blanco's avatar
      Add ability to consume perf events in python · 8207d10e
      Brenden Blanco authored
      This adds the ability to consume perf events in libbpf/python using the
      ring buffer. For now, this is the only way to get access to the function
      call graph. Only kernel functions are supported.
      
      It does this by introducing a new set of libbpf helper functions that
      can open the perf fd, mmap it, and poll over the events as they are
      submitted by the kernel. This allow for faster event processing than
      trace_printks, but has not been tested.
      
      The functionality is disabled by default, the user can enable it by
      passing a non-empty cb parameter into the BPF constructor. That cb
      function will be invoked for each event that is read from the buffer.
      Buffers are per-fd, so each event is distinct as well as separated from
      other processes that may be running simultaneously.
      
      The initial test case uses this functionality to build a histogram of
      events keyed by the callchain.
      Signed-off-by: default avatarBrenden Blanco <bblanco@plumgrid.com>
      8207d10e
  5. 27 Sep, 2015 1 commit
  6. 26 Sep, 2015 1 commit
  7. 25 Sep, 2015 14 commits
  8. 24 Sep, 2015 9 commits
  9. 23 Sep, 2015 2 commits
  10. 21 Sep, 2015 4 commits