Renacer
Pure Rust system call tracer with source-aware correlation for Rust binaries
Renacer (Spanish: "to be reborn") is a next-generation binary inspection and tracing framework built following Toyota Way principles and EXTREME TDD methodology.
Project Status
Current Version: 0.4.0-dev (Sprint 22 complete - HTML Output Format) Status: Production-Ready + SIMD-Accelerated Statistics + Real-Time Anomaly Detection + HPU Analysis + HTML Reports TDG Score: 99.9/100 (A+ grade) Test Coverage: 290+ tests (all passing) Specification: docs/specifications/deep-strace-rust-wasm-binary-spec.md
Features
Core Tracing (Sprint 1-10, 15-18)
- ✅ Full syscall tracing - All 335 Linux syscalls supported
- ✅ DWARF debug info - Source file and line number correlation
- ✅ Statistics mode (-c flag) - Call counts, error rates, timing
- ✅ JSON/CSV output (--format json/csv) - Machine-readable trace export
- ✅ Advanced filtering (-e trace=SPEC) - File, network, process, memory classes
- ✅ Negation operator (Sprint 15) - Exclude syscalls with ! prefix
- ✅ Regex patterns (Sprint 16) - Pattern matching with /regex/ syntax
- ✅ PID attachment (-p PID) - Attach to running processes
- ✅ Timing mode (-T) - Microsecond-precision syscall durations
- ✅ Multi-process tracing (Sprint 18) - Follow fork/vfork/clone with -f flag
Function Profiling (Sprint 13-14)
- ✅ I/O Bottleneck Detection - Automatic detection of slow I/O (>1ms)
- ✅ Call Graph Tracking - Parent→child function relationships via stack unwinding
- ✅ Hot Path Analysis - Top 10 most expensive functions with percentage breakdown
- ✅ Flamegraph Export - Compatible with flamegraph.pl, inferno, speedscope
Statistical Analysis & Anomaly Detection (Sprint 19-20) 🆕
- ✅ SIMD-Accelerated Statistics (Sprint 19) - Trueno Vector operations for 3-10x faster computations
- ✅ Percentile Analysis (Sprint 19) - P50, P75, P90, P95, P99 latency percentiles via
--stats-extended - ✅ Post-Hoc Anomaly Detection (Sprint 19) - Z-score based outlier identification with configurable threshold
- ✅ Real-Time Anomaly Detection (Sprint 20) - Live monitoring with sliding window baselines
- ✅ Per-Syscall Baselines (Sprint 20) - Independent sliding windows for each syscall type
- ✅ Severity Classification (Sprint 20) - Low (3-4σ), Medium (4-5σ), High (>5σ) anomaly levels
- ✅ Anomaly Summary Reports (Sprint 20) - Detailed reports with severity distribution and top anomalies
HPU Acceleration (Sprint 21)
- ✅ Correlation Matrix Analysis - Compute syscall pattern correlations
- ✅ K-means Clustering - Group syscalls into clusters for hotspot identification
- ✅ Adaptive Backend - Automatic GPU/CPU backend selection
- ✅ CPU Fallback - Force CPU-only processing with
--hpu-cpu-only - ✅ Zero Overhead - No performance impact when disabled (opt-in via
--hpu-analysis)
HTML Output Format (Sprint 22)
- ✅ Interactive HTML Reports - Rich visual syscall trace reports
- ✅ Statistics Integration - Combined with -c mode for visual statistics
- ✅ Source Correlation - Display source locations in HTML tables
- ✅ Export Format - Generate shareable HTML files (
--format html)
ML Anomaly Detection (Sprint 23) 🆕
- ✅ KMeans Clustering - Group syscalls by latency patterns using Aprender ML library
- ✅ Silhouette Score - Measure clustering quality (-1 to 1, higher = better separation)
- ✅ Cluster Analysis - Identify high-latency outlier clusters automatically
- ✅ ML vs Z-Score Comparison - Compare ML-based detection with statistical methods
- ✅ Configurable Clusters - Adjust cluster count via
--ml-clusters N(default: 3, min: 2) - ✅ JSON Integration - ML analysis results included in JSON output
- ✅ Zero Overhead - No impact when disabled (opt-in via
--ml-anomaly)
Quality Infrastructure (v0.2.0-0.3.0)
- ✅ Property-based testing - 670+ test cases via proptest
- ✅ Pre-commit hooks - 5 quality gates (format, clippy, tests, audit, bash)
- ✅ Dependency policy - cargo-deny configuration for security
- ✅ Zero warnings - Clippy strict mode enforced
- ✅ Trueno integration - SIMD-accelerated statistics via trueno v0.1.0
- ✅ 100% coverage - All new modules (anomaly.rs) have 100% test coverage
Quick Start
# Install
# Basic tracing
# With source correlation (requires debug symbols)
# Function profiling with flamegraph
|
# JSON output for scripting
# CSV output for spreadsheet analysis (Sprint 17)
# HTML output for visual reports (Sprint 22)
# Filter syscalls
# Regex patterns (Sprint 16)
# Multi-process tracing (Sprint 18)
# Statistics summary
# Enhanced statistics with percentiles (Sprint 19)
# HPU-accelerated analysis (Sprint 21)
# ML anomaly detection (Sprint 23)
# Real-time anomaly detection (Sprint 20)
# Attach to running process
Examples
Basic Syscall Tracing
|) =
) =
) =
With Source Correlation
) =
) =
Function Profiling
========================
)
)
)
)
)
)
Enhanced Statistics with Percentiles (Sprint 19)
)
)
)
)
Real-Time Anomaly Detection (Sprint 20)
) =
) =
)
) =
)
) =
) =
===
)
)
)
)
)
)
)
Performance
Benchmarks vs strace (Sprint 11-12):
- Overhead: 5-9% vs 8-12% (strace)
- Memory: ~2MB vs ~5MB (strace)
- Syscalls: 335 supported vs 335 (strace)
- Features: Source correlation + function profiling (unique to Renacer)
Quality Standards
Following paiml-mcp-agent-toolkit EXTREME TDD:
- Test Coverage: 91.21% overall, 100% on critical modules
- Mutation Score: 80%+ (via cargo-mutants)
- TDG Score: 94.2/100 (A grade)
- Zero Tolerance: All 142 tests pass, zero warnings
Development
Setup
Pre-commit Hook
The pre-commit hook automatically runs 5 quality gates (<10s):
# 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
Testing
# All tests (142 unit + integration)
# Property-based tests only (670+ cases)
# With coverage
# Mutation testing
Quality Checks
# TDG analysis
# Dependency audit
# Deny check (licenses, bans, sources)
Architecture
Modules
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)function_profiler- Function-level profiling with I/O detectionstack_unwind- Stack unwinding for call graphsprofiling- Self-profiling infrastructure
Dependencies
nix- Ptrace system callsaddr2line,gimli,object- DWARF parsingclap- CLI parsingserde,serde_json- JSON serializationtrueno- SIMD-accelerated statisticsproptest- Property-based testing
Roadmap
See CHANGELOG.md for version history.
v0.3.0 ✅ (Current - 2025-11-17)
- Advanced filtering (negation, regex patterns)
- CSV export format
- Multi-process tracing (-f flag)
- Enhanced statistics (percentiles, SIMD-accelerated)
- Real-time anomaly detection
- Trueno Integration Milestone complete
v0.4.0 (Planned)
- Multi-threaded tracing optimizations
- eBPF backend option for reduced overhead
- Performance dashboard
- Additional output formats (HTML, Markdown)
v1.0.0 (Planned)
- Production hardening
- Cross-platform support (ARM64)
- Plugin architecture
- Web UI for trace analysis
License
MIT - See LICENSE file.
Documentation
📖 The Renacer Book - Comprehensive TDD-verified guide
The book includes:
- Getting Started - Installation and quick start
- Core Concepts - Syscall tracing, DWARF correlation, filtering
- Examples - Real-world use cases (all test-backed)
- Advanced Topics - Function profiling, anomaly detection, HPU acceleration
- EXTREME TDD - Zero-hallucination development methodology
All book examples are validated by GitHub Actions to ensure zero hallucination.
Contributing
- Fork the repository
- Create a feature branch
- Follow EXTREME TDD (tests first!)
- Ensure all quality gates pass
- Submit pull request
See:
- The Renacer Book - Contributing for EXTREME TDD methodology
- docs/specifications/deep-strace-rust-wasm-binary-spec.md for complete specification
Credits
Built with:
- Toyota Way quality principles
- EXTREME TDD methodology
- paiml-mcp-agent-toolkit workflows
- Trueno SIMD library
Developed by Pragmatic AI Labs