message: feat: prof output more infomation
diff: @@ -4,6 +4,7 @@ use ckb_db::{CacheDB, DBConfig, RocksDB};
  use ckb_notify::NotifyService;
  use ckb_shared::shared::{Shared, SharedBuilder};
  use ckb_shared::store::ChainStore;
  +use log::info;
  use std::sync::Arc;
  pub fn profile(args: ProfArgs) -> Result<(), ExitCode> {
  @@ -25,7 +26,16 @@ pub fn profile(args: ProfArgs) -> Result<(), ExitCode> {
  let from = std::cmp::max(1, args.from);
  let to = std::cmp::min(shared.chain_state().lock().tip_number(), args.to);
  - profile_block_process(shared, tmp_shared, from, to);
  + info!("start profling, re-process blocks {}..{}:", from, to);
  + let now = std::time::Instant::now();
  + let tx_count = profile_block_process(shared, tmp_shared, from, to);
  + let duration = now.elapsed();
  + info!(
  + "end profling, duration {:?} txs {} tps {}",
  + duration,
  + tx_count,
  + tx_count as u64 / duration.as_secs()
  + );
  Ok(())
  }
  @@ -34,15 +44,18 @@ fn profile_block_process<CS: ChainStore + 'static>(
  tmp_shared: Shared<CS>,
  from: u64,
  to: u64,
  -) {
  +) -> usize {
  let notify = NotifyService::default().start::<&str>(Some("notify"));
  let chain = ChainBuilder::new(tmp_shared, notify).build();
  let chain_controller = chain.start(Some("chain"));
  + let mut tx_count = 0;
  for index in from..=to {
  let block = {
  let block_hash = shared.store().get_block_hash(index).unwrap();
  shared.store().get_block(&block_hash).unwrap()
  };
  + tx_count += block.commit_transactions().len();
  chain_controller.process_block(Arc::new(block)).unwrap();
  }
  + tx_count
  }
  