ninjatracing-rs
Rust port of the ninjatracing Python script (originally from https://github.com/nico/ninjatracing). Converts Ninja build logs (.ninja_log) to Chrome Tracing format, enabling visualization of build performance in chrome://tracing or perfetto.dev.
Installation
As a CLI Tool
From crates.io (Recommended)
From source
As a Library
Add this to your Cargo.toml:
[]
= "0.1"
Or with only the library (without CLI):
[]
= { = "0.1", = false }
CLI Usage
Arguments
| Argument | Description |
|---|---|
<LOG_FILES>... |
One or more .ninja_log files to parse. |
-a, --showall |
Report on last build step for all outputs. Default is to report just on the last (possibly incremental) build. |
-g, --granularity <US> |
Minimum length time-trace event to embed in microseconds (default: 50000). |
-e, --embed-time-trace |
Embed clang -ftime-trace json file found adjacent to a target file. |
Examples
# Basic usage
# Show all incremental steps
# Embed clang traces
Library Usage
use ;
use File;
use BufReader;