1. 03 Feb, 2019 3 commits
  2. 02 Feb, 2019 1 commit
  3. 01 Feb, 2019 1 commit
    • Anton Blanchard's avatar
      Fix debuginfo search on Ubuntu · 9d5f9721
      Anton Blanchard authored
      bcc on Ubuntu picks up the glibc binary instead of the debuginfo file
      because find_debug_via_debuglink() doesn't handle symbolic or hard
      links when checking if two paths point to the same file.
      
      Add a helper, same_file() which uses the device and inode to check if
      the two paths do point to the same file.
      Signed-off-by: default avatarAnton Blanchard <anton@ozlabs.org>
      9d5f9721
  4. 30 Jan, 2019 1 commit
  5. 29 Jan, 2019 1 commit
  6. 27 Jan, 2019 1 commit
  7. 24 Jan, 2019 2 commits
  8. 23 Jan, 2019 3 commits
  9. 22 Jan, 2019 3 commits
  10. 21 Jan, 2019 2 commits
    • Xiaozhou Liu's avatar
      print_log2_hist(): check and skip possible paddings (#2155) · 3f7b5966
      Xiaozhou Liu authored
      Address issue 2154.
      
      When a struct S is used as key to a BPF_HISTOGRAM, it is assumed that the second
      member of S holds the slot. But when S is converted to python from bpf C,
      a padding may be inserted as a second member. This breaks print_log2_hist().
      
          root@debian:~/bcc/tools# ./softirqs.py -d
          Tracing soft irq event time... Hit Ctrl-C to end.
          ^C
          Traceback (most recent call last):
            File "./softirqs.py", line 144, in <module>
              dist.print_log2_hist(label, "softirq", section_print_fn=vec_to_name)
            File "/usr/local/lib/python2.7/dist-packages/bcc/table.py", line 326, in print_log2_hist
              vals[slot] = v.value
          TypeError: list indices must be integers, not str
      
      Fix it by skipping the possible padding. Future work would be fixing/working
      around in the library where the padding is introduced.
      3f7b5966
    • yonghong-song's avatar
      Merge pull request #2149 from iovisor/yhs_dev · dc1254ed
      yonghong-song authored
      use kernel libbpf in bcc
      dc1254ed
  11. 18 Jan, 2019 3 commits
  12. 17 Jan, 2019 5 commits
  13. 16 Jan, 2019 5 commits
  14. 15 Jan, 2019 2 commits
    • Joel's avatar
      Bcc build fixes for Android (#2142) · 98fd5030
      Joel authored
      * Mark unused parameters as unused
      
      In Android, we are building libbpf with -Wunused-parameter, mark the
      parameters in bpf_detach_tracepoint to prevent errors.
      
      Change-Id: I2d0011746af80898e55d456b973a95330ce6be71
      Signed-off-by: default avatarJoel Fernandes <joel@joelfernandes.org>
      
      * Avoid void pointer arithmetic
      
      In Android, we build libbpf with -Wpointer-arith, this causes warnings
      as below. Avoid void pointer arithmetic to prevent the warning.
      
      external/bcc/src/cc/perf_reader.c:189:26: error: arithmetic on a pointer
      to void is a GNU extension [-Werror,-Wpointer-arith] memcpy(reader->buf
      + len, base, e->size - len);                               ~~~~~~~~~~~ ^
      
      Change-Id: If06535459473c78799b38119786a91e74a208895
      Signed-off-by: default avatarJoel Fernandes <joel@joelfernandes.org>
      
      * Cast correctly for unsigned long format specifier
      
      In Android, -Wformat gets passed to the compiler causing a warning. Fix
      it by casting.
      
      external/bcc/src/cc/libbpf.c:972:58: error: format specifies type
      'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned lo
      ng long') [-Werror,-Wformat]
      
      Change-Id: I5e70eeff983f20a0b921e81aee7ddbee6d7de2b3
      Signed-off-by: default avatarJoel Fernandes <joel@joelfernandes.org>
      98fd5030
    • vijunag's avatar
      Add build_id support for BPF stackmap · 2ddbc077
      vijunag authored
      A separate build_id stackmap can be created with the help of new macro BPF_STACK_TRACE_BUILDID. The kernel BPF reports stacktrace in the 
      structure bpf_stack_build_id. Changes have been made to BPF modules to
      support resolving symbols mentioned in the above format.
      An example tool is also available in examples/tracing/stack_buildid_example.py. 
      Both python and C++ test cases are added.
      2ddbc077
  15. 14 Jan, 2019 1 commit
  16. 12 Jan, 2019 1 commit
  17. 11 Jan, 2019 5 commits
    • Teng Qin's avatar
      Misc fixes on Python tools (#2136) · aaca976c
      Teng Qin authored
      Misc fixes on Python tools
      aaca976c
    • Teng Qin's avatar
      Merge pull request #2135 from nasastry/python3_syscall_fix · 6a0a7918
      Teng Qin authored
      syscall.py: Fixes python3 related error
      6a0a7918
    • Nageswara R Sastry's avatar
      syscall.py: Fixes python3 related error · 3aebfadd
      Nageswara R Sastry authored
      With out the patch:
      Traceback (most recent call last):$
        File "/root/bcc/src/python/bcc/syscall.py", line 381, in <module>$
          out = out.split('\n',1)[1]$
      TypeError: a bytes-like object is required, not 'str'$
      $
      During handling of the above exception, another exception occurred:$
      $
      Traceback (most recent call last):$
        File "/root/bcc/tests/python/test_stat1.py", line 10, in <module>$
          from bcc import BPF$
        File "/root/bcc/src/python/bcc/__init__.py", line 30, in <module>$
          from .syscall import syscall_name$
        File "/root/bcc/src/python/bcc/syscall.py", line 387, in <module>$
          raise Exception("ausyscall: command not found")$
      Exception: ausyscall: command not found$
      
      This is because variable 'out' is a byte object type and while split,
      code is passing 'str' type.
      
      Tested this on python3 and python2
      Signed-off-by: default avatarNageswara R Sastry <rnsastry@linux.vnet.ibm.com>
      3aebfadd
    • Prashant Bhole's avatar
      tools: shmsnoop, sofdsnoop handle keyboard interrupt (#2126) · f2e063c2
      Prashant Bhole authored
      Handle keyboard interrupt to avoid backtrace printed out when user
      presses Ctrl-C. Other tools have been fixed recently. Let's fix these
      remaining tools.
      f2e063c2
    • yonghong-song's avatar
      workaround kernel 5.0 asm_volatile_goto issue (#2133) · a753e572
      yonghong-song authored
      Fix issue #2119.
      
      Kernel 5.0 added more usages of asm goto and llvm
      does not support asm goto yet. This resulted in
      compilation error for virtually any bcc scripts.
      
      The workaround here is to redefine asm_volatile_goto to
        asm volatile("invalid use of asm_volatile_goto")
      which can pass clang.
      If bpf program does not use asm_volatile_goto,
      nothing bad will happen. The functions using
      asm_volatile_goto will be thrown away.
      If bpf program accidentally uses asm_volatile_goto,
      a compilation error like below will be printed out:
        <inline asm>:1:2: error: invalid register/token name
                invalid use of asm_volatile_goto
                ^
        LLVM ERROR: Error parsing inline asm
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      a753e572