Custom debug impl for LoadedPrograms cache (#33808)

This commit is contained in:
Pankaj Garg 2023-10-22 05:51:14 -07:00 committed by GitHub
parent 8260ffc1ef
commit abf3b3e527
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -443,7 +443,6 @@ impl Default for ProgramRuntimeEnvironments {
}
}
#[derive(Debug)]
pub struct LoadedPrograms<FG: ForkGraph> {
/// A two level index:
///
@ -459,6 +458,17 @@ pub struct LoadedPrograms<FG: ForkGraph> {
fork_graph: Option<Arc<RwLock<FG>>>,
}
impl<FG: ForkGraph> Debug for LoadedPrograms<FG> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.debug_struct("LoadedPrograms")
.field("root slot", &self.latest_root_slot)
.field("root epoch", &self.latest_root_epoch)
.field("stats", &self.stats)
.field("cache", &self.entries)
.finish()
}
}
impl<FG: ForkGraph> Default for LoadedPrograms<FG> {
fn default() -> Self {
Self {

View File

@ -56,7 +56,6 @@ struct SetRootTimings {
prune_remove_ms: i64,
}
#[derive(Debug)]
pub struct BankForks {
banks: HashMap<Slot, BankWithScheduler>,
descendants: HashMap<Slot, HashSet<Slot>>,