Changes

Summary

  1. fix compilation issues with latest llvm12 trunk (commit: 8e807dc) (details)
  2. tools/offcputime: Fix python3 string output (commit: 57975a1) (details)
  3. add a C++ kfunc/kretfunc example (commit: 6ef5ce2) (details)
  4. Add PT_REGS_PARMx_SYSCALL helpers for all archs (commit: c23448e) (details)
  5. Reduce code duplication, and add PT_REGS_SYSCALL_CTX (commit: 2c61168) (details)
  6. Drop ubuntu xenial from release process, it is EOL (commit: fb9b4db) (details)
  7. Install python dependencies via pip (commit: c9aff55) (details)
  8. Add sk_lookup to kernel-versions.md (commit: fefde13) (details)
  9. Document XDP support for igb driver in Linux 5.10 (commit: ca2d412) (details)
  10. tools/biolatpcts: Support measuring overall latencies between two events (commit: b2d3632) (details)
  11. tools/biolatpcts: Add accumulative reporting on SIGUSR2 (commit: 783c0ea) (details)
  12. Add build-from-source instructions for Arch Linux (commit: 1294ec6) (details)
  13. doc: adjust bpf_ktime_get_ns() document description (commit: cf183b5) (details)
  14. Update the link and title of the linked blog post (commit: 8465596) (details)
  15. 4.18 - Pass map values to map helpers (commit: 043478d) (details)
  16. Update kernel-versions.md (commit: 9e7b7b0) (details)
  17. libbpf-tools: syscall_helpers: fix a warning (commit: ee2e88d) (details)
  18. libbpf-tools: update README add a blog link (commit: 39eb601) (details)
  19. bcc/libbpf-tools: Fix user probe read references of execsnoop (commit: 3e00893) (details)
  20. tools/opensnoop: Use bpf_probe_read_user explicitly (commit: 24f4759) (details)
  21. The README file in this repo has some bad links - [404:NotFound] (commit: 297512a) (details)
  22. CMake: Refactor clang include/library paths (commit: 78a18ec) (details)
Commit 8e807dc23c4455728a77a810e48f116770b349f6 by yonghong-song
fix compilation issues with latest llvm12 trunk

With latest llvm12 trunk, we got two compilation bugs.

Bug #1:
  /home/yhs/work/bcc/src/cc/frontends/clang/b_frontend_action.cc:
     In member function ‘void ebpf::BFrontendAction::DoMiscWorkAround()’:
  /home/yhs/work/bcc/src/cc/frontends/clang/b_frontend_action.cc:1706:31:
     error: ‘class clang::SourceManage’ has no member named ‘getBuffer’; did you mean ‘getBufferData’?
     rewriter_->getSourceMgr().getBuffer(rewriter_->getSourceMgr().getMainFileID())->getBufferSize(),
                               ^~~~~~~~~
                               getBufferData

  This is due to upstream change https://reviews.llvm.org/D89394.
  To fix, follow upstream examples in https://reviews.llvm.org/D89394.

Bug #2:
  /home/yhs/work/bcc/src/cc/bpf_module.cc: In member function ‘int ebpf::BPFModule::finalize()’:
  /home/yhs/work/bcc/src/cc/bpf_module.cc:470:11:
    error: ‘class llvm::EngineBuilder’ has no member named ‘setUseOrcMCJITReplacement’
   builder.setUseOrcMCJITReplacement(false);
           ^~~~~~~~~~~~~~~~~~~~~~~~~

  This is due to upstream
    https://github.com/llvm/llvm-project/commit/6154c4115cd4b78d0171892aac21e340e72e32bd

  It seems builder.setUseOrcMCJITReplacement() is not needed any more. So just remove it
  from bcc.

Signed-off-by: Yonghong Song <yhs@fb.com>
(commit: 8e807dc)
The file was modifiedsrc/cc/frontends/clang/b_frontend_action.cc (diff)
The file was modifiedsrc/cc/bpf_module_rw_engine.cc (diff)
The file was modifiedsrc/cc/bpf_module.cc (diff)
Commit 57975a1e80fb61d317309984221f78a529c84092 by yonghong-song
tools/offcputime: Fix python3 string output

When using non-folded output, some of the strings would
be printed as raw byte arrays on python3, like this:

    b'finish_task_switch'
    b'__schedule'
    b'schedule'
    b'worker_thread'
    b'kthread'
    b'ret_from_fork'
    -                kworker/u16:1 (22022)
        2267942

This commit updates the code to treat these as utf8 strings,
consistent with all the other strings printed from this tool.
(commit: 57975a1)
The file was modifiedtools/offcputime.py (diff)
Commit 6ef5ce27f4bbbe13848d909ef5e4e6c739f7a818 by yonghong-song
add a C++ kfunc/kretfunc example

This patch added a kfunc/kretfunc C++ example to
show how the new trampoline based kprobe/kretprobe
can be used in C++ based applications.

Signed-off-by: Yonghong Song <yhs@fb.com>
(commit: 6ef5ce2)
The file was addedexamples/cpp/KFuncExample.cc
The file was modifiedexamples/cpp/CMakeLists.txt (diff)
Commit c23448e34ecd3cc9bfc19f0b43f4325f77c2e4cc by yonghong-song
Add PT_REGS_PARMx_SYSCALL helpers for all archs
(commit: c23448e)
The file was modifiedsrc/cc/export/helpers.h (diff)
Commit 2c61168a59e6590bf5f540a96045bb9d74771df4 by yonghong-song
Reduce code duplication, and add PT_REGS_SYSCALL_CTX
(commit: 2c61168)
The file was modifiedsrc/cc/export/helpers.h (diff)
Commit fb9b4dbd0719e9004109c8ee768bd56d6b742c9a by yonghong-song
Drop ubuntu xenial from release process, it is EOL
(commit: fb9b4db)
The file was modified.github/workflows/publish.yml (diff)
Commit c9aff55ff1db2db23d4ec5c64b659ef4ddbe498d by yonghong-song
Install python dependencies via pip
(commit: c9aff55)
The file was modifiedDockerfile.ubuntu (diff)
Commit fefde13ee4411b2cbb87b3d138f3cbd727535a0a by yonghong-song
Add sk_lookup to kernel-versions.md

