Skip to content

fix: correct clocks for perfetto exporter - #321

Merged
kxxt merged 1 commit into
mainfrom
perfetto-fix
Sep 6, 2026
Merged

kxxt merged 1 commit into
mainfrom
perfetto-fix

Conversation

@kxxt

@kxxt kxxt commented Sep 6, 2026

Copy link
Copy Markdown
Owner

No description provided.

@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
tracexec Ready Ready Preview Sep 6, 2026 1:34am UTC

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Team

Run ID: c547f98f-9a72-410d-9d0f-93e4da82259b

📥 Commits

Reviewing files that changed from the base of the PR and between 8b9b538 and 53a2b11.

📒 Files selected for processing (4)
  • crates/tracexec-exporter-perfetto/Cargo.toml
  • crates/tracexec-exporter-perfetto/src/packet.rs
  • crates/tracexec-exporter-perfetto/src/perfetto.rs
  • crates/tracexec-exporter-perfetto/src/producer.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@greptile-apps

greptile-apps Bot commented Sep 6, 2026

Copy link
Copy Markdown

Greptile Summary

The PR corrects Perfetto timestamp interpretation by declaring event timestamps as realtime and adding a snapshot that relates realtime to boottime.

  • Enables the nix time APIs needed to read system clocks.
  • Emits BOOTTIME and REALTIME readings in the initial trace packet.
  • Propagates clock-read failures through packet producer and exporter initialization.
  • Adds unit coverage for the clock IDs, readings, and default timestamp domain.

Confidence Score: 5/5

The PR appears safe to merge, with the emitted timestamp domain matching existing event timestamps and initialization errors handled consistently.

Existing event producers supply Unix/realtime timestamps, the initial packet now identifies that domain and relates it to Perfetto’s boottime domain, and all affected constructor callers correctly handle the new fallible result.

Important Files Changed

Filename Overview
crates/tracexec-exporter-perfetto/Cargo.toml Enables the nix time feature required by the newly used clock APIs.
crates/tracexec-exporter-perfetto/src/packet.rs Declares event timestamps as REALTIME, records BOOTTIME/REALTIME correspondence, and tests the emitted clock snapshot.
crates/tracexec-exporter-perfetto/src/perfetto.rs Correctly propagates failures encountered while constructing the initial clock snapshot.
crates/tracexec-exporter-perfetto/src/producer.rs Makes producer initialization fallible and consistently propagates packet-creator initialization errors.

Sequence Diagram

sequenceDiagram
  participant Exporter
  participant Producer
  participant Clock as Linux clocks
  participant Recorder
  participant Perfetto
  Exporter->>Producer: initialize
  Producer->>Clock: read CLOCK_BOOTTIME
  Producer->>Clock: read CLOCK_REALTIME
  Producer-->>Exporter: initial ClockSnapshot
  Exporter->>Recorder: record snapshot and REALTIME defaults
  Exporter->>Recorder: record Unix-time event packets
  Recorder-->>Perfetto: trace with related clock domains
Loading

Reviews (1): Last reviewed commit: "fix: correct clocks for perfetto exporte..." | Re-trigger Greptile

@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.21429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.60%. Comparing base (fc84e6b) to head (53a2b11).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
crates/tracexec-exporter-perfetto/src/packet.rs 97.91% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #321      +/-   ##
==========================================
+ Coverage   82.47%   82.60%   +0.13%     
==========================================
  Files          84       84              
  Lines       21393    21434      +41     
==========================================
+ Hits        17644    17706      +62     
+ Misses       3749     3728      -21     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kxxt
kxxt merged commit a6824cc into main Sep 6, 2026
27 checks passed
@kxxt
kxxt deleted the perfetto-fix branch September 6, 2026 02:12

This branch was successfully deployed

1 active deployment
Preview — 53a2b11e Deployed Sep 6, 2026 by vercel[bot]
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.

1 participant