Skip to content

Conversation

@not-matthias
Copy link
Member

@not-matthias not-matthias commented Jan 23, 2026

  • Add C++ and Rust tests using common allocator functions
  • Also fixes a few issues discovered by the tests:
    • Adds support for previously missing posix_memalign and libstdc++ (libc but for C++)
    • Detect non-default allocators first for binaries
    • Attach to different jemalloc prefixed functions

@not-matthias not-matthias force-pushed the cod-2002-add-rust-c-integration-tests-to-runner branch from 9477d9a to b3231ff Compare January 23, 2026 13:33
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 23, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing cod-2002-add-rust-c-integration-tests-to-runner (51536d2) with main (6e5891e)

Summary

✅ 4 untouched benchmarks

@not-matthias not-matthias force-pushed the cod-2002-add-rust-c-integration-tests-to-runner branch 4 times, most recently from 63327c6 to cea4068 Compare January 23, 2026 16:31
@not-matthias not-matthias force-pushed the cod-2002-add-rust-c-integration-tests-to-runner branch from cea4068 to 614ab90 Compare January 28, 2026 17:00
@not-matthias not-matthias force-pushed the cod-2002-add-rust-c-integration-tests-to-runner branch from 614ab90 to 2670fb3 Compare January 28, 2026 17:51
@not-matthias not-matthias force-pushed the cod-2002-add-rust-c-integration-tests-to-runner branch from 2670fb3 to 51536d2 Compare January 28, 2026 18:01
Copy link
Contributor

@GuillaumeLagrange GuillaumeLagrange left a comment

Choose a reason for hiding this comment

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

olgtm


type TrackResult = anyhow::Result<(Vec<Event>, std::thread::JoinHandle<()>)>;

macro_rules! assert_events_with_marker {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add an example usage as docstring here

@@ -1,38 +1,13 @@
use libbpf_rs::ErrorExt;
use memtrack::{EventType, MemtrackEventExt, Tracker};
mod shared;
Copy link
Contributor

Choose a reason for hiding this comment

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

couldnt we get rid of all the checking logic and add snapshots here as well ?


// Prefixed standard API
// je_*_default API (C++ with static linking)
self.try_attach_malloc(lib_path, "je_malloc_default");
Copy link
Contributor

Choose a reason for hiding this comment

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

I can see this becoming quite an annoying thing to maintain over time.

Could we have some sort of structured consts for each allocator that would just be

struct AllocatorSymbols {
   pub malloc_symbols = [...];
   pub ...
}

then each prob attach function would just loop over each symbol and call the proper functoin

Feel free to disregard if you dont see the point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants