Skip to content

Comments

refactor: remove redundant zero init in aggregate initialization#2467

Closed
ekoops wants to merge 2 commits intomasterfrom
ekoops/redundant-zero-init
Closed

refactor: remove redundant zero init in aggregate initialization#2467
ekoops wants to merge 2 commits intomasterfrom
ekoops/redundant-zero-init

Conversation

@ekoops
Copy link
Contributor

@ekoops ekoops commented Jun 10, 2025

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind test

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area API-version

/area build

/area CI

/area driver-kmod

/area driver-bpf

/area driver-modern-bpf

/area libscap-engine-bpf

/area libscap-engine-gvisor

/area libscap-engine-kmod

/area libscap-engine-modern-bpf

/area libscap-engine-nodriver

/area libscap-engine-noop

/area libscap-engine-source-plugin

/area libscap-engine-savefile

/area libscap

/area libpman

/area libsinsp

/area tests

/area proposals

Does this PR require a change in the driver versions?

/version driver-API-version-major

/version driver-API-version-minor

/version driver-API-version-patch

/version driver-SCHEMA-version-major

/version driver-SCHEMA-version-minor

/version driver-SCHEMA-version-patch

What this PR does / why we need it:

This PR removes redundant zero initializer in aggregate initialization, addressing some issues arised in CI while testing #2466 on ppc64 architecture in https://github.com/falcosecurity/libs/actions/runs/15559386794/job/43807692586?pr=2466 .

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@github-actions
Copy link

Please double check driver/SCHEMA_VERSION file. See versioning.

/hold

@poiana
Copy link
Contributor

poiana commented Jun 10, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ekoops

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

The pull request process is described 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

@ekoops
Copy link
Contributor Author

ekoops commented Jun 10, 2025

/milestone 0.22.0

@poiana poiana requested review from FedeDP and hbrueckner June 10, 2025 15:41
@poiana poiana added this to the 0.22.0 milestone Jun 10, 2025
@ekoops
Copy link
Contributor Author

ekoops commented Jun 10, 2025

Commit 2b3fc63 added in order to trigger driver tests.

@github-actions
Copy link

github-actions bot commented Jun 10, 2025

Perf diff from master - unit tests

     2.70%     -0.54%  [.] sinsp_thread_manager::get_thread_ref
    25.17%     -0.43%  [.] sinsp_thread_manager::create_thread_dependencies
     5.51%     -0.38%  [.] sinsp_evt::get_type
     2.61%     +0.24%  [.] sinsp_evt::load_params
     1.84%     -0.23%  [.] can_query_os_for_thread_info
     2.28%     +0.21%  [.] 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> >::_M_find_before_node
     1.00%     +0.17%  [.] sinsp_evt_filter::sinsp_evt_filter
     1.09%     -0.15%  [.] 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> >::_M_find_before_node
     0.80%     +0.15%  [.] libsinsp::events::is_unknown_event
     5.56%     +0.13%  [.] sinsp_parser::reset

Heap diff from master - unit tests

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

Heap diff from master - scap file

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

Benchmarks diff from master

Comparing gbench_data.json to /root/actions-runner/_work/libs/libs/build/gbench_data.json
Benchmark                                                         Time             CPU      Time Old      Time New       CPU Old       CPU New
----------------------------------------------------------------------------------------------------------------------------------------------
BM_sinsp_split_mean                                            +0.0034         +0.0034           146           146           146           146
BM_sinsp_split_median                                          +0.0046         +0.0046           146           146           146           146
BM_sinsp_split_stddev                                          -0.6187         -0.6185             2             1             2             1
BM_sinsp_split_cv                                              -0.6199         -0.6198             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0116         +0.0116            57            58            57            58
BM_sinsp_concatenate_paths_relative_path_median                +0.0109         +0.0108            57            58            57            58
BM_sinsp_concatenate_paths_relative_path_stddev                +3.2286         +3.2281             0             1             0             1
BM_sinsp_concatenate_paths_relative_path_cv                    +3.1800         +3.1795             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0024         -0.0025            24            24            24            24
BM_sinsp_concatenate_paths_empty_path_median                   -0.0026         -0.0026            24            24            24            24
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.1871         -0.1906             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.1852         -0.1886             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  -0.0333         -0.0334            59            57            59            57
BM_sinsp_concatenate_paths_absolute_path_median                -0.0270         -0.0270            59            57            59            57
BM_sinsp_concatenate_paths_absolute_path_stddev                -0.4060         -0.4063             1             1             1             1
BM_sinsp_concatenate_paths_absolute_path_cv                    -0.3855         -0.3858             0             0             0             0

@codecov
Copy link

codecov bot commented Jun 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.92%. Comparing base (42182ff) to head (67f3b33).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2467      +/-   ##
==========================================
+ Coverage   77.84%   77.92%   +0.07%     
==========================================
  Files         248      249       +1     
  Lines       31017    31128     +111     
  Branches     4661     4661              
