|
@@ -2305,7 +2305,7 @@ static class CMemoryUsageReporter: public Thread
|
|
unsigned interval;
|
|
unsigned interval;
|
|
Semaphore sem;
|
|
Semaphore sem;
|
|
PerfMonMode traceMode;
|
|
PerfMonMode traceMode;
|
|
- IPerfMonHook * hook;
|
|
|
|
|
|
+ Linked<IPerfMonHook> hook;
|
|
unsigned latestCPU;
|
|
unsigned latestCPU;
|
|
#if defined(USE_OLD_PU) || defined(_WIN32)
|
|
#if defined(USE_OLD_PU) || defined(_WIN32)
|
|
double dbIdleTime;
|
|
double dbIdleTime;
|
|
@@ -2337,7 +2337,7 @@ public:
|
|
|
|
|
|
{
|
|
{
|
|
interval = _interval;
|
|
interval = _interval;
|
|
- hook = _hook;
|
|
|
|
|
|
+ hook.set(_hook);
|
|
term = false;
|
|
term = false;
|
|
latestCPU = 0;
|
|
latestCPU = 0;
|
|
#ifdef _WIN32
|
|
#ifdef _WIN32
|
|
@@ -2364,6 +2364,7 @@ public:
|
|
|
|
|
|
void setPrimaryFileSystem(char const * _primaryfs)
|
|
void setPrimaryFileSystem(char const * _primaryfs)
|
|
{
|
|
{
|
|
|
|
+ CriticalBlock block(sect);
|
|
primaryfs.clear();
|
|
primaryfs.clear();
|
|
if(_primaryfs)
|
|
if(_primaryfs)
|
|
primaryfs.append(_primaryfs);
|
|
primaryfs.append(_primaryfs);
|
|
@@ -2371,6 +2372,7 @@ public:
|
|
|
|
|
|
void setSecondaryFileSystem(char const * _secondaryfs)
|
|
void setSecondaryFileSystem(char const * _secondaryfs)
|
|
{
|
|
{
|
|
|
|
+ CriticalBlock block(sect);
|
|
secondaryfs.clear();
|
|
secondaryfs.clear();
|
|
if(_secondaryfs)
|
|
if(_secondaryfs)
|
|
secondaryfs.append(_secondaryfs);
|
|
secondaryfs.append(_secondaryfs);
|
|
@@ -2640,7 +2642,10 @@ public:
|
|
if (traceMode&PerfMonExtended) {
|
|
if (traceMode&PerfMonExtended) {
|
|
if (extstats.getLine(str.clear()))
|
|
if (extstats.getLine(str.clear()))
|
|
LOG(MCdebugInfo, unknownJob, "%s", str.str());
|
|
LOG(MCdebugInfo, unknownJob, "%s", str.str());
|
|
- extstats.printKLog(hook);
|
|
|
|
|
|
+ {
|
|
|
|
+ CriticalBlock block(sect);
|
|
|
|
+ extstats.printKLog(hook);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
@@ -2660,6 +2665,13 @@ public:
|
|
{
|
|
{
|
|
return latestCPU;
|
|
return latestCPU;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ void setHook(IPerfMonHook *_hook)
|
|
|
|
+ {
|
|
|
|
+ CriticalBlock block(sect);
|
|
|
|
+ hook.set(_hook);
|
|
|
|
+ }
|
|
|
|
+
|
|
} *MemoryUsageReporter=NULL;
|
|
} *MemoryUsageReporter=NULL;
|
|
|
|
|
|
|
|
|
|
@@ -2715,6 +2727,12 @@ void stopPerformanceMonitor()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void setPerformanceMonitorHook(IPerfMonHook *hook)
|
|
|
|
+{
|
|
|
|
+ if (MemoryUsageReporter)
|
|
|
|
+ MemoryUsageReporter->setHook(hook);
|
|
|
|
+}
|
|
|
|
+
|
|
void setPerformanceMonitorPrimaryFileSystem(char const * fs)
|
|
void setPerformanceMonitorPrimaryFileSystem(char const * fs)
|
|
{
|
|
{
|
|
if(MemoryUsageReporter)
|
|
if(MemoryUsageReporter)
|