| Crates.io | frame-analyzer |
| lib.rs | frame-analyzer |
| version | 0.3.3 |
| created_at | 2024-04-20 15:28:50.74711+00 |
| updated_at | 2024-10-26 03:16:32.68707+00 |
| description | Track the frametime of Android apps, based on ebpf & uprobe |
| homepage | |
| repository | https://github.com/shadow3aaa/frame-analyzer-ebpf |
| max_upload_size | |
| id | 1214661 |
| size | 26,446 |
Track the frametime of Android apps, based on ebpf & uprobe
Simple frametime analyzer, print pid & frametime on the screen
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
};
use anyhow::Result;
use clap::Parser;
use frame_analyzer::Analyzer;
/// Simple frame analyzer, print frametime on the screen
#[derive(Parser, Debug)]
#[command(version, about)]
struct Args {
/// The pid of the target application
#[arg(short, long)]
pid: i32,
}
fn main() -> Result<()> {
let arg = Args::parse();
let pid = arg.pid;
let mut analyzer = Analyzer::new()?;
analyzer.attach_app(pid)?;
let running = Arc::new(AtomicBool::new(true));
{
let running = running.clone();
ctrlc::set_handler(move || {
running.store(false, Ordering::Release);
})?;
}
while running.load(Ordering::Acquire) {
if let Some((_, frametime)) = analyzer.recv() {
println!("frametime: {frametime:?}");
}
}
Ok(())
}
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.