1. 25 Jan, 2018 3 commits
  2. 24 Jan, 2018 5 commits
    • Yonghong Song's avatar
      fix flaky test py_test_usdt3 · ddfaa999
      Yonghong Song authored
      py_test_usdt3 has shown flakiness recently, and I actually reproduced
      it on FC27. This patch increases the iteration number for
      kprobe_poll and I ran the test for more than 20 times
      without any failure.
      
      Also fix a python3 compability issue. Open the file to write with
      attribute "wb" instead of "w" since the text string is a byte array.
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      ddfaa999
    • 4ast's avatar
      Merge pull request #1549 from iovisor/yhs_dev · 0cf7f748
      4ast authored
      fix a race condition between perf_reader munmap and read
      0cf7f748
    • yonghong-song's avatar
      Merge pull request #1550 from tehnerd/master · 2af307b4
      yonghong-song authored
      adding filtering example to trace.py help
      2af307b4
    • Yonghong Song's avatar
      fix a race condition between perf_reader munmap and read · cd5d4a6c
      Yonghong Song authored
      Fix issue #1533.
      
      Currently, there exist a race condition between perf_reader
      buffer munmap and read if they are happening in two different
      threads, crash is possible as in issue #1533.
      
                thread 1                    thread 2
                perf_reader_event_read      ...
                                            detach_probe
                                            munmap
                access ring buffer
      
      detach_probe may happen as part of bpf object exit cleanup process
      at which point thread 1 is still alive. In this case, accessing
      ring buffer may cause segfault since the original mmap'ed memory
      is not available any more.
      
      It is hard to fix such races outside bcc since user
      calls kprobe_poll which has valid BPF object when it is called,
      but race happens inside the kprobe_poll.
      
      This patch adds a state of the ring buffer and the read will
      not happen once the state comes to the munmap.
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      cd5d4a6c
    • tehnerd's avatar
      adding filtering example to trace.py help · 86293f0d
      tehnerd authored
      86293f0d
  3. 23 Jan, 2018 1 commit
  4. 22 Jan, 2018 2 commits
  5. 20 Jan, 2018 4 commits
  6. 19 Jan, 2018 7 commits
  7. 18 Jan, 2018 6 commits
  8. 17 Jan, 2018 4 commits
  9. 16 Jan, 2018 3 commits
    • Yonghong Song's avatar
      fix a trace_pipe output issue · 7a46dfe2
      Yonghong Song authored
      For trace_pipe output, the /sys/kernel/debug/tracing/trace_pipe
      output format looks like below for kernel 4.12 and earlier:
      ```
       <COMM>-<PID> [CPU] FLAGS TIMESTAMP: [SYMBOL]: USER_MESSAGES
      ```
      where if an internal address is not able to be resolved to
      a kernel symbol, `SYMBOL` will not be printed out at all.
      
      kernel 4.13 and later will have format like:
      ```
       <COMM>-<PID> [CPU] FLAGS TIMESTAMP: [SYMBOL_OR_ADDR]: USER_MESSAGES
      ```
      Basically, if an address is not able to resolved into a
      kernel symbol, the address itself will be printed out.
      The change was introduced by below commit:
      ```
      commit feaf1283d11794b9d518fcfd54b6bf8bee1f0b4b
      Author: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Date:   Thu Jun 22 17:04:55 2017 -0400
      
          tracing: Show address when function names are not found
      
          Currently, when a function is not found in kallsyms, instead of simply
          showing the function address, it shows nothing at all:
      
           # echo ':mod:kvm_intel' > /sys/kernel/tracing/set_ftrace_filter
           # echo function > /sys/kernel/tracing/set_ftrace_filter
           # qemu -enable-kvm /home/my-qemu-image
             <Ctrl-C>
           # rmmod kvm_intel
           # cat /sys/kernel/tracing/trace
           qemu-system-x86-2408  [001] d..2   135.013238:  <-kvm_arch_hardware_enable
           qemu-system-x86-2408  [001] ....   135.014574:  <-kvm_arch_vm_ioctl
           qemu-system-x86-2408  [001] ....   135.015420:  <-kvm_vm_ioctl_check_extension
           qemu-system-x86-2408  [001] ....   135.045411:  <-__do_cpuid_ent
           qemu-system-x86-2408  [001] ....   135.045412:  <-__do_cpuid_ent
           qemu-system-x86-2408  [001] ....   135.045412:  <-__do_cpuid_ent
           qemu-system-x86-2408  [001] ....   135.045412:  <-__do_cpuid_ent
           qemu-system-x86-2408  [001] ...1   135.045413:  <-__do_cpuid_ent
           qemu-system-x86-2408  [001] ....   135.045413:  <-__do_cpuid_ent
      
          When it should show:
      
           qemu-system-x86-2408  [001] d..2   135.013238: 0xffffffffa02a39f0 <-kvm_arch_hardware_enable
           qemu-system-x86-2408  [001] ....   135.014574: 0xffffffffa02a2ba0 <-kvm_arch_vm_ioctl
           qemu-system-x86-2408  [001] ....   135.015420: 0xffffffffa029e4e0 <-kvm_vm_ioctl_check_extension
           qemu-system-x86-2408  [001] ....   135.045411: 0xffffffffa02a1380 <-__do_cpuid_ent
           qemu-system-x86-2408  [001] ....   135.045412: 0xffffffffa029e160 <-__do_cpuid_ent
           qemu-system-x86-2408  [001] ....   135.045412: 0xffffffffa029e180 <-__do_cpuid_ent
           qemu-system-x86-2408  [001] ....   135.045412: 0xffffffffa029e520 <-__do_cpuid_ent
           qemu-system-x86-2408  [001] ...1   135.045413: 0xffffffffa02a13b0 <-__do_cpuid_ent
           qemu-system-x86-2408  [001] ....   135.045413: 0xffffffffa02a1380 <-__do_cpuid_ent
      
          instead.
      ```
      
      This patch fixed the issue by parsing the trace_pipe output considering the
      `SYMBOL_OR_ADDRESS` field may or may not be empty.
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      7a46dfe2
    • Nathan Scott's avatar
      f5fb9af6
    • Nathan Scott's avatar
      start adding -e/--ebpf option to the python tools/ scripts · ca4ba557
      Nathan Scott authored
      Several python tools allow their eBPF code to be printed to
      stdout for debugging.  There are other projects that would
      like to share these program definitions however, instead of
      duplicating code.  Formalise an -e/--ebpf option, and start
      using it in several tools (more to come).
      Signed-off-by: default avatarNathan Scott <nathans@redhat.com>
      ca4ba557
  10. 15 Jan, 2018 1 commit
  11. 13 Jan, 2018 1 commit
  12. 12 Jan, 2018 3 commits