1. 22 Nov, 2018 2 commits
    • Jon Haslam's avatar
      Fix problems with zero()'ing maps · f38a36f1
      Jon Haslam authored
      This change ensures that any maps using the count(), sum(), avg(),
      min(), max(), stats(), hist() or lhist() builtins can be zero'd without
      hanging the bpftrace process or with generating garbage data in the map.
      
      Special attention is drawn to the changes here in the min_value()
      function. I have changed it so that it what you'd expect with signed
      quantities. However, I feel the propoer fix would be to change the BPF
      generation for the min() function so that it works with 64 bit values
      correctly and remove the need for conversion of the stored value.
      f38a36f1
    • Jon Haslam's avatar
      Fix zero() problems · 26ec5378
      Jon Haslam authored
      26ec5378
  2. 18 Nov, 2018 4 commits
  3. 16 Nov, 2018 1 commit
  4. 15 Nov, 2018 1 commit
  5. 13 Nov, 2018 1 commit
  6. 11 Nov, 2018 4 commits
  7. 08 Nov, 2018 2 commits
  8. 06 Nov, 2018 1 commit
  9. 30 Oct, 2018 1 commit
  10. 28 Oct, 2018 1 commit
    • Aleksa Sarai's avatar
      codegen: stack: allow for inter-tid stack aggregation · c4a5de20
      Aleksa Sarai authored
      User-space stacks are quite special in regards to aggregation (and
      comparison) between processes. To a first approximation, each pid has a
      different memory mapping and thus pointers should not be compared or
      aggregated between pids[*]. With ASLR this becomes even more fun, and
      thus it is necessary to do usym()-style packing of the stackid for
      ustack (since bpf_get_stackid will give you a hash of the pointers --
      even in the ustack case).
      
      However, the kernel address space is the same regardless of current->pid
      -- and in many cases you want to aggregate between different processes
      (and if not, you can always do the packing yourself with @[tid,stack]).
      
      So, we only apply the packing when dealing with ustack. sym() already
      does the right thing.
      
      [*] This is more than slightly untrue -- really this depends on
          current->mm and ideally we would aggregate ustack on current->mm.
          Unfortunately this is not a luxury we have at the moment.
      Signed-off-by: default avatarAleksa Sarai <cyphar@cyphar.com>
      c4a5de20
  11. 27 Oct, 2018 2 commits
  12. 26 Oct, 2018 2 commits
  13. 25 Oct, 2018 1 commit
  14. 24 Oct, 2018 2 commits
  15. 22 Oct, 2018 2 commits
  16. 21 Oct, 2018 2 commits
  17. 20 Oct, 2018 1 commit
  18. 19 Oct, 2018 9 commits
    • Tommi Rantala's avatar
      Zero initialize struct sigaction before sigaction() · 08fdc458
      Tommi Rantala authored
      Ensure no garbage in struct sigaction.
      Valgrind was complaining:
      
      ==21435== Syscall param rt_sigaction(act->sa_mask) points to uninitialised byte(s)
      ==21435==    at 0x95ED000: __libc_sigaction (in /usr/lib64/libc-2.27.so)
      ==21435==    by 0x594E99: main
      ==21435==  Address 0x1ffefff8e8 is on thread 1's stack
      ==21435==  in frame #0, created by __libc_sigaction (???:)
      08fdc458
    • Tommi Rantala's avatar
      Call closedir() in list_dir() · b4e9a82c
      Tommi Rantala authored
      Valgrind was complaining:
      
      ==8428== 32,816 bytes in 1 blocks are definitely lost in loss record 983 of 985
      ==8428==    at 0x4C2EDA7: malloc (vg_replace_malloc.c:299)
      ==8428==    by 0x96779A5: __alloc_dir (in /usr/lib64/libc-2.27.so)
      ==8428==    by 0x9677AAC: opendir_tail (in /usr/lib64/libc-2.27.so)
      ==8428==    by 0x59EC50: bpftrace::list_dir(...)
      ==8428==    by 0x59ED5F: bpftrace::list_probes(...)
      ==8428==    by 0x594993: main
      b4e9a82c
    • Tommi Rantala's avatar
      Catch exception by reference · c4e8dd12
      Tommi Rantala authored
      c4e8dd12
    • Tommi Rantala's avatar
      Remove some unused variables · 8b416d3c
      Tommi Rantala authored
      8b416d3c
    • Tommi Rantala's avatar
      Unsigned sscanf() in kernel_version() · 4e13e6d0
      Tommi Rantala authored
      cppcheck was complaining:
      
      [attached_probe.cpp:206]: (warning) %d in format string (no. 1) requires 'int *' but the argument type is 'unsigned int *'.
      [attached_probe.cpp:206]: (warning) %d in format string (no. 2) requires 'int *' but the argument type is 'unsigned int *'.
      [attached_probe.cpp:206]: (warning) %d in format string (no. 3) requires 'int *' but the argument type is 'unsigned int *'.
      
      While at it, check uname() and sscanf() return values to avoid garbage.
      4e13e6d0
    • Tommi Rantala's avatar
      Call close() only if opened · fccdd364
      Tommi Rantala authored
      Valgrind was complaining:
      ==9103== Warning: invalid file descriptor -1 in syscall close()
      ==9103== Warning: invalid file descriptor -1 in syscall close()
      fccdd364
    • Tommi Rantala's avatar
      Pass strings by const reference · 5eaa5783
      Tommi Rantala authored
      5eaa5783
    • Krzesimir Nowak's avatar
      Use env to find bpftrace · 97fd5c4e
      Krzesimir Nowak authored
      97fd5c4e
    • Brendan Gregg's avatar
      allow stand-alone executables · 8ec651e9
      Brendan Gregg authored
      8ec651e9
  19. 18 Oct, 2018 1 commit