Skip to content

feat: report process comm + gpu ID directly from the ebpf - #151

Merged
luytan merged 2 commits into
mainfrom
ebpf-report-comm-gpu-id
Aug 6, 2026
Merged

feat: report process comm + gpu ID directly from the ebpf#151
luytan merged 2 commits into
mainfrom
ebpf-report-comm-gpu-id

Conversation

@luytan

@luytan luytan commented Aug 6, 2026

Copy link
Copy Markdown
Member

Description

Please include a summary of the changes and if applicable, a related issue.

If this PR introduce a new feature, explain your motivations

Fixes #150 #149

TODO

  • Copy-Paste this line

Checklist:

  • My code follows the style guidelines of this project (cargo fmt)
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the mdBook documentation
  • My changes generate no new warnings (clippy/clang)
  • New and existing unit tests pass locally with my changes (either use nix flake check or wait for the ci)

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Improvements
    • GPU activity reports now include the specific GPU and application name.
    • Process reporting is more accurate by focusing fallback details on currently running applications.
    • Improved handling of process and application identities makes diagnostic information clearer.
  • Bug Fixes
    • Malformed activity reports are now detected and logged as warnings instead of being processed silently.
  • Tests
    • Added coverage for GPU identification, application-name decoding, report formatting, and process availability checks.

Walkthrough

Changes

GPU-aware report events

Layer / File(s) Summary
Event contract and eBPF producers
crates/cardwire-ebpf/src/maps.rs, crates/cardwire-ebpf/src/helpers.rs
ReportEvent now carries PID, GPU ID, and a 16-byte command name. eBPF reporting paths populate these fields.
Daemon processing and validation
crates/cardwire-daemon/src/analyzer/models.rs
The daemon decodes command names, preserves GPU identity, checks process liveness for fallback reporting, logs malformed events, and tests the 24-byte layout.
Map key and helper updates
crates/cardwire-ebpf/src/helpers.rs, crates/cardwire-ebpf/src/main.rs
Map operations now use scalar keys directly. Helper lookups preserve their existing fallback behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description retains the template but does not include a change summary, motivation, or completed checklist items. Add a specific summary and motivation, replace the TODO placeholder, and complete the checklist with accurate project status.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: direct eBPF reporting of process command names and GPU IDs.

Comment @coderabbitai help to get the list of available commands.

@luytan luytan linked an issue Aug 6, 2026 that may be closed by this pull request
@luytan
luytan merged commit 1de887f into main Aug 6, 2026
7 checks passed
@luytan
luytan deleted the ebpf-report-comm-gpu-id branch August 7, 2026 09:46
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.

Propagate blocked-process GPU ID to D-Bus log entries Preserve process command in blocked-process D-Bus logs

1 participant