BeesAddress first_addr(brp.first.fd(), brp.first.begin());
BeesAddress second_addr(brp.second.fd(), brp.second.begin());
- if (first_addr.get_physical_or_zero() == second_addr.get_physical_or_zero()) {
- BEESLOGTRACE("equal physical addresses in dedup");
+ const auto first_gpoz = first_addr.get_physical_or_zero();
+ const auto second_gpoz = second_addr.get_physical_or_zero();
+ if (first_gpoz == second_gpoz) {
+ BEESLOGDEBUG("equal physical addresses " << first_addr << " and " << second_addr << " in dedup");
BEESCOUNT(bug_dedup_same_physical);
}
BEESCOUNT(root_parent_open_try);
Fd parent_fd = open_root(parent_rootid);
if (!parent_fd) {
- BEESLOGTRACE("no parent_fd");
+ BEESLOGDEBUG("no parent_fd for " << parent_rootid);
BEESCOUNT(root_parent_open_fail);
return Fd();
}
BEESTRACE("dirid " << dirid << " path " << ino.m_paths.at(0));
parent_fd = bees_openat(parent_fd, ino.m_paths.at(0).c_str(), FLAGS_OPEN_DIR);
if (!parent_fd) {
- BEESLOGTRACE("no parent_fd from dirid");
+ BEESLOGDEBUG("no parent_fd from dirid " << dirid << " in parent_rootid " << parent_rootid);
BEESCOUNT(root_parent_path_open_fail);
return Fd();
}
BEESTRACE("openat(" << name_fd(parent_fd) << ", " << name << ")");
Fd rv = bees_openat(parent_fd, name.c_str(), FLAGS_OPEN_DIR);
if (!rv) {
- BEESLOGTRACE("open failed for name " << name << ": " << strerror(errno));
+ BEESLOGDEBUG("open failed for name " << name << " in parent_fd " << name_fd(parent_fd) << ": " << strerror(errno));
BEESCOUNT(root_open_fail);
return rv;
}
{
if (!tl_silent && exception_check()) {
if (tl_first) {
- BEESLOGNOTICE("--- BEGIN TRACE --- exception ---");
+ BEESLOG(BEES_TRACE_LEVEL, "TRACE: --- BEGIN TRACE --- exception ---");
tl_first = false;
}
try {
m_func();
} catch (exception &e) {
- BEESLOGNOTICE("Nested exception: " << e.what());
+ BEESLOG(BEES_TRACE_LEVEL, "TRACE: Nested exception: " << e.what());
} catch (...) {
- BEESLOGNOTICE("Nested exception ...");
+ BEESLOG(BEES_TRACE_LEVEL, "TRACE: Nested exception ...");
}
if (!m_next_tracer) {
- BEESLOGNOTICE("--- END TRACE --- exception ---");
+ BEESLOG(BEES_TRACE_LEVEL, "TRACE: --- END TRACE --- exception ---");
}
}
tl_next_tracer = m_next_tracer;
BeesTracer::trace_now()
{
BeesTracer *tp = tl_next_tracer;
- BEESLOGNOTICE("--- BEGIN TRACE ---");
+ BEESLOG(BEES_TRACE_LEVEL, "TRACE: --- BEGIN TRACE ---");
while (tp) {
tp->m_func();
tp = tp->m_next_tracer;
}
- BEESLOGNOTICE("--- END TRACE ---");
+ BEESLOG(BEES_TRACE_LEVEL, "TRACE: --- END TRACE ---");
}
bool
}
if (first.overlaps(second)) {
- BEESLOGTRACE("after grow, first " << first << "\n\toverlaps " << second);
+ BEESLOGDEBUG("after grow, first " << first << "\n\toverlaps " << second);
BEESCOUNT(bug_grow_pair_overlaps);
}
static const unsigned recognized_flags = compressed_flags | delalloc_flags | ignore_flags | unusable_flags;
if (flags & ~recognized_flags) {
- BEESLOGTRACE("Unrecognized flags in " << fiemap_extent_flags_ntoa(flags));
+ BEESLOGNOTICE("Unrecognized flags in " << fiemap_extent_flags_ntoa(flags));
m_addr = UNUSABLE;
// maybe we throw here?
BEESCOUNT(addr_unrecognized);
BEESLOGDEBUG("exception (ignored): " << s);
BEESCOUNT(exception_caught_silent);
} else {
- BEESLOGNOTICE("\n\n*** EXCEPTION ***\n\t" << s << "\n***\n");
+ BEESLOGNOTICE("\n\nTRACE: *** EXCEPTION ***\n\t" << s << "\n***\n");
BEESCOUNT(exception_caught);
}
});
// macros ----------------------------------------
#define BEESLOG(lv,x) do { if (lv < bees_log_level) { Chatter __chatter(lv, BeesNote::get_name()); __chatter << x; } } while (0)
-#define BEESLOGTRACE(x) do { BEESLOG(LOG_DEBUG, x); BeesTracer::trace_now(); } while (0)
-#define BEESTRACE(x) BeesTracer SRSLY_WTF_C(beesTracer_, __LINE__) ([&]() { BEESLOG(LOG_ERR, x << " at " << __FILE__ << ":" << __LINE__); })
+#define BEES_TRACE_LEVEL LOG_DEBUG
+#define BEESTRACE(x) BeesTracer SRSLY_WTF_C(beesTracer_, __LINE__) ([&]() { BEESLOG(BEES_TRACE_LEVEL, "TRACE: " << x << " at " << __FILE__ << ":" << __LINE__); })
#define BEESTOOLONG(x) BeesTooLong SRSLY_WTF_C(beesTooLong_, __LINE__) ([&](ostream &_btl_os) { _btl_os << x; })
#define BEESNOTE(x) BeesNote SRSLY_WTF_C(beesNote_, __LINE__) ([&](ostream &_btl_os) { _btl_os << x; })