Fix a usage of the wrong variable; separate the profiling enabled bool for the run loop and flow profilers.

This commit is contained in:
A.J. Beamon 2021-11-04 12:28:26 -07:00
parent 335c76501a
commit f44f41c9fb
2 changed files with 4 additions and 2 deletions

View File

@ -3756,6 +3756,7 @@ volatile bool profileThread = false;
volatile int64_t profileThreadId = -1;
void (*chainedSignalHandler)(int) = nullptr;
volatile bool profilingEnabled = 1;
volatile thread_local bool flowProfilingEnabled = 1;
volatile int64_t numProfilesDisabled = 0;
volatile int64_t numProfilesOverflowed = 0;
@ -3833,6 +3834,7 @@ void setProfilingEnabled(int enabled) {
if (profileThread) {
profilingEnabled = enabled;
}
flowProfilingEnabled = enabled;
#else
// No profiling for other platforms!
#endif

View File

@ -33,7 +33,7 @@
#include "flow/Platform.h"
#include "flow/actorcompiler.h" // This must be the last include.
extern volatile int profilingEnabled;
extern volatile thread_local int flowProfilingEnabled;
static uint64_t sys_gettid() {
return syscall(__NR_gettid);
@ -146,7 +146,7 @@ struct Profiler {
if (inSigHandler.exchange(true)) {
return;
}
if (profilingEnabled) {
if (flowProfilingEnabled) {
double t = timer();
output_buffer->push(*(void**)&t);
size_t n = platform::raw_backtrace(addresses, 256);