What problem does it solve?
This skill enables tracing of Rust function calls with sftrace to help analyze performance and troubleshoot rspack. It converts traces into perfetto protobufs for downstream tooling.
Core Features & Use Cases
- Instrumentation-based Rust tracing with sftrace to capture function call data.
- End-to-end workflow: build sftrace, compile the Rust bindings, record traces, and convert them for analysis.
- Use Case: Profile rspack during development to identify hot paths, then visualize traces with Perfetto or viztracer.
Quick Start
Clone and build sftrace, build the binding, record a trace, and analyze it with perfetto:
git clone https://github.com/quininer/sftrace
cd sftrace
cargo build --release
mkdir "$(./target/release/sftrace record --print-solib-install-dir)"
cp ./target/release/libsftrace.so "$(./target/release/sftrace record --print-solib-install-dir)/"
SFTRACE=1 pnpm run build:binding:debug
cd examples/basic/
sftrace record -- pnpm build
sftrace convert sf.log -o sf.pb.gz
vizviewer --use_external_processor sf.pb.gz