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

wip: feat: add events dimensions file generator in modern probe #2232

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ekoops
Copy link
Contributor

@ekoops ekoops commented Jan 14, 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 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 enables automatic generation of driver/modern_bpf/definitions/events_dimensions.h. The new generator, defined in driver/modern_bpf/definitions/generator/generator.cpp, is called by the build system if any modification to the event table is detected. The generated code is formatted using clang-format, with the configuration taken from .clang-format, as in the root Makefile. The events dimensions file has been added as a separate dependency to the bpf object file targets.

Which issue(s) this PR fixes:

#2227

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@poiana
Copy link
Contributor

poiana commented Jan 14, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

The full list of commands accepted by this bot can be found 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

@poiana poiana requested review from hbrueckner and leogr January 14, 2025 16:58
@ekoops ekoops changed the title feat: add events dimensions file generator in modern probe wip: feat: add events dimensions file generator in modern probe Jan 14, 2025
Copy link

Perf diff from master - unit tests

     3.64%     +0.79%  [.] gzfile_read
     5.75%     -0.61%  [.] next_event_from_file
     1.40%     +0.51%  [.] sinsp::fetch_next_event
     3.36%     +0.48%  [.] sinsp_evt::load_params
     8.22%     +0.46%  [.] sinsp_evt::get_type
    11.28%     -0.41%  [.] sinsp::next
     1.53%     +0.38%  [.] next
     0.47%     +0.27%  [.] std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>
     0.73%     -0.24%  [.] scap_next
     0.70%     -0.24%  [.] sinsp_parser::parse_rw_exit

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.0185         +0.0185           146           148           146           148
BM_sinsp_split_median                                          +0.0195         +0.0194           146           149           146           149
BM_sinsp_split_stddev                                          +1.4638         +1.4627             1             2             1             2
BM_sinsp_split_cv                                              +1.4190         +1.4180             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  -0.0686         -0.0686            61            57            61            57
BM_sinsp_concatenate_paths_relative_path_median                -0.0660         -0.0660            61            57            61            57
BM_sinsp_concatenate_paths_relative_path_stddev                -0.6857         -0.6848             1             0             1             0
BM_sinsp_concatenate_paths_relative_path_cv                    -0.6625         -0.6616             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0009         -0.0009            25            25            25            25
BM_sinsp_concatenate_paths_empty_path_median                   +0.0012         +0.0012            25            25            25            25
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.6855         -0.6864             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.6853         -0.6862             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  -0.1091         -0.1091            64            57            64            57
BM_sinsp_concatenate_paths_absolute_path_median                -0.1107         -0.1107            64            57            64            57
BM_sinsp_concatenate_paths_absolute_path_stddev                +0.3570         +0.3556             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_cv                    +0.5233         +0.5217             0             0             0             0
BM_sinsp_split_container_image_mean                            +0.0075         +0.0075           390           393           390           392
BM_sinsp_split_container_image_median                          +0.0089         +0.0088           389           393           389           393
BM_sinsp_split_container_image_stddev                          -0.0960         -0.0945             3             3             3             3
BM_sinsp_split_container_image_cv                              -0.1027         -0.1013             0             0             0             0

Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.09%. Comparing base (8362ae9) to head (5752742).
Report is 12 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2232   +/-   ##
=======================================
  Coverage   75.09%   75.09%           
=======================================
  Files         276      276           
  Lines       34391    34391           
  Branches     5927     5927           
=======================================
  Hits        25826    25826           
  Misses       8565     8565           
Flag Coverage Δ
libsinsp 75.09% <ø> (ø)

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 15, 2025

/milestone 0.21.0

@poiana poiana added this to the 0.21.0 milestone Jan 15, 2025
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.

3 participants