==========================================
+ Hits        24144    24255     +111     
  Misses       6873     6873              
Flag Coverage Δ
libsinsp 77.92% <100.00%> (+0.07%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@ekoops ekoops force-pushed the ekoops/redundant-zero-init branch from 2b3fc63 to c2c12b4 Compare June 10, 2025 15:57
@poiana poiana added size/XL and removed size/L labels Jun 10, 2025
@github-actions
Copy link

github-actions bot commented Jun 10, 2025

X64 kernel testing matrix

KERNEL CMAKE-CONFIGURE KMOD BUILD KMOD SCAP-OPEN BPF-PROBE BUILD BPF-PROBE SCAP-OPEN MODERN-BPF SCAP-OPEN
amazonlinux2-4.19 🟢 🟢 🟢 🟢 🟢 🟡
amazonlinux2-5.10 🟢 🟢 🟢 🟢 🟢 🟢
amazonlinux2-5.15 🟢 🟢 🟢 🟢 🟢 🟢
amazonlinux2-5.4 🟢 🟢 🟢 🟢 🟢 🟡
amazonlinux2022-5.15 🟢 🟢 🟢 🟢 🟢 🟢
amazonlinux2023-6.1 🟢 🟢 🟢 🟢 🟢 🟢
archlinux-6.0 🟢 🟢 🟢 🟢 🟢 🟢
archlinux-6.7 🟢 🟢 🟢 🟢 🟢 🟢
centos-3.10 🟢 🟢 🟢 🟡 🟡 🟡
centos-4.18 🟢 🟢 🟢 🟢 🟢 🟢
centos-5.14 🟢 🟢 🟢 🟢 🟢 🟢
fedora-5.17 🟢 🟢 🟢 🟢 🟢 🟢
fedora-5.8 🟢 🟢 🟢 🟢 🟢 🟢
fedora-6.2 🟢 🟢 🟢 🟢 🟢 🟢
oraclelinux-3.10 🟢 🟢 🟢 🟡 🟡 🟡
oraclelinux-4.14 🟢 🟢 🟢 🟢 🟢 🟡
oraclelinux-5.15 🟢 🟢 🟢 🟢 🟢 🟢
oraclelinux-5.4 🟢 🟢 🟢 🟢 🟢 🟡
ubuntu-4.15 🟢 🟢 🟢 🟢 🟢 🟡
ubuntu-5.8 🟢 🟢 🟢 🟢 🟢 🟡
ubuntu-6.5 🟢 🟢 🟢 🟢 🟢 🟢

ARM64 kernel testing matrix

KERNEL CMAKE-CONFIGURE KMOD BUILD KMOD SCAP-OPEN BPF-PROBE BUILD BPF-PROBE SCAP-OPEN MODERN-BPF SCAP-OPEN
amazonlinux2-5.4 🟢 🟢 🟢 🟢 🟢 🟡
amazonlinux2022-5.15 🟢 🟢 🟢 🟢 🟢 🟢
fedora-6.2 🟢 🟢 🟢 🟢 🟢 🟢
oraclelinux-4.14 🟢 🟢 🟢 🟡 🟡 🟡
oraclelinux-5.15 🟢 🟢 🟢 🟢 🟢 🟢
ubuntu-6.5 🟢 🟢 🟢 🟢 🟢 🟢

ekoops added 2 commits June 10, 2025 17:59
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
@ekoops ekoops force-pushed the ekoops/redundant-zero-init branch from c2c12b4 to 67f3b33 Compare June 10, 2025 15:59
@ekoops
Copy link
Contributor Author

ekoops commented Jun 10, 2025

Commit 67f3b33 added in order to trigger driver tests.

int32_t fd = 0;

/* Parameter 1: fd (type: PT_FD) */
/* Parameter 1: fd (type: PT_FD) */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want the extra space here? ;) this is the only change in driver/ so I think I'd skip that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a whitespace comment to trigger drivers CI! 😂

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what happens when -ENOBRAIN meets -ENOCOFFEE 🤦

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😂

@ekoops ekoops closed this Jun 10, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Falco Roadmap Jun 10, 2025
@ekoops ekoops reopened this Jun 10, 2025
@github-project-automation github-project-automation bot moved this from Done to In progress in Falco Roadmap Jun 10, 2025
@ekoops ekoops closed this Jun 11, 2025
@github-project-automation github-project-automation bot moved this from In progress to Done in Falco Roadmap Jun 11, 2025
@ekoops
Copy link
Contributor Author

ekoops commented Jun 11, 2025

Closed in favor of #2470

@ekoops ekoops deleted the ekoops/redundant-zero-init branch June 11, 2025 09:58
@leogr leogr removed this from the 0.22.0 milestone Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants