1. 08 Feb, 2018 4 commits
    • Brenden Blanco's avatar
      tools: switch to v2/3 independent bytes usage · 42d6098f
      Brenden Blanco authored
      Conform to bytes encoding for some portion of the tools/tests, such that
      smoke tests pass on python3. More conversions are surely required.
      Signed-off-by: default avatarBrenden Blanco <bblanco@gmail.com>
      42d6098f
    • Brenden Blanco's avatar
      python/bcc: add internal _assert_is_bytes usage · c0ca99a2
      Brenden Blanco authored
      Move bcc internals to sanitize all arguments as bytes instead of str
      type. For now, disable warnings or actual assertion, to be turned on
      incrementally.
      c0ca99a2
    • Brenden Blanco's avatar
      python: Add 2/3 compat wrappers for byte strings · e663541c
      Brenden Blanco authored
      Introduce some helpers for managing bytes/unicode objects in a way that
      bridges the gap from python2 to 3.
      
      1. Add printb() helper for writing bytes output directly to stdout. This
      avoids complaints from print() in python3, which expects a unicode
      str(). Since python 3.5, `b"" % bytes()` style format strings should
      work and we can write tools with common code, once we convert format
      strings to bytes.
      http://legacy.python.org/dev/peps/pep-0461/
      
      2. Add a class for wrapping command line arguments that are intended for
      comparing to debugged memory, for instance running process COMM or
      kernel pathname data. The approach takes some of the discussion from
      http://legacy.python.org/dev/peps/pep-0383/ into account, though
      unfortunately the python2-future implementation of "surrogateescape" is
      buggy, therefore this iteration is partial.
      
      The object instance should only ever be coerced into a bytes object.
      This silently invokes encode(sys.getfilesystemencoding()), which if it
      fails implies that the tool was passed junk characters on the command
      line. Thereafter the tool should implement only bytes-bytes comparisons
      (for instance re.search(b"", b"")) and bytes stdout printing (see
      printb).
      
      3. Add an _assert_is_bytes helper to check for improper usage of str
      objects in python arguments. The behavior of the assertion can be
      tweaked by changing the bcc.utils._strict_bytes bool.
      
      Going forward, one should never invoke decode() on a bpf data stream,
      e.g. the result of a table lookup or perf ring output. Leave that data
      in the native bytes() representation.
      Signed-off-by: default avatarBrenden Blanco <bblanco@gmail.com>
      e663541c
    • Brenden Blanco's avatar
      Fix file desc leak in test_tools_smoke · c28f6e86
      Brenden Blanco authored
      Signed-off-by: default avatarBrenden Blanco <bblanco@gmail.com>
      c28f6e86
  2. 06 Feb, 2018 5 commits
  3. 05 Feb, 2018 6 commits
  4. 04 Feb, 2018 4 commits
  5. 03 Feb, 2018 1 commit
  6. 02 Feb, 2018 3 commits
  7. 01 Feb, 2018 1 commit
  8. 31 Jan, 2018 2 commits
  9. 30 Jan, 2018 1 commit
  10. 29 Jan, 2018 6 commits
  11. 28 Jan, 2018 7 commits