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

new(ci,docs): added heaptrack to our new perf related CI. #1932

Merged
merged 3 commits into from
Jun 25, 2024
Merged

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented Jun 24, 2024

What type of PR is this?

/kind feature

Any specific area of the project related to this PR?

/area CI

Does this PR require a change in the driver versions?

What this PR does / why we need it:

Adds heaptrack support to the new perf-related CI.

Also, this improves threshold checks for perf: they now run against sum of diffs, that is more stable and useful. Ie: if part of logic gets moved from one method to another, we expect eg: method_A -> -7%, method_B -> +7%. Before, this triggered the CI error; now it does not, since the sum is 0.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Heaptrack only tracks heap allocations; it cannot track stack allocations. Note this is the same default behavior as valgrind massif tool, since stack tracking completely kill performances.
Also, i chose heaptrack because:

  • it can easily generate flamegraph using same method already used for perf
  • it can easily diff profiles
  • it is quicker and less heavy for the monitored application

For a comparison see: https://github.com/KDE/heaptrack?tab=readme-ov-file#comparison-to-valgrinds-massif

Does this PR introduce a user-facing change?:

new(ci,docs): added heaptrack to our new perf related CI.

@FedeDP
Copy link
Contributor Author

FedeDP commented Jun 24, 2024

/milestone 0.18.0

@poiana poiana added this to the 0.18.0 milestone Jun 24, 2024
@FedeDP FedeDP force-pushed the new/heaptrack branch 4 times, most recently from 089f429 to e4aff9b Compare June 24, 2024 09:39
@@ -214,9 +215,12 @@ TEST(sinsp_utils_test, sinsp_split_check_terminator)
// check that the null terminator is enforced
const char *in = "hello\0worlddd";
size_t len = 13;
#ifdef _DEBUG
EXPECT_THROW(sinsp_split(in, len, '\0'), sinsp_exception);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In DEBUG mode this triggers a (well-known and desired) exception.
This fix allows to run tests on debug builds.

@FedeDP FedeDP changed the title wip: new(ci,docs): added heaptrack to our new perf related CI. new(ci,docs): added heaptrack to our new perf related CI. Jun 24, 2024
Added a check on new leaks for heaptrack checks;
moreover, changed perf checks to run against
sum of diffs, that is more stable and useful.
Ie: if part of logic gets moved from one method to another,
we expect eg: method_A -> -7%, method_B -> +7%.
Before, this triggered the CI error; now it does not, since the sum is 0.

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

FedeDP commented Jun 24, 2024

Perf CI / perf-libs-linux-amd64 (pull_request) Failing after 3m

Fails because it cannot find any master heaptrack related artifacts therefore fails to diff from master.

Copy link
Member

@Andreagit97 Andreagit97 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 Jun 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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,leogr]

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 405ec96 into master Jun 25, 2024
40 of 41 checks passed
@poiana poiana deleted the new/heaptrack branch June 25, 2024 07:59
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