git-svn-id: svn://db.shs.com.ru/pip@689 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -109,13 +109,20 @@ bool PISystemMonitor::startOnProcess(int pID, int interval_ms) {
|
||||
#endif
|
||||
return start(interval_ms);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool PISystemMonitor::startOnSelf(int interval_ms) {
|
||||
#ifdef FREERTOS
|
||||
bool ret = startOnProcess(PIProcess::currentPID(), interval_ms);
|
||||
#else
|
||||
self_ = false;
|
||||
cycle = -1;
|
||||
ret = start(interval_ms);
|
||||
#endif
|
||||
self_ = true;
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
PIVector<PISystemMonitor::ThreadStats> PISystemMonitor::threadsStatistic() const {
|
||||
mutex_.lock();
|
||||
@@ -153,6 +160,7 @@ void PISystemMonitor::run() {
|
||||
if (t->isPIObject())
|
||||
tbid[t->tid()] = t->name();
|
||||
pitc->unlock();
|
||||
#ifndef FREERTOS
|
||||
//piCout << tbid.keys().toType<uint>();
|
||||
stat.ID = pID_;
|
||||
#ifndef WINDOWS
|
||||
@@ -289,6 +297,7 @@ void PISystemMonitor::run() {
|
||||
stat.cpu_load_user = 0.f;
|
||||
}
|
||||
PRIVATE->tm.reset();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
stat.cpu_load_system = piClampf(stat.cpu_load_system, 0.f, 100.f);
|
||||
@@ -325,6 +334,7 @@ void PISystemMonitor::gatherThread(llong id) {
|
||||
PISystemMonitor::ThreadStats ts;
|
||||
ts.id = id;
|
||||
ts.name = tbid.value(id, "<non-PIThread>");
|
||||
#ifndef FREERTOS
|
||||
#ifndef WINDOWS
|
||||
PIFile f(PRIVATE->proc_dir + "task/" + PIString::fromNumber(id) + "/stat");
|
||||
//piCout << f.path();
|
||||
@@ -363,6 +373,7 @@ void PISystemMonitor::gatherThread(llong id) {
|
||||
ts.work_time = ct - ts.created.toSystemTime();
|
||||
ts.kernel_time = FILETIME2PISystemTime(times[2]);
|
||||
ts.user_time = FILETIME2PISystemTime(times[3]);
|
||||
#endif
|
||||
#endif
|
||||
//cur_ts << ts;
|
||||
cur_tm[id] = ts;
|
||||
|
||||
Reference in New Issue
Block a user