Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update presets and add a basic clang-tidy config #2056

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

Andreagit97
Copy link
Member

What type of PR is this?

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

/kind cleanup

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 updates presets with "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" and "BUILD_WARNINGS_AS_ERRORS": "ON". Moreover it adds a clang-tidy config if someone want to use it locally

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Copy link
Member Author

Choose a reason for hiding this comment

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

we probably need a formatter also for json :/

Copy link

github-actions bot commented Sep 11, 2024

Perf diff from master - unit tests

    10.20%     +1.54%  [.] sinsp_parser::reset
     5.00%     -1.51%  [.] sinsp_evt::load_params
     4.16%     -0.77%  [.] gzfile_read
     3.41%     -0.75%  [.] sinsp_thread_manager::find_thread
     2.15%     -0.72%  [.] std::_Hashtable<long, std::pair<long const, std::shared_ptr<sinsp_threadinfo> >, std::allocator<std::pair<long const, std::shared_ptr<sinsp_threadinfo> > >, std::__detail::_Select1st, std::equal_to<long>, std::hash<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
     0.81%     -0.55%  [.] sinsp_fdtable::find
     5.56%     -0.55%  [.] next
     2.91%     -0.54%  [.] scap_event_decode_params
     0.86%     +0.52%  [.] sinsp_evt::get_ts
     1.09%     -0.52%  [.] sinsp_utils::find_longest_matching_evt_param

Heap diff from master - unit tests

peak heap memory consumption: 0B
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

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.0357         -0.0357           149           144           149           144
BM_sinsp_split_median                                          -0.0339         -0.0339           149           144           149           144
BM_sinsp_split_stddev                                          +0.4967         +0.4964             1             2             1             2
BM_sinsp_split_cv                                              +0.5520         +0.5517             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  -0.0111         -0.0111            47            46            47            46
BM_sinsp_concatenate_paths_relative_path_median                -0.0111         -0.0111            46            46            46            46
BM_sinsp_concatenate_paths_relative_path_stddev                -0.3937         -0.3940             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_cv                    -0.3869         -0.3871             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0152         -0.0151            17            17            17            17
BM_sinsp_concatenate_paths_empty_path_median                   -0.0078         -0.0078            17            17            17            17
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.8719         -0.8718             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.8699         -0.8698             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.0302         +0.0302            50            51            50            51
BM_sinsp_concatenate_paths_absolute_path_median                +0.0163         +0.0163            50            51            50            51
BM_sinsp_concatenate_paths_absolute_path_stddev                +3.3635         +3.3635             0             1             0             1
BM_sinsp_concatenate_paths_absolute_path_cv                    +3.2357         +3.2357             0             0             0             0
BM_sinsp_split_container_image_mean                            -0.0012         -0.0012           353           353           353           353
BM_sinsp_split_container_image_median                          +0.0084         +0.0084           350           353           350           353
BM_sinsp_split_container_image_stddev                          -0.3567         -0.3564             4             3             4             3
BM_sinsp_split_container_image_cv                              -0.3560         -0.3557             0             0             0             0

Copy link

codecov bot commented Sep 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.55%. Comparing base (5b9db23) to head (8d86d96).
Report is 15 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2056      +/-   ##
==========================================
- Coverage   73.55%   73.55%   -0.01%     
==========================================
  Files         253      253              
  Lines       31863    31863              
  Branches     5651     5635      -16     
==========================================
- Hits        23438    23437       -1     
+ Misses       8420     8402      -18     
- Partials        5       24      +19     
Flag Coverage Δ
libsinsp 73.55% <ø> (-0.01%) ⬇️

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.

.clang-tidy Outdated Show resolved Hide resolved
Co-authored-by: Mauro Ezequiel Moltrasio <[email protected]>

Co-authored-by: Mauro Ezequiel Moltrasio <[email protected]>
Signed-off-by: Andrea Terzolo <[email protected]>
@poiana poiana added size/L and removed size/M labels Sep 11, 2024
Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

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

/approve

@poiana
Copy link
Contributor

poiana commented Sep 20, 2024

LGTM label has been added.

Git tree hash: 4537809a0d97dfe0d8ea1503a359ffd349da277c

Copy link
Contributor

@Molter73 Molter73 left a comment

Choose a reason for hiding this comment

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

/lgtm

Left a suggestion for a potential follow up PR.

