Skip to content

Conversation

@not-matthias
Copy link
Member

@not-matthias not-matthias commented Nov 24, 2025

Changes in this PR:

  • Add MessagePack serialization for markers and heaptrack results
  • Made the RunnerFifo shared across modes (walltime and memory use it at the moment)
  • Added the heaptrack CLI + support to enable/disable it via IPC
  • Added the memory executor (WIP)

TODO:

  • Create release CI for codspeed-heaptrack
  • Fix lints
  • Add upload implementation for memory
  • Parse the backend response skipped for now, we'll add this later
  • Ensure env forwarding works (cargo codspeed run)
  • Rename to memtrack

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds memory profiling capability to the codebase through a new Memory executor that uses eBPF-based tracking via a custom heaptrack crate. The implementation allows tracking memory allocations (malloc, free, calloc, realloc, etc.) in benchmarked programs.

Key Changes:

  • Introduces a new MemoryExecutor that uses eBPF uprobes to track memory allocations
  • Adds a heaptrack crate with BPF programs for monitoring malloc/free and related syscalls
  • Refactors FIFO communication handling into shared code to support multiple executor types
  • Updates test snapshots to use Git LFS for large binary data

Reviewed changes

Copilot reviewed 52 out of 54 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/run/runner/memory/executor.rs Implements the new Memory executor using heaptrack IPC for control
src/run/runner/shared/fifo.rs Extracts shared FIFO message handling logic for reuse across executors
src/run/runner/wall_time/perf/mod.rs Refactors to use shared FIFO handling code
crates/heaptrack/* New crate providing eBPF-based memory tracking with BPF programs and IPC
src/run/uploader/upload.rs Adds Memory executor case (currently unimplemented)
flake.nix Adds Nix development environment configuration
.github/workflows/ci.yml Updates CI to install dependencies and run BPF tests separately
Snapshot files Migrates large test snapshots to Git LFS

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@not-matthias not-matthias force-pushed the cod-1670-runner-profile-memory-of-command branch 4 times, most recently from 9aaf842 to 28a793b Compare November 26, 2025 13:15
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.

CI does not build, and the CI change commit scares me a bit, going forward not gonna lie

Just so I know, have you had the protobuf decision challenged ?
Could be good to have a small design document just to make sure the whole team is aligned behind the choice.

@not-matthias not-matthias force-pushed the cod-1670-runner-profile-memory-of-command branch 6 times, most recently from 0e32eca to 9917752 Compare December 2, 2025 13:48
@not-matthias not-matthias force-pushed the cod-1670-runner-profile-memory-of-command branch 2 times, most recently from b05d317 to 100f423 Compare December 3, 2025 13:30
@not-matthias
Copy link
Member Author

@GuillaumeLagrange As discussed, I updated the benchmark result types to use rmp-serde. The file names are now also based on the struct name:

[14:28] not-matthias@~ > eza -alh /tmp/profile.Hrgnlk6YFL.out/results
Permissions Size User         Date Modified Name
.rw-r--r--  658k root          3 Dec 14:28  592283.HeaptrackResult.msgpack
.rw-r--r--  2.4k not-matthias  3 Dec 14:28  MarkerResult.msgpack

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.

Really cool! Let me know if you want to discuss naming

@not-matthias not-matthias force-pushed the cod-1670-runner-profile-memory-of-command branch 2 times, most recently from 863e36a to 5f87e90 Compare December 5, 2025 15:00
@not-matthias not-matthias force-pushed the cod-1670-runner-profile-memory-of-command branch 4 times, most recently from a0c59b0 to d761c18 Compare December 8, 2025 11:53
@not-matthias not-matthias force-pushed the cod-1670-runner-profile-memory-of-command branch 3 times, most recently from aab7676 to c47450e Compare December 8, 2025 18:05
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

@not-matthias not-matthias force-pushed the cod-1670-runner-profile-memory-of-command branch 2 times, most recently from 1c27363 to 524ff20 Compare December 9, 2025 13:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 47 out of 48 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@not-matthias not-matthias force-pushed the cod-1670-runner-profile-memory-of-command branch from 3f08e89 to 03c7db9 Compare December 9, 2025 14:25
@not-matthias
Copy link
Member Author

As discussed, I'll merge this now and we'll implement further improvements and fixes afterwards.

@not-matthias not-matthias merged commit 03c7db9 into main Dec 10, 2025
12 checks passed
@not-matthias not-matthias deleted the cod-1670-runner-profile-memory-of-command branch December 10, 2025 17:35
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