| Crates.io | renacer |
| lib.rs | renacer |
| version | 0.9.8 |
| created_at | 2025-11-17 12:02:48.544163+00 |
| updated_at | 2026-01-21 09:55:57.677269+00 |
| description | Pure Rust system call tracer with source-aware correlation for Rust binaries |
| homepage | |
| repository | https://github.com/paiml/renacer |
| max_upload_size | |
| id | 1936696 |
| size | 12,653,620 |
Renacer (Spanish: "to be reborn") is a next-generation binary inspection and tracing framework built following Toyota Way principles and EXTREME TDD methodology.
| Metric | Value |
|---|---|
| Current Version | 0.9.5 |
| Status | Production-Ready |
| Test Coverage | 1693+ tests (all passing), 92.84% line coverage |
| TDG Score | 95.1/100 (A+ grade) |
| Performance | <5% overhead (basic), <10% overhead (full stack) |
| Specification | deep-strace-rust-wasm-binary-spec.md |
--stats-extended--hpu-cpu-only--hpu-analysis)--format html)--ml-clusters N (default: 3, min: 2)--ml-anomaly)--transpiler-map FILE.jsonChaosConfig::new().with_memory_limit().with_cpu_limit().build()ChaosConfig::gentle() and ChaosConfig::aggressive()make test-tier1 - Fast tests (<5s): unit + property testsmake test-tier2 - Medium tests (<30s): integration testsmake test-tier3 - Slow tests (<5m): fuzz + mutation testsfuzz/fuzz_targets/filter_parser.rschaos-basic - Resource limits, signal injectionchaos-network - Network/IO chaos (latency, packet loss)chaos-byzantine - Syscall return modificationchaos-full - Complete chaos suite with loom + arbitraryfuzz - Fuzz testing support--otlp-endpoint)--trace-compute-threshold N--trace-compute-all (bypass sampling)--trace-compute)--trace-parent CLI flagTRACEPARENT environment variable# From crates.io
cargo install renacer
# From source
git clone https://github.com/paiml/renacer
cd renacer
cargo install --path .
# Install
cargo install --git https://github.com/paiml/renacer
# Basic tracing
renacer -- ls -la
# With source correlation (requires debug symbols)
renacer --source -- cargo test
# Function profiling with flamegraph
renacer --function-time --source -- ./my-binary > profile.txt
cat profile.txt | flamegraph.pl > flamegraph.svg
# JSON output for scripting
renacer --format json -- echo "test" > trace.json
# CSV output for spreadsheet analysis (Sprint 17)
renacer --format csv -- echo "test" > trace.csv
renacer --format csv -T -- ls > trace-with-timing.csv
renacer --format csv --source -- ./my-binary > trace-with-source.csv
renacer --format csv -c -- cargo build > stats.csv
# HTML output for visual reports (Sprint 22)
renacer --format html -- ls -la > report.html # Visual trace report
renacer --format html -c -- cargo build > stats.html # Statistics as HTML
renacer --format html --source -- ./app > trace.html # With source locations
# Filter syscalls
renacer -e trace=file -- cat file.txt # File operations only
renacer -e trace=open,read,write -- ls # Specific syscalls
renacer -e trace=!close -- ls # All syscalls except close (Sprint 15)
renacer -e trace=file,!close -- cat file # File ops except close (Sprint 15)
# Regex patterns (Sprint 16)
renacer -e 'trace=/^open.*/' -- ls # All syscalls starting with "open"
renacer -e 'trace=/.*at$/' -- cat file # All syscalls ending with "at"
renacer -e 'trace=/read|write/' -- app # Syscalls matching read OR write
renacer -e 'trace=/^open.*/,!/openat/' -- ls # open* except openat
# Multi-process tracing (Sprint 18)
renacer -f -- bash -c "echo parent && (echo child &)" # Follow forks
renacer -f -e trace=file -- make clean # Follow forks with filtering
renacer -f -c -- python app.py # Multi-process statistics
# Statistics summary
renacer -c -T -- cargo build
# Enhanced statistics with percentiles (Sprint 19)
renacer -c --stats-extended -- cargo test # P50/P75/P90/P95/P99 latencies
renacer -c --stats-extended --anomaly-threshold 2.5 -- ./app # Custom anomaly threshold
# HPU-accelerated analysis (Sprint 21)
renacer -c --hpu-analysis -- ./heavy-io-app # Correlation matrix + K-means clustering
renacer -c --hpu-analysis --hpu-cpu-only -- app # Force CPU backend
renacer -c --hpu-analysis -e trace=file -- ls # HPU with filtering
# ML anomaly detection (Sprint 23)
renacer -c --ml-anomaly -- cargo build # KMeans clustering of syscall latencies
renacer -c --ml-anomaly --ml-clusters 5 -- ./app # Custom cluster count
renacer -c --ml-anomaly --ml-compare -- ./app # Compare ML with z-score detection
renacer --ml-anomaly --format json -- ./app > ml.json # ML results in JSON
# Real-time anomaly detection (Sprint 20)
renacer --anomaly-realtime -- ./app # Live anomaly monitoring
renacer --anomaly-realtime --anomaly-window-size 200 -- ./app # Custom window size
renacer -c --anomaly-realtime -- cargo test # Combine with statistics
renacer --anomaly-realtime -e trace=file -- find /usr # Monitor only file operations
# Transpiler source mapping (Sprint 24-28)
renacer --transpiler-map simulation.rs.sourcemap.json -- ./simulation # Load Python→Rust source map
renacer --transpiler-map algorithm.sourcemap.json -- ./algorithm_rs # Load C→Rust source map (Decy)
renacer --transpiler-map app.sourcemap.json --source -- ./transpiled-app # Combine with DWARF
renacer --transpiler-map map.json --function-time -- ./binary # Function profiling with source maps
renacer --transpiler-map map.json -c -- ./binary # Source mapping with statistics
# OpenTelemetry OTLP export (Sprint 30)
docker-compose -f docker-compose-jaeger.yml up -d # Start Jaeger
renacer --otlp-endpoint http://localhost:4317 --otlp-service-name my-app -- ./program
# Open http://localhost:16686 to view traces in Jaeger UI
renacer -s --otlp-endpoint http://localhost:4317 -- ./program # With source correlation
renacer -T --otlp-endpoint http://localhost:4317 -- ./program # With timing
renacer -e trace=file --otlp-endpoint http://localhost:4317 -- ./program # With filtering
# Unified tracing: OTLP + Transpiler decisions (Sprint 31)
renacer --otlp-endpoint http://localhost:4317 --trace-transpiler-decisions -- ./transpiled-app
# See both syscalls and transpiler decisions in Jaeger UI
renacer --otlp-endpoint http://localhost:4317 \
--trace-transpiler-decisions \
--transpiler-map app.sourcemap.json \
-- ./depyler-app # Full observability: decisions + syscalls + source maps
renacer --otlp-endpoint http://localhost:4317 \
--trace-transpiler-decisions \
-T \
-- ./app # With timing for decision performance analysis
# Block-level compute tracing (Sprint 32) - Trueno SIMD operations
renacer --otlp-endpoint http://localhost:4317 \
--trace-compute \
-c --stats-extended \
-- cargo build # Default: Adaptive sampling (trace blocks >=100μs)
renacer --otlp-endpoint http://localhost:4317 \
--trace-compute \
--trace-compute-all \
-c -- ./app # Debug mode: Trace ALL compute blocks (bypass sampling)
renacer --otlp-endpoint http://localhost:4317 \
--trace-compute \
--trace-compute-threshold 50 \
-c -- ./app # Custom threshold: Trace blocks >=50μs
renacer --otlp-endpoint http://localhost:4317 \
--trace-compute \
--trace-transpiler-decisions \
-- ./depyler-app # Full observability: compute + decisions + syscalls
# Distributed tracing (Sprint 33) - W3C Trace Context propagation
export TRACEPARENT="00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01"
renacer --otlp-endpoint http://localhost:4317 -- ./app # Auto-detect from env
renacer --otlp-endpoint http://localhost:4317 \
--trace-parent "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-00" \
-- ./app # Explicit context injection
renacer --otlp-endpoint http://localhost:4317 \
--trace-parent "00-abc123-def456-01" \
--trace-compute \
--trace-transpiler-decisions \
-c --stats-extended \
-- ./app # Full distributed tracing stack
# Attach to running process
renacer -p 1234
$ renacer -- echo "Hello"
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
write(1, "Hello\n", 6) = 6
exit_group(0) = ?
$ renacer --source -- ./my-program
read(3, buf, 1024) = 42 [src/main.rs:15 in my_function]
write(1, "result", 6) = 6 [src/main.rs:20 in my_function]
$ renacer --function-time --source -- cargo test
Function Profiling Summary:
========================
Total functions profiled: 5
Total syscalls: 142
Top 10 Hot Paths (by total time):
1. cargo::build_script - 45.2% (1.2s, 67 syscalls) ⚠️ SLOW I/O
2. rustc::compile - 32.1% (850ms, 45 syscalls)
3. std::fs::read_dir - 12.4% (330ms, 18 syscalls)
...
Call Graph:
cargo::build_script
└─ rustc::compile (67 calls)
└─ std::fs::read_dir (12 calls)
$ renacer -c --stats-extended -- cargo build
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
65.43 0.142301 4234 42 0 read
18.92 0.041234 2062 20 0 write
10.23 0.022301 892 25 0 openat
3.21 0.007001 700 10 0 close
2.21 0.004812 481 10 0 mmap
------ ----------- ----------- --------- --------- ----------------
100.00 0.217649 107 0 total
Latency Percentiles (microseconds):
Syscall P50 P75 P90 P95 P99
-------- ----- ----- ----- ----- -----
read 2834 4123 5234 6123 9234
write 1823 2234 3123 4234 7123
openat 823 1034 1234 1534 2234
close 623 734 823 923 1123
mmap 423 534 623 723 923
Post-Hoc Anomaly Detection (threshold: 3.0σ):
2 anomalies detected:
- read: 9234 μs (4.2σ above mean)
- write: 7123 μs (3.8σ above mean)
$ renacer --anomaly-realtime -- ./slow-app
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY) = 3
read(3, buf, 832) = 832
⚠️ ANOMALY: write took 5234 μs (4.2σ from baseline 102.3 μs) - 🟡 Medium
write(1, "processing...", 14) = 14
⚠️ ANOMALY: fsync took 8234 μs (6.3σ from baseline 123.4 μs) - 🔴 High
fsync(3) = 0
close(3) = 0
=== Real-Time Anomaly Detection Report ===
Total anomalies detected: 12
Severity Distribution:
🔴 High (>5.0σ): 2 anomalies
🟡 Medium (4-5σ): 5 anomalies
🟢 Low (3-4σ): 5 anomalies
Top Anomalies (by Z-score):
1. 🔴 fsync - 6.3σ (8234 μs, baseline: 123.4 ± 1287.2 μs)
2. 🔴 write - 5.7σ (5234 μs, baseline: 102.3 ± 902.1 μs)
3. 🟡 read - 4.8σ (2341 μs, baseline: 87.6 ± 468.9 μs)
... and 9 more
# Start Jaeger backend
$ docker-compose -f docker-compose-jaeger.yml up -d
# Export syscall traces to Jaeger
$ renacer -s --otlp-endpoint http://localhost:4317 --otlp-service-name test-app -- ./test
[renacer: OTLP export enabled to http://localhost:4317]
write(1, "Hello, OpenTelemetry!\n", 22) = 22 [src/main.rs:3 in main]
exit_group(0) = ?
# Open Jaeger UI at http://localhost:16686
# - Service: "test-app"
# - Root span: "process: ./test"
# - Child span: "syscall: write"
# - Attributes: syscall.name=write, syscall.result=22,
# code.filepath=src/main.rs, code.lineno=3
# Export with Grafana Tempo
$ docker-compose -f docker-compose-tempo.yml up -d
$ renacer --otlp-endpoint http://localhost:4317 --otlp-service-name my-service -- ./app
# Open Grafana at http://localhost:3000
# Navigate to Explore > Tempo > Search by service name: "my-service"
For complete OTLP integration guide, see docs/otlp-integration.md.
Benchmarks vs strace (Sprint 11-12):
Following paiml-mcp-agent-toolkit EXTREME TDD:
git clone https://github.com/paiml/renacer
cd renacer
cargo build
The pre-commit hook automatically runs 5 quality gates (<10s):
chmod +x .git/hooks/pre-commit
# Triggered on every commit:
# 1. cargo fmt --check
# 2. cargo clippy -- -D warnings
# 3. bashrs lint (bash/Makefile quality)
# 4. cargo test --test property_based_comprehensive
# 5. cargo audit
# All tests (142 unit + integration)
cargo test
# Property-based tests only (670+ cases)
cargo test --test property_based_comprehensive
# Integration tests with Jaeger backend (Sprint 34)
# Requires Docker for Jaeger All-in-One
docker compose -f docker-compose-test.yml up -d
cargo test --test sprint34_integration_tests -- --ignored --test-threads=1
docker compose -f docker-compose-test.yml down
# With coverage
cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
# Mutation testing
cargo mutants
# TDG analysis
pmat analyze tdg src/
# Dependency audit
cargo audit
# Deny check (licenses, bans, sources)
cargo deny check
cli - Command-line argument parsing (clap)tracer - Core ptrace syscall tracingsyscalls - Syscall name resolution (335 syscalls)dwarf - DWARF debug info parsing (addr2line, gimli)filter - Syscall filtering (classes + individual syscalls + regex)stats - Statistics tracking (Trueno SIMD, percentiles)anomaly - Real-time anomaly detection (Sprint 20)json_output - JSON export formatcsv_output - CSV export format (Sprint 17)html_output - HTML export format (Sprint 22)function_profiler - Function-level profiling with I/O detectionstack_unwind - Stack unwinding for call graphsprofiling - Self-profiling infrastructurehpu - HPU-accelerated analysis (Sprint 21)ml_anomaly - ML-based anomaly detection (Sprint 23)isolation_forest - Isolation Forest outlier detection (Sprint 22)autoencoder - Autoencoder anomaly detection (Sprint 23)transpiler_map - Transpiler source mapping (Sprint 24-28)decision_trace - Decision trace capture (Sprint 26-27)experiment_span - ML experiment tracking spans (REN-001)otlp_exporter - OpenTelemetry OTLP export (Sprint 30)process_tracer - Process-level syscall tracing for ptop integration (Sprint 59)brick_tracer - ComputeBrick-aware tracing for trueno/cbtop (Sprint 58)nix - Ptrace system callsaddr2line, gimli, object - DWARF parsingclap - CLI parsingserde, serde_json - JSON serializationtrueno - SIMD-accelerated statisticsaprender - ML anomaly detectionproptest - Property-based testingopentelemetry, opentelemetry_sdk, opentelemetry-otlp - OTLP tracing (Sprint 30)tokio - Async runtime for OTLP export (Sprint 30)See CHANGELOG.md for version history.
MIT - See LICENSE file.
📖 The Renacer Book - Comprehensive TDD-verified guide (see book/ directory)
The book includes:
All book examples are validated by GitHub Actions to ensure zero hallucination.
See:
Built with:
Developed by Pragmatic AI Labs