Comment on lines +3 to +43
"configurePresets": [
{
"name": "scap-drivers",
"displayName": "Build scap drivers and their tests",
"description": "Build all scap drivers (modern eBPF, legacy eBPF, kmod) and their tests",
"generator": "Unix Makefiles",
"binaryDir": "${sourceDir}/build-scap-drivers",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"BUILD_BPF": "ON",
"BUILD_DRIVER": "ON",
"USE_BUNDLED_DEPS": "ON",
"ENABLE_DRIVERS_TESTS": "ON",
"MODERN_BPF_DEBUG_MODE": "ON",
"BUILD_LIBSCAP_MODERN_BPF": "ON",
"BUILD_LIBSCAP_GVISOR": "OFF",
"CREATE_TEST_TARGETS": "ON",
"ENABLE_LIBSCAP_TESTS": "ON",
"SCAP_FILES_SUITE_ENABLE": "OFF",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"BUILD_WARNINGS_AS_ERRORS": "ON"
}
},
{
"name": "sinsp-minimal",
"displayName": "Build sinsp in minimal build",
"description": "Build sinsp in minimal build with its tests",
"generator": "Unix Makefiles",
"binaryDir": "${sourceDir}/build-sinsp-minimal",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"BUILD_DRIVER": "ON",
"BUILD_BPF": "ON",
"USE_BUNDLED_DEPS": "ON",
"CREATE_TEST_TARGETS": "ON",
"MINIMAL_BUILD": "ON",
"SCAP_FILES_SUITE_ENABLE": "OFF",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"BUILD_WARNINGS_AS_ERRORS": "ON"
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not something for this PR, but we could create a default preset in order to reduce some of the configuration.

Suggested change
"configurePresets": [
{
"name": "scap-drivers",
"displayName": "Build scap drivers and their tests",
"description": "Build all scap drivers (modern eBPF, legacy eBPF, kmod) and their tests",
"generator": "Unix Makefiles",
"binaryDir": "${sourceDir}/build-scap-drivers",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"BUILD_BPF": "ON",
"BUILD_DRIVER": "ON",
"USE_BUNDLED_DEPS": "ON",
"ENABLE_DRIVERS_TESTS": "ON",
"MODERN_BPF_DEBUG_MODE": "ON",
"BUILD_LIBSCAP_MODERN_BPF": "ON",
"BUILD_LIBSCAP_GVISOR": "OFF",
"CREATE_TEST_TARGETS": "ON",
"ENABLE_LIBSCAP_TESTS": "ON",
"SCAP_FILES_SUITE_ENABLE": "OFF",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"BUILD_WARNINGS_AS_ERRORS": "ON"
}
},
{
"name": "sinsp-minimal",
"displayName": "Build sinsp in minimal build",
"description": "Build sinsp in minimal build with its tests",
"generator": "Unix Makefiles",
"binaryDir": "${sourceDir}/build-sinsp-minimal",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"BUILD_DRIVER": "ON",
"BUILD_BPF": "ON",
"USE_BUNDLED_DEPS": "ON",
"CREATE_TEST_TARGETS": "ON",
"MINIMAL_BUILD": "ON",
"SCAP_FILES_SUITE_ENABLE": "OFF",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"BUILD_WARNINGS_AS_ERRORS": "ON"
}
}
"configurePresets": [
{
"name": "default",
"generator": "Unix Makefiles",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"BUILD_DRIVER": "ON",
"BUILD_BPF": "ON",
"USE_BUNDLED_DEPS": "ON",
"CREATE_TEST_TARGETS": "ON",
"MINIMAL_BUILD": "ON",
"SCAP_FILES_SUITE_ENABLE": "OFF",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"BUILD_WARNINGS_AS_ERRORS": "ON"
}
},
{
"name": "scap-drivers",
"displayName": "Build scap drivers and their tests",
"description": "Build all scap drivers (modern eBPF, legacy eBPF, kmod) and their tests",
"inherits": "default",
"binaryDir": "${sourceDir}/build-scap-drivers",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"ENABLE_DRIVERS_TESTS": "ON",
"MODERN_BPF_DEBUG_MODE": "ON",
"BUILD_LIBSCAP_MODERN_BPF": "ON",
"BUILD_LIBSCAP_GVISOR": "OFF",
"ENABLE_LIBSCAP_TESTS": "ON"
}
},
{
"name": "sinsp-minimal",
"displayName": "Build sinsp in minimal build",
"description": "Build sinsp in minimal build with its tests",
"inherits": "default",
"binaryDir": "${sourceDir}/build-sinsp-minimal"
}

You might need to also specify binaryDir for the default profile, I haven't tested the change.

@poiana
Copy link
Contributor

poiana commented Sep 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP, Molter73

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Andreagit97,FedeDP,Molter73]

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

@poiana poiana merged commit 03d6e62 into falcosecurity:master Sep 20, 2024
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants