Skip to content

new(libscap): add a per-buffer event reading API with a test_input backend - #3166

Draft
higakikeita wants to merge 3 commits into
falcosecurity:masterfrom
higakikeita:pr1-libscap-buffer-api
Draft

higakikeita wants to merge 3 commits into
falcosecurity:masterfrom
higakikeita:pr1-libscap-buffer-api

Conversation

@higakikeita

Copy link
Copy Markdown

What type of PR is this?

/kind feature

/area libscap

What this PR does / why we need it:

This is the first, self-contained step of splitting #2853 into smaller reviewable PRs, in support of the multi-threaded event processing proposal in falcosecurity/falco#3751.

Today a libscap consumer can only read events through scap_next(), which returns one merged stream. Consumers that want to read each ring buffer from its own thread need a way to address a single buffer. This PR adds that to libscap, without any consumer, driver or engine other than the test engine:

  • scap_buffer_reserve_handle() hands out one opaque scap_buffer_t per buffer.
  • scap_buffer_get_n_allocated_handles() returns how many handles can be reserved.
  • scap_buffer_next() reads the next event of the buffer behind a handle (SCAP_SUCCESS, SCAP_TIMEOUT, SCAP_EOF, SCAP_FAILURE, SCAP_NOT_SUPPORTED).
  • Three matching scap_vtable entries: next_from_buffer, get_n_allocated_buffer_handles, reserve_buffer_handle.
  • SCAP_INVALID_BUFFER_HANDLE and the scap_buffer_t type live in a new header-only scap_buffer.h.
  • Every existing engine (kmod, modern_bpf, nodriver, noop, savefile, raw_block, source_plugin) uses new noop_* stubs: SCAP_NOT_SUPPORTED, zero handles, invalid handle. Their behavior is unchanged.
  • The test_input engine implements the API over optional per-buffer queues (scap_test_input_buffers, passed through scap_test_input_engine_params::test_input_buffers). Each queue keeps its order, there is no ordering between queues, and an empty queue reports SCAP_TIMEOUT or, if the queue asks for it, SCAP_EOF. Without buffers the engine behaves exactly as before.
  • A new libscap gtest, test/libscap/test_suites/userspace/buffer_api.cpp, drives test_input through the API.

The design follows #2853 (irozzo-1A, ekoops). The commits are based on its libscap parts and the commit message credits it.

Two commits:

  1. new(libscap): add a per-buffer event reading API (public API, vtable, stubs for all engines).
  2. new(libscap): implement per-buffer reads in the test_input engine (test_input backend, sinsp.cpp one-liner, new test).

