Add tracing perfetto

This commit is contained in:
hal8174 2025-02-20 21:31:06 +01:00
parent 3b8865c169
commit 10d89f5886
3 changed files with 106 additions and 11 deletions

View file

@ -15,3 +15,4 @@ clap = { version = "4.5.26", features = ["derive"] }
rand = { version = "0.9.0", features = ["small_rng"] }
tracing = "0.1.41"
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
tracing-perfetto = { git = "https://git.he-li.dev/hal8174/tracing-perfetto.git" }

View file

@ -22,10 +22,11 @@ struct Args {
fn main() {
let args = Args::parse();
tracing_subscriber::fmt::fmt()
.with_env_filter(EnvFilter::from_default_env())
.with_span_events(FmtSpan::NEW | FmtSpan::CLOSE)
.init();
// tracing_subscriber::fmt::fmt()
// .with_env_filter(EnvFilter::from_default_env())
// .with_span_events(FmtSpan::NEW | FmtSpan::CLOSE)
// .init();
tracing_perfetto::install_perfetto_subscriber();
let text = std::fs::File::open(&args.path).unwrap();
let factory_graph: FactoryGraph = serde_yaml::from_reader(text).unwrap();
@ -33,18 +34,18 @@ fn main() {
// dbg!(&factory_graph);
let l = ValidLayout {
max_tries: 4,
size_increases: 32,
retries: 4,
start_size: Position::new(256, 256),
growth: Position::new(16, 16),
start_size: Position::new(64, 64),
growth: Position::new(8, 8),
};
let l = GeneticAlgorithm {
mutation_retries: 20,
population_size: 20,
population_keep: 4,
population_new: 4,
generations: 40,
population_size: 4,
population_keep: 1,
population_new: 1,
generations: 5,
valid_layout: l,
};
let p = ConflictAvoidance {