mirror of
https://github.com/Zygo/bees.git
synced 2025-07-02 00:32:27 +02:00
extent scan: only write a detailed debug log when there's an exception
Note that when enabled, the logs are still very CPU-intensive, but most of the logs will be discarded. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
@ -933,6 +933,7 @@ BeesScanModeExtent::SizeTier::find_next_extent()
|
|||||||
|
|
||||||
// Low-level extent search debugging
|
// Low-level extent search debugging
|
||||||
shared_ptr<ostringstream> debug_oss;
|
shared_ptr<ostringstream> debug_oss;
|
||||||
|
const bool debug_oss_only_exceptions = true;
|
||||||
#if 0
|
#if 0
|
||||||
// Enable a _lot_ of debugging output
|
// Enable a _lot_ of debugging output
|
||||||
debug_oss = make_shared<ostringstream>();
|
debug_oss = make_shared<ostringstream>();
|
||||||
@ -966,9 +967,11 @@ BeesScanModeExtent::SizeTier::find_next_extent()
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (debug_oss) {
|
if (debug_oss) {
|
||||||
|
if (!debug_oss_only_exceptions || exception_check()) {
|
||||||
BEESLOGDEBUG("debug oss trace:\n" << debug_oss->str());
|
BEESLOGDEBUG("debug oss trace:\n" << debug_oss->str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
BtrfsIoctlSearchKey::s_debug_ostream.reset();
|
BtrfsIoctlSearchKey::s_debug_ostream.reset();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1002,7 +1005,9 @@ BeesScanModeExtent::SizeTier::find_next_extent()
|
|||||||
// There is a lot of debug output. Dump it if it gets too long
|
// There is a lot of debug output. Dump it if it gets too long
|
||||||
if (!debug_oss->str().empty()) {
|
if (!debug_oss->str().empty()) {
|
||||||
if (crawl_time.age() > 1) {
|
if (crawl_time.age() > 1) {
|
||||||
|
if (!debug_oss_only_exceptions) {
|
||||||
BEESLOGDEBUG("debug oss trace (so far):\n" << debug_oss->str());
|
BEESLOGDEBUG("debug oss trace (so far):\n" << debug_oss->str());
|
||||||
|
}
|
||||||
debug_oss->str("");
|
debug_oss->str("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user