Crates.io | frame-analyzer-test |
lib.rs | frame-analyzer-test |
version | |
source | src |
created_at | 2024-11-30 15:48:37.319937 |
updated_at | 2024-11-30 15:48:37.319937 |
description | Track the frametime of Android apps, based on ebpf & uprobe |
homepage | |
repository | https://github.com/shadow3aaa/frame-analyzer-ebpf |
max_upload_size | |
id | 1466717 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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.