diff --git a/components/hord-cli/Cargo.toml b/components/hord-cli/Cargo.toml index 8601b3f..6c195cc 100644 --- a/components/hord-cli/Cargo.toml +++ b/components/hord-cli/Cargo.toml @@ -38,7 +38,7 @@ fxhash = "0.2.1" rusqlite = { version = "0.27.0", features = ["bundled"] } anyhow = { version = "1.0.56", features = ["backtrace"] } schemars = { version = "0.8.10", git = "https://github.com/hirosystems/schemars.git", branch = "feat-chainhook-fixes" } -pprof = { version = "0.12", features = ["flamegraph"], optional = true } +pprof = { version = "0.12", features = ["flamegraph"] } progressing = '3' [dependencies.rocksdb] @@ -49,5 +49,5 @@ features = ["lz4", "snappy"] [features] default = ["cli"] cli = ["clap", "clap_generate", "toml", "ctrlc", "hiro-system-kit/log"] -debug = ["hiro-system-kit/debug", "pprof"] +debug = ["hiro-system-kit/debug"] release = ["hiro-system-kit/release"] diff --git a/components/hord-cli/src/db/mod.rs b/components/hord-cli/src/db/mod.rs index 626f8b0..451482f 100644 --- a/components/hord-cli/src/db/mod.rs +++ b/components/hord-cli/src/db/mod.rs @@ -1856,11 +1856,11 @@ pub async fn rebuild_rocks_db( hord_config: &HordConfig, ctx: &Context, ) -> Result<(), String> { - // let guard = pprof::ProfilerGuardBuilder::default() - // .frequency(20) - // .blocklist(&["libc", "libgcc", "pthread", "vdso"]) - // .build() - // .unwrap(); + let guard = pprof::ProfilerGuardBuilder::default() + .frequency(20) + .blocklist(&["libc", "libgcc", "pthread", "vdso"]) + .build() + .unwrap(); ctx.try_log(|logger| { slog::info!(logger, "Generating report"); @@ -1982,21 +1982,21 @@ pub async fn rebuild_rocks_db( ) }); - // match guard.report().build() { - // Ok(report) => { - // ctx.try_log(|logger| { - // slog::info!(logger, "Generating report"); - // }); + match guard.report().build() { + Ok(report) => { + ctx.try_log(|logger| { + slog::info!(logger, "Generating report"); + }); - // let file = File::create("hord-perf.svg").unwrap(); - // report.flamegraph(file).unwrap(); - // } - // Err(e) => { - // ctx.try_log(|logger| { - // slog::error!(logger, "Reporting failed: {}", e.to_string()); - // }); - // } - // } + let file = std::fs::File::create("hord-perf.svg").unwrap(); + report.flamegraph(file).unwrap(); + } + Err(e) => { + ctx.try_log(|logger| { + slog::error!(logger, "Reporting failed: {}", e.to_string()); + }); + } + } return Ok(()); }