Crates.io | riscv_perf |
lib.rs | riscv_perf |
version | 0.1.1 |
source | src |
created_at | 2024-11-05 20:43:44.134839 |
updated_at | 2024-11-21 01:41:03.816956 |
description | A performance profiling library for RISC-V programs. |
homepage | |
repository | |
max_upload_size | |
id | 1437137 |
size | 5,959 |
riscv_perf is a performance profiling library for RISC-V programs. It enables RISC-V developers and hobbyists to collect and visualize performance metrics, providing valuable insights into the efficiency of their programs. Whether you're developing software for RISC-V microcontrollers or experimenting with RISC-V emulators, riscv_perf
offers a practical tool to optimize your code.
Add riscv_perf
to your Cargo.toml
:
[dependencies]
riscv_perf = "0.1.0"
Here’s a simple example of how to use riscv_perf in your Rust project:
Create main.rs
use riscv_perf::{profile_program, visualizer};
fn main() {
// Example RISC-V binary program
let program = vec![0x00, 0x00, 0x00, 0x33]; // Example RISC-V binary
// Profile the program
let profile_data = profile_program(&program);
// Visualize the profiling data
visualizer::visualize_profile_data(&profile_data);
}
To run the unit tests, use the following command:
cargo test
Contributions from anyone interested in improving this library are welcome. Feel free to fork the repository, make your changes, and submit a pull request.
This project is licensed under the MIT License.
bensatlantik