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

fix(driver): add a check on the SCHEMA version compatibility #2228

Merged

Conversation

Andreagit97
Copy link
Member

What type of PR is this?

/kind bug

Any specific area of the project related to this PR?

/area API-version

Does this PR require a change in the driver versions?

Not sure, maybe we want to bump a major in the API just to be sure we always enforce the new check?

What this PR does / why we need it:

This PR should provide a mitigation for this #1283 (comment)

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

fix(driver): add a check on the SCHEMA version compatibility

Copy link

github-actions bot commented Jan 8, 2025

Please double check driver/API_VERSION file. See versioning.

/hold

Copy link

github-actions bot commented Jan 8, 2025

Perf diff from master - unit tests

    11.82%     +1.62%  [.] sinsp::next
     2.01%     +1.39%  [.] scap_event_decode_params
    11.06%     -0.92%  [.] sinsp_parser::reset
     1.15%     +0.71%  [.] sinsp_evt::get_ts
     2.91%     -0.64%  [.] sinsp_parser::process_event
     2.53%     -0.47%  [.] is_conversion_needed
     3.24%     +0.37%  [.] gzfile_read
     1.18%     -0.35%  [.] sinsp_evt::get_syscall_return_value
     1.78%     +0.31%  [.] 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.62%     -0.29%  [.] convert_event

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.0409         +0.0409           147           153           147           153
BM_sinsp_split_median                                          +0.0421         +0.0421           147           153           146           153
BM_sinsp_split_stddev                                          +2.0112         +2.0151             1             2             1             2
BM_sinsp_split_cv                                              +1.8929         +1.8966             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0169         +0.0169            58            59            58            59
BM_sinsp_concatenate_paths_relative_path_median                -0.0109         -0.0109            58            57            58            57
BM_sinsp_concatenate_paths_relative_path_stddev                +9.7337         +9.7235             0             2             0             2
BM_sinsp_concatenate_paths_relative_path_cv                    +9.5556         +9.5456             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     +0.0542         +0.0542            24            25            24            25
BM_sinsp_concatenate_paths_empty_path_median                   +0.0501         +0.0501            24            25            24            25
BM_sinsp_concatenate_paths_empty_path_stddev                   +6.7667         +6.7670             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       +6.3677         +6.3680             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.0611         +0.0611            56            59            56            59
BM_sinsp_concatenate_paths_absolute_path_median                +0.0211         +0.0212            56            57            56            57
BM_sinsp_concatenate_paths_absolute_path_stddev               +18.3902        +18.4386             0             4             0             4
BM_sinsp_concatenate_paths_absolute_path_cv                   +17.2741        +17.3196             0             0             0             0
BM_sinsp_split_container_image_mean                            -0.0062         -0.0062           389           386           389           386
BM_sinsp_split_container_image_median                          -0.0098         -0.0098           390           386           390           386
BM_sinsp_split_container_image_stddev                          -0.0106         -0.0114             3             3             3             3
BM_sinsp_split_container_image_cv                              -0.0044         -0.0052             0             0             0             0

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.06%. Comparing base (385822d) to head (7d2e48e).
Report is 21 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2228      +/-   ##
==========================================
- Coverage   75.44%   75.06%   -0.39%     
==========================================
  Files         265      267       +2     
  Lines       34057    34259     +202     
  Branches     5801     5929     +128     
==========================================
+ Hits        25695    25716      +21     
- Misses       8362     8543     +181     
Flag Coverage Δ
libsinsp 75.06% <ø> (-0.39%) ⬇️

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.

@FedeDP
Copy link
Contributor

FedeDP commented Jan 10, 2025

/cc @leogr

@poiana poiana requested a review from leogr January 10, 2025 08:47
@FedeDP
Copy link
Contributor

FedeDP commented Jan 13, 2025

Setting milestone 0.20.0, we can move it to 0.21.0 if needed.
/milestone 0.20.0

@poiana poiana added this to the 0.20.0 milestone Jan 13, 2025
Copy link
Member

@leogr leogr left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +2035 to +2042
if(driver_minor != required_minor) {
return scap_errprintf(error,
0,
"Scap and the legacy ebpf driver should have the same MINOR version. "
"Ebpf MINOR '%lu' != Scap MINOR '%lu'",
driver_minor,
required_minor);
}
Copy link
Member

Choose a reason for hiding this comment

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

👍

@poiana
Copy link
Contributor

poiana commented Jan 13, 2025

LGTM label has been added.

Git tree hash: 3c0d234edab400c4980b1ffb294b253f4a8cb8bd

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 Jan 13, 2025

[APPROVALNOTIFIER] This PR is APPROVED

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

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:

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

@FedeDP
Copy link
Contributor

FedeDP commented Jan 13, 2025

/unhold

@poiana poiana merged commit be080b5 into falcosecurity:master Jan 13, 2025
50 of 51 checks passed
@Andreagit97 Andreagit97 deleted the fix_ebpf_semver_compatibility branch January 13, 2025 16:00
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.

4 participants