Merge remote-tracking branch 'origin' into merge

This commit is contained in:
sfc-gh-tclinkenbeard 2020-11-03 12:46:42 -08:00
commit 46a8e594d3
3 changed files with 12 additions and 6 deletions

View File

@ -1212,7 +1212,9 @@ public:
for(auto& logSet : dbi.logSystemConfig.tLogs) {
if(region.satelliteTLogPolicy.isValid() && logSet.isLocal && logSet.locality == tagLocalitySatellite) {
oldSatelliteFallback = logSet.tLogPolicy->info() != region.satelliteTLogPolicy->info();
ASSERT(!oldSatelliteFallback || logSet.tLogPolicy->info() == region.satelliteTLogPolicyFallback->info());
ASSERT(!oldSatelliteFallback ||
(region.satelliteTLogPolicyFallback.isValid() &&
logSet.tLogPolicy->info() == region.satelliteTLogPolicyFallback->info()));
break;
}
}

View File

@ -1039,12 +1039,11 @@ TraceEvent& TraceEvent::GetLastError() {
#endif
}
// We're cheating in counting, as in practice, we only use {10,20,30,40}.
static_assert(SevMaxUsed / 10 + 1 == 5, "Please bump eventCounts[5] to SevMaxUsed/10+1");
unsigned long TraceEvent::eventCounts[5] = {0,0,0,0,0};
unsigned long TraceEvent::eventCounts[NUM_MAJOR_LEVELS_OF_EVENTS] = {0, 0, 0, 0, 0};
unsigned long TraceEvent::CountEventsLoggedAt(Severity sev) {
return TraceEvent::eventCounts[sev/10];
ASSERT(sev <= SevMaxUsed);
return TraceEvent::eventCounts[sev/10];
}
TraceEvent& TraceEvent::backtrace(const std::string& prefix) {

View File

@ -47,6 +47,9 @@ inline static bool TRACE_SAMPLE() { return false; }
extern thread_local int g_allocation_tracing_disabled;
// Each major level of severity has 10 levels of minor levels, which are not all
// used. when the numbers of severity events in each level are counted, they are
// grouped by the major level.
enum Severity {
SevVerbose = 0,
SevSample = 1,
@ -59,6 +62,8 @@ enum Severity {
SevMax = 1000000
};
const int NUM_MAJOR_LEVELS_OF_EVENTS = SevMaxUsed / 10 + 1;
class TraceEventFields {
public:
constexpr static FileIdentifier file_identifier = 11262274;
@ -510,7 +515,7 @@ private:
void setSizeLimits();
static unsigned long eventCounts[5];
static unsigned long eventCounts[NUM_MAJOR_LEVELS_OF_EVENTS];
static thread_local bool networkThread;
bool init();