Scope: what is deliberately NOT included

  • No driver, libpman or modern_bpf behavior change (modern_bpf only gets the stub entries). A fixed ring-buffer count and the real modern_bpf implementation are a separate step.
  • No libsinsp change except zero-initializing scap_test_input_engine_params in sinsp::open_test_input() (see Risks). No sinsp_buffer, no sinsp::next(evt, buffer_h), no open_test_input overload.
  • No thread-safe event counter. scap_buffer_next() does not update the counter behind scap_event_get_num() ([WIP] feat: multi-thread support #2853 turns it into an atomic, which needs <stdatomic.h> in scap-int.h, shared with C++).
  • No thread-local last-error buffers (scap_set_thread_lasterr in [WIP] feat: multi-thread support #2853).
  • No Folly, no ENABLE_MULTI_THREAD, no synchronization code.
  • SCAP_INVALID_BUFFER_HANDLE is a macro in a header, not the non-const global of [WIP] feat: multi-thread support #2853, so no new library target is needed.

Test evidence

Built in Docker (Release, bundled deps, BUILD_DRIVER=OFF, BUILD_LIBSCAP_MODERN_BPF=OFF, gVisor off, libscap and libsinsp unit tests on), not privileged.

  • libscap_test on current master (0815626): 378 tests, 378 passed.
  • libscap_test with this PR: 388 tests, 388 passed (378 existing, unchanged, plus the 10 new buffer_api.* tests).
  • unit-test-libsinsp: built and run with this PR: 1022 tests, 1022 passed (no master baseline run for this suite).
  • clang-format 18.1.3 (.clang-format of the repo) leaves every touched C/C++ file unchanged.
  • scap_kmod.c, scap_modern_bpf.c and scap_raw_block.c were checked with gcc -fsyntax-only (kmod with a stand-in driver_config.h) since those engines are not part of this build. The kmod, modern_bpf and gVisor targets were not built.

New tests: handle count matches the configured buffers; reserved handles are distinct and limited to the count; events go to the right buffer in per-buffer order under an interleaved read; an empty buffer times out without affecting the others; EOF per buffer; invalid, unreserved and out-of-range handles fail without consuming events; NULL scap handle; single-stream test_input and the noop engine report not-supported; the single stream is independent of the buffers.

Risks

  • sinsp::open_test_input() declared scap_test_input_engine_params params; uninitialized. With the new pointer field that would read garbage, so it is now params{}. This is the only change outside libscap.
  • Public header changes: scap_vtable gets three entries. Out-of-tree engines that build a scap_vtable with designated initializers and leave the new entries unset would crash on scap_buffer_*(). In-tree engines are all covered. Layout of existing structs is unchanged; scap_test_input_engine_params gains a trailing field.
  • kmod now links scap_engine_noop for the stubs (CMake change); the kmod build was not exercised here.
  • scap_buffer_next() can be called from several threads on different handles, but test_input itself is not thread-safe (it consumes its queues in place), as in the single-stream mode. It is a test engine.

Open questions for the maintainers

  1. Is the split of [WIP] feat: multi-thread support #2853 along these lines acceptable, and is this the right first step?
  2. SCAP_INVALID_BUFFER_HANDLE as a macro is a small deviation from [WIP] feat: multi-thread support #2853. Any objection?
  3. Should scap_buffer_next() count events in scap_event_get_num()? Doing it safely needs an atomic counter, which would be part of the PR that adds concurrent readers.
  4. scap_buffer_t is a plain uint32_t whose meaning is engine private (for test_input it is the buffer index). [WIP] feat: multi-thread support #2853 later encodes more in it. Is that opaque, engine-defined contract what you want?
  5. For engines without per-buffer reads, SCAP_NOT_SUPPORTED plus a last-error message seems right to us. Would you rather have SCAP_FAILURE?

Which issue(s) this PR fixes:

None. Part of falcosecurity/falco#3751; splits out the libscap part of #2853.

Special notes for your reviewer:

Authorship of the design is irozzo-1A and ekoops (#2853). The implementation here is a reduced re-port on top of current master, written with Claude Sonnet 5.5 assistance (see Co-Authored-By in the commits).

Does this PR introduce a user-facing change?:

new(libscap): add scap_buffer_reserve_handle(), scap_buffer_get_n_allocated_handles() and scap_buffer_next() to read events from a specific buffer. Only the test_input engine supports them for now; every other engine reports SCAP_NOT_SUPPORTED.

🤖 Generated with Claude Code

higakikeita and others added 2 commits November 23, 2026 10:46
Add an engine-agnostic way to read events from a specific buffer of a
capture instead of from the single merged stream returned by
scap_next():

- scap_buffer_reserve_handle() hands out one opaque handle per buffer,
- scap_buffer_get_n_allocated_handles() tells how many can be reserved,
- scap_buffer_next() reads the next event of the buffer behind a handle.

The scap_vtable gets the matching next_from_buffer,
get_n_allocated_buffer_handles and reserve_buffer_handle entries. Every
existing engine fills them with noop stubs that report the operation as
not supported (SCAP_NOT_SUPPORTED, no handles, invalid handle), so
nothing changes for them or for users of scap_next(). The test_input
engine gets the real implementation in the next commit.

The event counter is deliberately not touched by scap_buffer_next():
making it safe for concurrent readers is left to the change that
introduces them.

Based on falcosecurity#2853 by irozzo-1A and ekoops.

Signed-off-by: Keita Higaki <higaki.keichan@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Let the test_input engine serve the buffer API from an optional set of
per-buffer event queues (scap_test_input_buffers), passed through the
new scap_test_input_engine_params::test_input_buffers field. Each queue
keeps its own order, there is no ordering between queues, and an empty
queue reports SCAP_TIMEOUT or, if requested, SCAP_EOF. Handles are only
valid once reserved. Without buffers the engine behaves as before and
reports the buffer API as not supported.

The queues are a separate struct rather than new fields of
scap_test_input_data on purpose: several existing users do not
zero-initialize that struct. For the same reason sinsp::open_test_input()
now value-initializes its scap_test_input_engine_params, as the new
field must read as NULL there.

Add a libscap test that opens test_input through the new API: handle
reservation and count, delivery to the right buffer in per-buffer order,
per-buffer timeout and EOF, invalid and unreserved handles, NULL handle,
and the not-supported results of the single stream mode and of the noop
engine.

Based on falcosecurity#2853 by irozzo-1A and ekoops.

Signed-off-by: Keita Higaki <higaki.keichan@gmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@poiana

poiana commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: higakikeita
Once this PR has been reviewed and has the lgtm label, please assign ekoops for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana

poiana commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Welcome @higakikeita! It looks like this is your first PR to falcosecurity/libs 🎉

@github-actions

Copy link
Copy Markdown

Please double check driver/API_VERSION file. See versioning.

/hold

@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.97%. Comparing base (0815626) to head (879d704).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3166   +/-   ##
=======================================
  Coverage   79.97%   79.97%           
=======================================
  Files         309      309           
  Lines       36598    36598           
  Branches     5189     5190    +1     
=======================================
  Hits        29271    29271           
  Misses       7327     7327           
Flag Coverage Δ
libsinsp 79.97% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Perf diff from master - unit tests

     2.29%     -1.16%  [.] sinsp_threadinfo::get_main_thread()
     1.09%     +0.97%  [.] thread_group_info::get_first_thread() const
     1.47%     -0.58%  [.] read_block_header
     3.62%     -0.47%  [.] convert_event(std::unordered_map<unsigned long, std::shared_ptr<ppm_evt_hdr>, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, std::shared_ptr<ppm_evt_hdr> > > >&, ppm_evt_hdr*, ppm_evt_hdr*, conversion_info const&, unsigned long, char*)
     1.33%     -0.45%  [.] sinsp_evt_param::used_legacy_null_encoding() const
     2.28%     -0.41%  [.] scap_savefile_next
     1.29%     -0.39%  [.] std::_Hashtable<unsigned long, std::pair<unsigned long const, std::shared_ptr<ppm_evt_hdr> >, std::allocator<std::pair<unsigned long const, std::shared_ptr<ppm_evt_hdr> > >, std::__detail::_Select1st, std::equal_to<unsigned long>, std::hash<unsigned long>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::find(unsigned long const&)
     1.00%     +0.34%  [.] std::__detail::_Hashtable_base<conversion_key, std::pair<conversion_key const, conversion_info>, std::__detail::_Select1st, std::equal_to<conversion_key>, std::hash<conversion_key>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, false, true> >::_M_equals(conversion_key const&, unsigned long, std::__detail::_Hash_node_value<std::pair<conversion_key const, conversion_info>, true> const&) const
     1.59%     -0.34%  [.] std::_Hashtable<conversion_key, std::pair<conversion_key const, conversion_info>, std::allocator<std::pair<conversion_key const, conversion_info> >, std::__detail::_Select1st, std::equal_to<conversion_key>, std::hash<conversion_key>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::find(conversion_key const&) const
     1.73%     +0.30%  [.] scap_convert_event

Heap diff from master - unit tests

peak heap memory consumption: -16B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Benchmarks diff from master

Overall geomean of the CPU time: +0.5%.

The spread is the coefficient of variation (stddev / mean) of the repetitions. A change is noisy if the spread of either run is above 5%. A benchmark is listed here if the U test p-value of its CPU time is below 0.05.

BM_plugin_field_*

Benchmark Median CPU time, master → PR Change Spread (cv) p-value
floor 96.9 → 95.4 ms -1.6% 0.67% → 0.43% <0.001
raw_pid 96.6 → 94.2 ms -2.5% 0.51% → 1.1% <0.001
raw_name 101 → 96.8 ms -3.9% 0.48% → 0.40% <0.001
proc_name 120 → 120 ms -0.4% 0.57% → 0.28% 0.012
proc_bool 116 → 115 ms -0.5% 0.44% → 0.45% 0.002
proc_fspath 114 → 113 ms -0.7% 0.50% → 0.30% <0.001
rawarg_int 116 → 115 ms -0.8% 0.46% → 0.52% <0.001
proc_icontains 133 → 134 ms +0.7% 0.47% → 0.41% <0.001
proc_uid 131 → 131 ms +0.5% 0.35% → 0.33% <0.001
proc_pid_x4 125 → 123 ms -1.4% 0.36% → 0.36% <0.001
proc_pid_x8 136 → 134 ms -0.9% 0.30% → 0.29% <0.001
proc_pid_ors_x8 140 → 137 ms -1.7% 0.31% → 0.41% <0.001
proc_pid_deep_x6 136 → 135 ms -1.2% 0.43% → 0.46% <0.001
proc_pid_nots_x4 126 → 125 ms -0.7% 0.31% → 0.44% <0.001
proc_pid_group_x4 125 → 124 ms -1.1% 0.29% → 0.47% <0.001
proc_mixed_x4 147 → 145 ms -1.5% 0.42% → 0.66% <0.001
v3_pid 151 → 152 ms +0.9% 0.25% → 0.43% <0.001
v3_name 157 → 158 ms +0.4% 0.35% → 0.29% <0.001
v3_net 125 → 125 ms +0.3% 0.39% → 0.29% 0.044

BM_walk_dead_*

Benchmark Median CPU time, master → PR Change Spread (cv) p-value
lazy/0 4721 → 4711 ns -0.2% 0.17% → 0.12% <0.001
lazy/1 4710 → 4706 ns -0.1% 0.14% → 0.11% 0.006
lazy/4 4674 → 4661 ns -0.3% 0.10% → 0.07% <0.001
lazy/8 4619 → 4602 ns -0.4% 0.13% → 0.07% <0.001
lazy/15 4521 → 4504 ns -0.4% 0.10% → 0.08% <0.001

BM_clone_after_*

Benchmark Median CPU time, master → PR Change Spread (cv) p-value
dead_ancestors/dead:0/kernel_reaper:0/iterations:300 40294 → 40013 ns -0.7% 0.16% → 0.32% <0.001
dead_ancestors/dead:1/kernel_reaper:0/iterations:300 39347 → 39030 ns -0.8% 0.38% → 0.27% <0.001
dead_ancestors/dead:4/kernel_reaper:0/iterations:300 38333 → 38004 ns -0.9% 0.51% → 0.21% <0.001
dead_ancestors/dead:8/kernel_reaper:0/iterations:300 37063 → 36834 ns -0.6% 0.62% → 0.63% <0.001
dead_ancestors/dead:15/kernel_reaper:0/iterations:300 34258 → 33785 ns -1.4% 0.39% → 0.27% <0.001
dead_ancestors/dead:0/kernel_reaper:1/iterations:300 40216 → 39984 ns -0.6% 0.94% → 0.18% <0.001
dead_ancestors/dead:1/kernel_reaper:1/iterations:300 39577 → 38955 ns -1.6% 0.19% → 0.30% <0.001
dead_ancestors/dead:4/kernel_reaper:1/iterations:300 38494 → 38034 ns -1.2% 0.52% → 0.32% <0.001
dead_ancestors/dead:8/kernel_reaper:1/iterations:300 37075 → 37966 ns +2.4% 0.59% → 0.83% <0.001
dead_ancestors/dead:15/kernel_reaper:1/iterations:300 34444 → 35028 ns +1.7% 0.38% → 0.47% <0.001
fork_exit_chain/dead:0/kernel_reaper:0/iterations:300 29794 → 29488 ns -1.0% 0.51% → 0.40% <0.001
fork_exit_chain/dead:1/kernel_reaper:0/iterations:300 29654 → 29555 ns -0.3% 0.58% → 0.36% 0.044
fork_exit_chain/dead:4/kernel_reaper:0/iterations:300 30118 → 30013 ns -0.3% 0.23% → 0.28% <0.001
fork_exit_chain/dead:8/kernel_reaper:0/iterations:300 30299 → 30209 ns -0.3% 0.96% → 0.32% 0.006
fork_exit_chain/dead:0/kernel_reaper:1/iterations:300 29784 → 29514 ns -0.9% 0.30% → 0.34% <0.001
fork_exit_chain/dead:1/kernel_reaper:1/iterations:300 29746 → 29448 ns -1.0% 0.39% → 0.40% <0.001
fork_exit_chain/dead:4/kernel_reaper:1/iterations:300 30143 → 30014 ns -0.4% 0.21% → 0.24% <0.001

BM_execve_after_*

Benchmark Median CPU time, master → PR Change Spread (cv) p-value
dead_ancestors/dead:0/kernel_reaper:0/iterations:300 32929 → 33690 ns +2.3% 0.38% → 1.4% <0.001
dead_ancestors/dead:1/kernel_reaper:0/iterations:300 32590 → 32238 ns -1.1% 0.24% → 0.19% <0.001
dead_ancestors/dead:4/kernel_reaper:0/iterations:300 31606 → 31162 ns -1.4% 1.8% → 0.46% <0.001
dead_ancestors/dead:8/kernel_reaper:0/iterations:300 30213 → 29898 ns -1.0% 0.30% → 0.28% <0.001
dead_ancestors/dead:15/kernel_reaper:0/iterations:300 26679 → 26534 ns -0.5% 0.23% → 0.26% <0.001
dead_ancestors/dead:0/kernel_reaper:1/iterations:300 32964 → 32713 ns -0.8% 0.57% → 0.22% 0.004
dead_ancestors/dead:1/kernel_reaper:1/iterations:300 32688 → 32180 ns -1.6% 0.22% → 0.26% <0.001
dead_ancestors/dead:4/kernel_reaper:1/iterations:300 31635 → 31271 ns -1.1% 0.49% → 0.56% <0.001
dead_ancestors/dead:8/kernel_reaper:1/iterations:300 30278 → 30002 ns -0.9% 0.27% → 0.21% <0.001
dead_ancestors/dead:15/kernel_reaper:1/iterations:300 26768 → 26551 ns -0.8% 0.25% → 0.22% <0.001
fork_exit_chain/dead:0/kernel_reaper:0/iterations:300 22758 → 22318 ns -1.9% 0.29% → 0.25% <0.001
fork_exit_chain/dead:1/kernel_reaper:0/iterations:300 23433 → 22724 ns -3.0% 1.1% → 0.35% <0.001
fork_exit_chain/dead:4/kernel_reaper:0/iterations:300 23926 → 23179 ns -3.1% 0.47% → 0.40% <0.001
fork_exit_chain/dead:8/kernel_reaper:0/iterations:300 23582 → 23298 ns -1.2% 1.2% → 0.43% <0.001
fork_exit_chain/dead:64/kernel_reaper:0/iterations:300 23612 → 23501 ns -0.5% 0.68% → 0.29% <0.001
fork_exit_chain/dead:0/kernel_reaper:1/iterations:300 22693 → 22242 ns -2.0% 0.33% → 0.30% <0.001
fork_exit_chain/dead:1/kernel_reaper:1/iterations:300 22996 → 22669 ns -1.4% 0.46% → 0.38% <0.001
fork_exit_chain/dead:4/kernel_reaper:1/iterations:300 23854 → 23086 ns -3.2% 0.91% → 0.33% <0.001
fork_exit_chain/dead:8/kernel_reaper:1/iterations:300 24038 → 23292 ns -3.1% 0.58% → 0.33% <0.001
fork_exit_chain/dead:64/kernel_reaper:1/iterations:300 23660 → 23559 ns -0.4% 0.90% → 0.64% <0.001

BM_sinsp_concatenate_paths_*

Benchmark Median CPU time, master → PR Change Spread (cv) p-value
relative_path 56.4 → 58.3 ns +3.3% 2.5% → 0.21% <0.001
empty_path 40.3 → 42.9 ns +6.6% 0.05% → 0.07% <0.001
absolute_path 57.2 → 60.7 ns +6.0% 0.70% → 0.87% <0.001
too_long_path 3240 → 3247 ns +0.2% 0.02% → 0.03% <0.001
beyond_scratch 46.5 → 47 ns +1.3% 0.03% → 0.49% <0.001

BM_sinsp_utf8_sanitize_*

Benchmark Median CPU time, master → PR Change Spread (cv) p-value
fast_path_ascii_long 67.8 → 68.2 ns +0.5% 0.05% → 1.7% <0.001
fast_path_multibyte_short 14.2 → 15.4 ns +8.3% 1.9% → 0.03% <0.001
fast_path_multibyte_long 5164 → 5169 ns +0.1% 2.9% → 0.03% <0.001
fast_path_mixed_long 2009 → 2441 ns +21.5% 0.09% → 0.54% <0.001
slow_path_c1_controls_long_alloc 1454 → 1758 ns +20.9% (noisy) 10.9% → 0.66% <0.001
slow_path_c1_controls_long_noalloc 1150 → 1756 ns +52.7% 0.05% → 1.2% <0.001
slow_path_sparse_invalid_long_noalloc 137 → 141 ns +2.6% 0.44% → 1.4% <0.001
slow_path_all_invalid_long_alloc 11921 → 11322 ns -5.0% 0.09% → 0.27% <0.001

Other

Benchmark Median CPU time, master → PR Change Spread (cv) p-value
BM_walk_full/1 4500 → 4489 ns -0.2% 0.09% → 0.13% <0.001
BM_walk_full/4 4545 → 4533 ns -0.3% 0.11% → 0.11% <0.001
BM_walk_full/16 4722 → 4707 ns -0.3% 0.09% → 0.11% <0.001
BM_walk_nth/1 4500 → 4474 ns -0.6% 0.10% → 0.07% <0.001
BM_walk_nth/4 4543 → 4537 ns -0.1% 0.07% → 0.09% <0.001
BM_walk_dead/0 4714 → 4709 ns -0.1% 0.13% → 0.11% 0.004
BM_walk_dead/1 4721 → 4706 ns -0.3% 0.10% → 0.09% <0.001
BM_walk_dead/4 4681 → 4667 ns -0.3% 0.17% → 0.12% <0.001
BM_walk_dead/8 4617 → 4613 ns -0.1% 0.09% → 0.11% <0.001
BM_exit/0/iterations:2000 7012 → 6946 ns -0.9% 0.20% → 0.27% <0.001
BM_exit/1/iterations:2000 7018 → 6894 ns -1.8% 0.20% → 0.37% <0.001
BM_exit/10/iterations:2000 7165 → 7017 ns -2.1% 0.18% → 0.26% <0.001
BM_exit/100/iterations:2000 7685 → 7599 ns -1.1% 0.63% → 0.83% <0.001
BM_exit/1000/iterations:2000 8417 → 8338 ns -0.9% 1.8% → 2.0% <0.001
BM_sinsp_split 239 → 235 ns -1.6% 0.66% → 0.54% <0.001
18 benchmark(s) with no statistically significant change

BM_plugin_field_*

Benchmark Median CPU time, master → PR Change Spread (cv) p-value
evtnum 113 → 113 ms +0.2% 0.59% → 0.53% 0.140
proc_pid 115 → 115 ms -0.2% 0.56% → 0.46% 0.172
proc_glob 131 → 131 ms +0.1% 0.33% → 0.30% 0.543
proc_in 122 → 122 ms +0.2% 0.48% → 0.45% 0.379
proc_pid_x2 120 → 120 ms -0.3% 0.47% → 0.72% 0.457
v3_const 135 → 135 ms -0.1% 0.43% → 0.22% 0.310
v3_ip 135 → 135 ms +0.1% 0.46% → 0.34% 0.457

BM_clone_after_*

Benchmark Median CPU time, master → PR Change Spread (cv) p-value
fork_exit_chain/dead:64/kernel_reaper:0/iterations:300 30359 → 30339 ns -0.1% 1.1% → 0.40% 0.715
fork_exit_chain/dead:8/kernel_reaper:1/iterations:300 30281 → 30220 ns -0.2% 0.36% → 0.37% 0.064
fork_exit_chain/dead:64/kernel_reaper:1/iterations:300 30370 → 30357 ns 0.0% 0.51% → 0.27% 0.598

BM_sinsp_concatenate_paths_*

Benchmark Median CPU time, master → PR Change Spread (cv) p-value
long_normalizing_path 669 → 668 ns -0.1% 0.23% → 0.54% 0.102

BM_sinsp_utf8_sanitize_*

Benchmark Median CPU time, master → PR Change Spread (cv) p-value
fast_path_ascii_short 17.5 → 17.5 ns 0.0% 0.12% → 2.8% 0.102
slow_path_sparse_invalid_long_alloc 243 → 245 ns +0.5% 1.5% → 0.75% 0.262
slow_path_all_invalid_long_noalloc 11715 → 11708 ns -0.1% 0.09% → 0.09% 0.181

Other

Benchmark Median CPU time, master → PR Change Spread (cv) p-value
BM_walk_full/64 5646 → 5635 ns -0.2% 0.20% → 0.48% 0.120
BM_walk_nth/2 4504 → 4507 ns +0.1% 0.09% → 0.22% 0.756
BM_walk_nth/8 4587 → 4578 ns -0.2% 0.18% → 0.27% 0.120
BM_walk_dead/15 4512 → 4513 ns 0.0% 0.08% → 0.11% 0.441

…I test

gtest's ASSERT_EQ binds a reference to its arguments, but scap events are
packed so evt->tid can be misaligned; UBSan reported it. Also apply cmake-format
to the kmod CMakeLists.txt.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Keita Higaki <higaki.keichan@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants