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(userspace/libsinsp): always initialize sinsp_evt with a proper source_idx and source_name #2190

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented Dec 9, 2024

What type of PR is this?

/kind bug

Any specific area of the project related to this PR?

/area libsinsp

Does this PR require a change in the driver versions?

What this PR does / why we need it:

This also fixes a bug where using sinsp m_filter on a plugin-exposed field in scap replay mode would SIGABRT.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

…urce_idx and source_name.

Signed-off-by: Federico Di Pierro <[email protected]>
@poiana
Copy link
Contributor

poiana commented Dec 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 Author

FedeDP commented Dec 9, 2024

/milestone 0.20.0

/cc @jasondellaluce @LucaGuerra

m_rawbuf_str_len(0),
m_filtered_out(false),
m_event_info_table(g_infotables.m_event_info) {}
sinsp_evt::sinsp_evt(sinsp *inspector): sinsp_evt() {
Copy link
Contributor

@LucaGuerra LucaGuerra Dec 9, 2024

Choose a reason for hiding this comment

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

nice! didn't know you could do that

Copy link

github-actions bot commented Dec 9, 2024

Perf diff from master - unit tests

    11.69%     -1.94%  [.] sinsp_parser::reset
     6.80%     +1.37%  [.] sinsp_evt::get_type
     1.99%     +0.83%  [.] next
     3.21%     +0.52%  [.] sinsp_evt::load_params
     2.79%     +0.43%  [.] sinsp_thread_manager::get_thread_ref
     1.40%     -0.42%  [.] 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
     5.88%     -0.42%  [.] next_event_from_file
     0.75%     +0.40%  [.] sinsp_evt::get_direction
     4.33%     +0.38%  [.] gzfile_read
     2.72%     -0.35%  [.] is_conversion_needed

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.0228         +0.0228           146           149           146           149
BM_sinsp_split_median                                          +0.0287         +0.0287           145           149           145           149
BM_sinsp_split_stddev                                          -0.5610         -0.5609             3             1             3             1
BM_sinsp_split_cv                                              -0.5708         -0.5706             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  -0.0908         -0.0908            61            56            61            56
BM_sinsp_concatenate_paths_relative_path_median                -0.0902         -0.0902            61            56            61            56
BM_sinsp_concatenate_paths_relative_path_stddev                +0.1861         +0.1913             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_cv                    +0.3046         +0.3103             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0502         -0.0501            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_median                   -0.0463         -0.0463            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.8321         -0.8320             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.8232         -0.8231             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  -0.1473         -0.1473            65            55            65            55
BM_sinsp_concatenate_paths_absolute_path_median                -0.1479         -0.1478            65            55            65            55
BM_sinsp_concatenate_paths_absolute_path_stddev                +2.2365         +2.2218             0             1             0             1
BM_sinsp_concatenate_paths_absolute_path_cv                    +2.7954         +2.7781             0             0             0             0
BM_sinsp_split_container_image_mean                            +0.0039         +0.0039           395           396           395           396
BM_sinsp_split_container_image_median                          +0.0039         +0.0039           395           397           395           397
BM_sinsp_split_container_image_stddev                          +0.2082         +0.2105             2             3             2             3
BM_sinsp_split_container_image_cv                              +0.2035         +0.2058             0             0             0             0

Copy link

codecov bot commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.19%. Comparing base (0b53bd7) to head (af97e47).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2190      +/-   ##
==========================================
- Coverage   75.20%   75.19%   -0.02%     
==========================================
  Files         259      259              
  Lines       33890    33876      -14     
  Branches     5801     5801              
==========================================
- Hits        25487    25473      -14     
  Misses       8403     8403              
Flag Coverage Δ
libsinsp 75.19% <100.00%> (-0.02%) ⬇️

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.

@poiana poiana merged commit 4462fee into master Dec 9, 2024
49 checks passed
@poiana poiana deleted the fix/sinsp_evt_always_init_source branch December 9, 2024 13:06
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