From fe5d73bd466e1445e2bad9480905fdf3c036293b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=8B=D1=87=D0=BA=D0=BE=D0=B2=20=D0=90=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D0=B9?= Date: Wed, 6 Feb 2019 13:23:11 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@689 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src_main/system/pisystemmonitor.cpp | 13 ++++++++++++- src_main/system/pisystemmonitor.h | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src_main/system/pisystemmonitor.cpp b/src_main/system/pisystemmonitor.cpp index 092d64f1..a7429769 100755 --- a/src_main/system/pisystemmonitor.cpp +++ b/src_main/system/pisystemmonitor.cpp @@ -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::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(); 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, ""); +#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; diff --git a/src_main/system/pisystemmonitor.h b/src_main/system/pisystemmonitor.h index 54d4f35c..1068027a 100755 --- a/src_main/system/pisystemmonitor.h +++ b/src_main/system/pisystemmonitor.h @@ -72,8 +72,8 @@ public: }; #ifndef FREERTOS bool startOnProcess(int pID, int interval_ms = 1000); - bool startOnSelf(int interval_ms = 1000); #endif + bool startOnSelf(int interval_ms = 1000); void stop(); const ProcessStats & statistic() const {return stat;}