1. 08 Jul, 2016 1 commit
  2. 02 Jul, 2016 1 commit
  3. 01 Jul, 2016 2 commits
  4. 30 Jun, 2016 10 commits
    • Brenden Blanco's avatar
      Merge pull request #586 from goldshtn/offcpudist · 97712b05
      Brenden Blanco authored
      cpudist: Support off-cpu time reports
      97712b05
    • Brenden Blanco's avatar
      Merge pull request #590 from goldshtn/bcc-tp-support · d1b62087
      Brenden Blanco authored
      bcc: Tracepoint support in libbpf and BPF
      d1b62087
    • Sasha Goldshtein's avatar
      bcc: Add test for tracepoint support · 79809330
      Sasha Goldshtein authored
      The test asserts that we can enable the sched_switch tracepoint and read
      some events from it. The test is also marked to require kernel 4.7 or
      later, because that's where the BPF support for tracepoints was introduced.
      79809330
    • Sasha Goldshtein's avatar
      cpudist: Protect against potentially negative time deltas · bee8d360
      Sasha Goldshtein authored
      It seems from experimentation that the calculated timestamps between
      on- and off-CPU switch events can produce incorrect results, with a
      later event having a smaller timestamp. Discard events when the
      resulting delta time would be negative.
      bee8d360
    • Sasha Goldshtein's avatar
      cpudist: Use `finish_task_switch` kprobe instead of `sched_switch` tracepoint · 06d90d3d
      Sasha Goldshtein authored
      The `sched_switch` tracepoint approach requires storing the previous
      task's tgid in a map and fetching it from there, because it is not
      available as a tracepoint argument. Instead, placing a kprobe on the
      `finish_task_switch` function allows cleanly fetching the previous
      task's pid and tgid from the task_struct.
      06d90d3d
    • Sasha Goldshtein's avatar
      cpudist: Fix extraneous filtering of descheduled tasks · 3c976bbd
      Sasha Goldshtein authored
      When the `-O` switch was provided, cpudist was unnecessarily filtering
      out scheduling events arising from a task waking up when the previous
      task was not running. On an idle system, this happens a lot, and causes
      events to be missed. This is now fixed.
      3c976bbd
    • Sasha Goldshtein's avatar
      cpudist: Attempt to resolve pid to command · 4b72f052
      Sasha Goldshtein authored
      Use `/proc/$PID/comm`, which may fail, for example if the original
      process already exited. This may also produce misleading results
      if another process got the same pid, but there's no way around this.
      4b72f052
    • Sasha Goldshtein's avatar
      cpudist: Support off-cpu time reports · 9972f27b
      Sasha Goldshtein authored
      Add -O switch, which directs cpudist to collect off-CPU time
      statistics. Also restructure the code slightly and added examples
      as appropriate.
      9972f27b
    • Sasha Goldshtein's avatar
      bcc: Tracepoint support in libbpf and BPF · 1198c3c6
      Sasha Goldshtein authored
      Introduce tracepoint support in libbpf via new `bpf_attach_tracepoint`
      API, which takes the tracepoint category and name (e.g. "sched",
      "sched_switch"). Attach the tracing program to the tracepoint's id
      and proceed as usual.
      
      Add `attach_tracepoint` API to Python BPF module, which takes the
      tracepoint description as a single string (e.g. "sched:sched_switch").
      Load the BPF program with bpf_prog_type set to TRACEPOINT and then
      call `bpf_attach_tracepoint` to attach it.
      1198c3c6
    • Sasha Goldshtein's avatar
      trace: Specifying a pid with a kernel probe now works (#589) · de34c25b
      Sasha Goldshtein authored
      Due to an incorrectly referenced global variable, specifying a pid
      to filter with a kernel probe produced an error. This is now fixed,
      for example:
      
      ```
      TIME     PID    COMM         FUNC
      23:46:00 29967  bash         sched_switch
      23:46:01 29967  bash         sched_switch
      23:46:01 29967  bash         sched_switch
      ^C
      ```
      de34c25b
  5. 29 Jun, 2016 1 commit
    • Sasha Goldshtein's avatar
      cpudist: Summarize task on-CPU time as histograms (#585) · 40975ab3
      Sasha Goldshtein authored
      * cpudist: summarize on-CPU time per task as a histogram
      
      This is the initial implementation of the tool itself, which uses
      the sched:sched_switch tracepoint to probe task switches. This is
      a slightly more robust approach than using a kernel function, such
      as finish_task_switch.
      
      When native BCC support for tracepoints is introduced, this tool
      can be reimplemented and reliance on the current Tracepoint module
      can be removed.
      
      * cpudist: add man page and examples
      40975ab3
  6. 27 Jun, 2016 4 commits
  7. 26 Jun, 2016 4 commits
  8. 23 Jun, 2016 2 commits
  9. 22 Jun, 2016 1 commit
  10. 21 Jun, 2016 2 commits
  11. 20 Jun, 2016 1 commit
  12. 15 Jun, 2016 6 commits
  13. 13 Jun, 2016 3 commits
    • Brenden Blanco's avatar
      Merge pull request #563 from qmonnet/debug-output · cfac8da4
      Brenden Blanco authored
      libbpf.c: Prepend BPF syscall error to log_bug when debug is enabled.
      cfac8da4
    • Quentin Monnet's avatar
      python: With DEBUG_BPF, print BPF error even if log_buf is not empty. · 4ddedda5
      Quentin Monnet authored
      When BPF syscall fails and DEBUG_FLAG has been provided to a Python
      caller script, the BPF error string would be printed only if log_buf had
      not been filled by the kernel. This commit removes this requirement,
      printing the error string even if log_buf is not empty.
      Signed-off-by: default avatarQuentin Monnet <quentin.monnet@6wind.com>
      4ddedda5
    • Quentin Monnet's avatar
      python: Print BPF syscall error if DEBUG_BPF is on but log_buf is empty. · bb699887
      Quentin Monnet authored
      Commit 759029fe provided an option to
      store the output from BPF syscall into a buffer (and not to print it
      systematically to standard output) on program load in libbpf.c.
      
      But doing so, it only stores the content of attr.log_buf, while the
      error string--resulting from a failed BPF syscall--is no more displayed
      when the DEBUG_BPF flag is used in the Python script responsible for
      converting and injecting the code.
      
      This commit proposes a fix for this bug by printing the error message
      (associated to the return value from the syscall) from the Python
      caller, when all the following conditions are met:
      
      - the syscall fails,
      - the DEBUG_BPF flag has been provided, and
      - log_buf is empty (has not been filled by kernel).
      
      Note: when DEBUG_BPF is not provided, the error string is printed in the
      C wrapper in libbpf.c (bpf_prog_load) anyway.
      
      Fixes: 759029fe ("Add option for custom log string to bpf_prog_load")
      Signed-off-by: default avatarQuentin Monnet <quentin.monnet@6wind.com>
      bb699887
  14. 08 Jun, 2016 1 commit
  15. 07 Jun, 2016 1 commit