Feature Request
Integrate with renacer for syscall-level tracing and performance analysis.
What is Renacer?
Renacer is a pure Rust system call tracer with:
- Full syscall tracing (335 Linux syscalls)
- DWARF debug info correlation
- SIMD-accelerated statistics
- Anomaly detection
- Flamegraph export
Use Cases
- Performance debugging - Why is
suggest slow? Trace file I/O, memory allocation
- Model loading analysis - Profile model deserialization
- I/O bottleneck detection - Find slow disk reads
- Anomaly detection - Identify outlier suggestion latencies
Proposed Integration
Environment Variable Toggle
export APRENDER_RENACER=1 # Enable renacer tracing
export APRENDER_RENACER_OPTS="-c --stats-extended" # Custom renacer flags
ZSH Widget Integration
_aprender_suggest() {
[[ "$APRENDER_DISABLED" == "1" ]] && return
local suggestion
if [[ "$APRENDER_RENACER" == "1" ]]; then
local renacer_opts="${APRENDER_RENACER_OPTS:--c}"
suggestion=$(renacer $renacer_opts -- aprender-shell suggest "$BUFFER" 2>/tmp/aprender-renacer.log | head -1 | cut -f1)
else
suggestion=$(timeout 0.1 aprender-shell suggest "$BUFFER" 2>/dev/null | head -1 | cut -f1)
fi
# ... rest of function
}
CLI Subcommand
# Trace a single suggestion
aprender-shell trace suggest "git sta"
# Trace with full statistics
aprender-shell trace --stats suggest "git sta"
# Trace model training
aprender-shell trace train
Implementation:
Commands::Trace { renacer_args, subcommand } => {
let status = Command::new("renacer")
.args(&renacer_args)
.arg("--")
.arg("aprender-shell")
.args(&subcommand)
.status()?;
}
Output Example
$ APRENDER_RENACER=1 aprender-shell suggest "git "
git status
$ cat /tmp/aprender-renacer.log
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
45.23 0.000892 44 20 read
32.11 0.000633 31 20 mmap
12.45 0.000245 24 10 openat
5.67 0.000112 11 10 close
------ ----------- ----------- --------- --------- ----------------
100.00 0.001972 60 total
Dependencies
- Requires
renacer binary in PATH
- Graceful degradation if not installed
Related
Feature Request
Integrate with renacer for syscall-level tracing and performance analysis.
What is Renacer?
Renacer is a pure Rust system call tracer with:
Use Cases
suggestslow? Trace file I/O, memory allocationProposed Integration
Environment Variable Toggle
ZSH Widget Integration
CLI Subcommand
Implementation:
Output Example
Dependencies
renacerbinary in PATHRelated