sk_lookup programs allow intercepting socket lookup per namespace.
(commit: fefde13)
The file was modifieddocs/kernel-versions.md (diff)
Commit ca2d4124ce0b478fffe6ca451ca7d484d8af53d1 by yonghong-song
Document XDP support for igb driver in Linux 5.10
(commit: ca2d412)
The file was modifieddocs/kernel-versions.md (diff)
Commit b2d363271681e3f6bf78eb43636b921d54d737c7 by yonghong-song
tools/biolatpcts: Support measuring overall latencies between two events

* Interpret negative interval as infinite and output once as soon as init is
  complete to indicate readiness.

* Output on SIGUSR1.

* When exit is requested through SIGINT, TERM or HUP, output the latency
  distribution one more time before exiting.

Combined, this allows using biolatpcts to measure the overall latency
distribution between two events.
(commit: b2d3632)
The file was modifiedtools/biolatpcts.py (diff)
Commit 783c0ea89ca856dcf1e4a2e452434bca650c9325 by yonghong-song
tools/biolatpcts: Add accumulative reporting on SIGUSR2

SIGUSR1's behavior is the same - print and start a new interval. SIGUSR2
triggers output without starting a new interval and can be used to monitor
progress without affecting the accumulation of data points.
(commit: 783c0ea)
The file was modifiedtools/biolatpcts.py (diff)
Commit 1294ec6bd3cd9b514ae02fc4a3a1cc8bce772d95 by yonghong-song
Add build-from-source instructions for Arch Linux
(commit: 1294ec6)
The file was modifiedINSTALL.md (diff)
Commit cf183b53d2f12e3960d42995fa21ea0763e27c10 by yonghong-song
doc: adjust bpf_ktime_get_ns() document description
(commit: cf183b5)
The file was modifieddocs/reference_guide.md (diff)
Commit 846559647265b45a659ae33eabdb83ff226bf132 by yonghong-song
Update the link and title of the linked blog post

The new link is also https.
(commit: 8465596)
The file was modifieddocs/tutorial.md (diff)
Commit 043478d664003738a11043b81005f623e4b4910a by yonghong-song
4.18 - Pass map values to map helpers
(commit: 043478d)
The file was modifieddocs/kernel-versions.md (diff)
The file was modifieddocs/kernel-versions.md (diff)
Commit ee2e88d46f7344c904cca1ac482908f97014a1df by yonghong-song
libbpf-tools: syscall_helpers: fix a warning

Fix the following warning when building libbpf-tools:

    syscall_helpers.c: In function ‘init_syscall_names’:
    syscall_helpers.c:63:2: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
       63 |  fgets(buf, sizeof(buf), f);
          |  ^~~~~~~~~~~~~~~~~~~~~~~~~~

We're not interested in the return value of the first call to fgets, because we
want to skip the first line and in the case of error it will be caught by the
following call to fgets. A funny note is that we can't say just "(void) f()" to
suppress the warning, so I wrote it as "(void) !!f()", which works.

Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
(commit: ee2e88d)
The file was modifiedlibbpf-tools/syscall_helpers.c (diff)
Commit 39eb601562cc39d16786bfd941c3be8344eb234e by yonghong-song
libbpf-tools: update README add a blog link

Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
(commit: 39eb601)
The file was modifiedlibbpf-tools/README.md (diff)
Commit 3e0089368bd7fd48dee1c685360375fd7870e9d7 by yonghong-song
bcc/libbpf-tools: Fix user probe read references of execsnoop

Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
(commit: 3e00893)
The file was modifiedlibbpf-tools/execsnoop.bpf.c (diff)
Commit 24f4759eb547d283cd9c5bd5fbb01ef3d72f4208 by yonghong-song
tools/opensnoop: Use bpf_probe_read_user explicitly
(commit: 24f4759)
The file was modifiedtools/opensnoop.py (diff)
Commit 297512a31ecc9ceebf79bda169350dace0f36757 by yonghong-song
The README file in this repo has some bad links - [404:NotFound]

The markup version of the readme that is displayed for the main page in this repo contains the following bad links:

Status code [404:NotFound] - Link: https://github.com/iovisor/bcc/blob/master/tools/swapin_example.txt
Status code [404:NotFound] - Link: https://github.com/iovisor/bcc/blob/master/tools/vfscount.c
Status code [404:NotFound] - Link: https://github.com/iovisor/bcc/blob/master/tools/vfsstat.c

@yonghong-song requested removing stale links. I was unable to find any actual matching files to link to so removed these.
However possible the vfsstat.c one could be re-adding pointing to "libbpf-tools/vfsstat.c" ??

Should resolve issue #3189
(commit: 297512a)
The file was modifiedREADME.md (diff)
Commit 78a18ec891a14c10c51b4c3c4923e16eeac5cfab by Fangrui Song
CMake: Refactor clang include/library paths
(commit: 78a18ec)
The file was modifiedcmake/clang_libs.cmake (diff)
The file was modifiedCMakeLists.txt (diff)