mirror of
https://github.com/Zygo/bees.git
synced 2025-05-18 05:45:45 +02:00
log: simplify output for dedup and scan
With many threads it is inconvenient to reassemble the elided parts of the dedup src/dst and scan filenames output. Simply output them unconditionally, and balance the line lengths. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
parent
917fc8c412
commit
1052119a53
@ -175,29 +175,16 @@ BeesContext::dedup(const BeesRangePair &brp)
|
|||||||
BEESNOTE("dedup " << brp);
|
BEESNOTE("dedup " << brp);
|
||||||
BEESTOOLONG("dedup " << brp);
|
BEESTOOLONG("dedup " << brp);
|
||||||
|
|
||||||
thread_local BeesFileId tl_first_fid, tl_second_fid;
|
|
||||||
if (tl_first_fid != brp.first.fid()) {
|
|
||||||
BEESLOG("dedup: src " << name_fd(brp.first.fd()));
|
|
||||||
tl_first_fid = brp.first.fid();
|
|
||||||
tl_second_fid = BeesFileId();
|
|
||||||
}
|
|
||||||
ostringstream dst_line;
|
|
||||||
dst_line << " dst " << pretty(brp.first.size()) << " [" << to_hex(brp.first.begin()) << ".." << to_hex(brp.first.end()) << "]";
|
|
||||||
if (brp.first.begin() != brp.second.begin()) {
|
|
||||||
dst_line << " [" << to_hex(brp.second.begin()) << ".." << to_hex(brp.second.end()) << "]";
|
|
||||||
}
|
|
||||||
BeesAddress first_addr(brp.first.fd(), brp.first.begin());
|
BeesAddress first_addr(brp.first.fd(), brp.first.begin());
|
||||||
BeesAddress second_addr(brp.second.fd(), brp.second.begin());
|
BeesAddress second_addr(brp.second.fd(), brp.second.begin());
|
||||||
dst_line << " {" << first_addr << "->" << second_addr << "}";
|
|
||||||
|
BEESLOG("dedup: src " << pretty(brp.first.size()) << " [" << to_hex(brp.first.begin()) << ".." << to_hex(brp.first.end()) << "] {" << first_addr << "} " << name_fd(brp.first.fd()));
|
||||||
|
BEESLOG(" dst " << pretty(brp.second.size()) << " [" << to_hex(brp.second.begin()) << ".." << to_hex(brp.second.end()) << "] {" << second_addr << "} " << name_fd(brp.second.fd()));
|
||||||
|
|
||||||
if (first_addr.get_physical_or_zero() == second_addr.get_physical_or_zero()) {
|
if (first_addr.get_physical_or_zero() == second_addr.get_physical_or_zero()) {
|
||||||
BEESLOGTRACE("equal physical addresses in dedup");
|
BEESLOGTRACE("equal physical addresses in dedup");
|
||||||
BEESCOUNT(bug_dedup_same_physical);
|
BEESCOUNT(bug_dedup_same_physical);
|
||||||
}
|
}
|
||||||
if (tl_second_fid != brp.second.fid()) {
|
|
||||||
dst_line << " " << name_fd(brp.second.fd());
|
|
||||||
tl_second_fid = brp.second.fid();
|
|
||||||
}
|
|
||||||
BEESLOG(dst_line.str());
|
|
||||||
|
|
||||||
THROW_CHECK1(invalid_argument, brp, !brp.first.overlaps(brp.second));
|
THROW_CHECK1(invalid_argument, brp, !brp.first.overlaps(brp.second));
|
||||||
THROW_CHECK1(invalid_argument, brp, brp.first.size() == brp.second.size());
|
THROW_CHECK1(invalid_argument, brp, brp.first.size() == brp.second.size());
|
||||||
@ -681,13 +668,7 @@ BeesContext::scan_one_extent(const BeesFileRange &bfr, const Extent &e)
|
|||||||
|
|
||||||
// Visualize
|
// Visualize
|
||||||
if (bar != string(block_count, '.')) {
|
if (bar != string(block_count, '.')) {
|
||||||
thread_local BeesFileId last_fid;
|
BEESLOG("scan: " << pretty(e.size()) << " " << to_hex(e.begin()) << " [" << bar << "] " << to_hex(e.end()) << ' ' << name_fd(bfr.fd()));
|
||||||
string file_name;
|
|
||||||
if (bfr.fid() != last_fid) {
|
|
||||||
last_fid = bfr.fid();
|
|
||||||
file_name = " " + name_fd(bfr.fd());
|
|
||||||
}
|
|
||||||
BEESLOG("scan: " << pretty(e.size()) << " " << to_hex(e.begin()) << " [" << bar << "] " << to_hex(e.end()) << file_name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return bfr;
|
return bfr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user