Crates.io | libtracecmd |
lib.rs | libtracecmd |
version | 0.2.1 |
source | src |
created_at | 2023-05-31 06:09:32.735056 |
updated_at | 2023-11-02 13:52:24.092012 |
description | Rust wrapper of libtracecmd |
homepage | https://github.com/google/libtracecmd-rs |
repository | https://github.com/google/libtracecmd-rs |
max_upload_size | |
id | 878536 |
size | 43,566 |
A Rust wrapper of libtracecmd.
This library is a Rust wrapper of libtracecmd, which allows writing programs to analyze Linux's ftrace data recoreded by trace-cmd.
To use this crate in your program, you need to install the libtracecmd library (>= 1.2.0) on your system.
Let's see how it works with examples/top_n_events, which counts how many times each event occurred in a particular period.
First, create trace.dat
by running trace-cmd
.
trace-cmd record -e syscalls sleep 10
Then, show the top-10 syscall events in the trace.dat file.
cargo run --example top_n_events -- --input trace.dat --n 10 --prefix sys_enter_
Example output:
Top 10 events:
#1: ioctl: 62424 times
#2: futex: 59074 times
#3: read: 30144 times
#4: write: 28361 times
#5: newfstatat: 22590 times
#6: close: 15893 times
#7: splice: 14650 times
#8: getuid: 13579 times
#9: epoll_pwait: 12298 times
#10: ppoll: 10523 times
See CONTRIBUTING.md
for details.
Apache 2.0; see LICENSE
for details.
This project is not an official Google project. It is not supported by Google and Google specifically disclaims all warranties as to its quality, merchantability, or fitness for a particular purpose.