mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-13 06:16:55 -04:00
Improve dwarfsck output
This commit is contained in:
parent
e4e03fa687
commit
13eeaba658
@ -479,7 +479,9 @@ void filesystem_v2::identify(logger& lgr, std::shared_ptr<mmif> mm,
|
|||||||
LOG_PROXY(debug_logger_policy, lgr);
|
LOG_PROXY(debug_logger_policy, lgr);
|
||||||
filesystem_parser parser(mm);
|
filesystem_parser parser(mm);
|
||||||
|
|
||||||
|
if (detail_level > 0) {
|
||||||
os << "FILESYSTEM version " << parser.version() << std::endl;
|
os << "FILESYSTEM version " << parser.version() << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
section_map sections;
|
section_map sections;
|
||||||
|
|
||||||
@ -489,10 +491,12 @@ void filesystem_v2::identify(logger& lgr, std::shared_ptr<mmif> mm,
|
|||||||
s->length(), tmp);
|
s->length(), tmp);
|
||||||
float compression_ratio = float(s->length()) / bd.uncompressed_size();
|
float compression_ratio = float(s->length()) / bd.uncompressed_size();
|
||||||
|
|
||||||
|
if (detail_level > 2) {
|
||||||
os << "SECTION " << s->description()
|
os << "SECTION " << s->description()
|
||||||
<< ", blocksize=" << bd.uncompressed_size()
|
<< ", blocksize=" << bd.uncompressed_size()
|
||||||
<< ", ratio=" << fmt::format("{:.2f}%", 100.0 * compression_ratio)
|
<< ", ratio=" << fmt::format("{:.2f}%", 100.0 * compression_ratio)
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: don't throw if we're just checking the file system
|
// TODO: don't throw if we're just checking the file system
|
||||||
|
|
||||||
|
@ -777,8 +777,7 @@ void metadata_<LoggerPolicy>::dump(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (detail_level > 1) {
|
if (detail_level > 2) {
|
||||||
os << "inode_count: " << inode_count_ << std::endl;
|
|
||||||
os << "symlink_inode_offset: " << symlink_inode_offset_ << std::endl;
|
os << "symlink_inode_offset: " << symlink_inode_offset_ << std::endl;
|
||||||
os << "file_inode_offset: " << file_inode_offset_ << std::endl;
|
os << "file_inode_offset: " << file_inode_offset_ << std::endl;
|
||||||
os << "dev_inode_offset: " << dev_inode_offset_ << std::endl;
|
os << "dev_inode_offset: " << dev_inode_offset_ << std::endl;
|
||||||
@ -801,15 +800,17 @@ void metadata_<LoggerPolicy>::dump(
|
|||||||
}
|
}
|
||||||
if (auto sfp = meta_.shared_files_table()) {
|
if (auto sfp = meta_.shared_files_table()) {
|
||||||
if (meta_.options()->packed_shared_files_table()) {
|
if (meta_.options()->packed_shared_files_table()) {
|
||||||
os << "compressed shared_files_table: " << sfp->size() << std::endl;
|
os << "packed shared_files_table: " << sfp->size() << std::endl;
|
||||||
os << "decompressed shared_files_table: " << shared_files_.size()
|
os << "unpacked shared_files_table: " << shared_files_.size()
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
} else {
|
} else {
|
||||||
os << "shared_files_table: " << sfp->size() << std::endl;
|
os << "shared_files_table: " << sfp->size() << std::endl;
|
||||||
}
|
}
|
||||||
os << "unique files: " << unique_files_ << std::endl;
|
os << "unique files: " << unique_files_ << std::endl;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (detail_level > 1) {
|
||||||
analyze_frozen(os, meta_, data_.size(), detail_level);
|
analyze_frozen(os, meta_, data_.size(), detail_level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user