aboutsummaryrefslogtreecommitdiff
path: root/daemon/UserSpaceSource.cpp
diff options
context:
space:
mode:
authorDrew Richardson <drew.richardson@arm.com>2014-07-16 12:00:00 -0700
committerDrew Richardson <drew.richardson@arm.com>2014-12-19 15:54:51 -0800
commit8b39b6c50a01bcfa280151b43079dab428cbab45 (patch)
tree66294093e2cd51c0df7afa6d119ec78f65274515 /daemon/UserSpaceSource.cpp
parent020278c1a682ea75ddb63fe4e0d373116935199f (diff)
gator: Version 5.195.19
Signed-off-by: Drew Richardson <drew.richardson@arm.com>
Diffstat (limited to 'daemon/UserSpaceSource.cpp')
-rw-r--r--daemon/UserSpaceSource.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/daemon/UserSpaceSource.cpp b/daemon/UserSpaceSource.cpp
index debe696..8c328e0 100644
--- a/daemon/UserSpaceSource.cpp
+++ b/daemon/UserSpaceSource.cpp
@@ -16,7 +16,6 @@
#include "Logging.h"
#include "SessionData.h"
-#define NS_PER_S ((uint64_t)1000000000)
#define NS_PER_US 1000
extern Child *child;
@@ -35,6 +34,7 @@ void UserSpaceSource::run() {
prctl(PR_SET_NAME, (unsigned long)&"gatord-counters", 0, 0, 0);
gSessionData->hwmon.start();
+ gSessionData->fsDriver.start();
int64_t monotonic_started = 0;
while (monotonic_started <= 0) {
@@ -48,16 +48,7 @@ void UserSpaceSource::run() {
uint64_t next_time = 0;
while (gSessionData->mSessionIsActive) {
- struct timespec ts;
-#ifndef CLOCK_MONOTONIC_RAW
- // Android doesn't have this defined but it was added in Linux 2.6.28
-#define CLOCK_MONOTONIC_RAW 4
-#endif
- if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts) != 0) {
- logg->logError(__FILE__, __LINE__, "Failed to get uptime");
- handleException();
- }
- const uint64_t curr_time = (NS_PER_S*ts.tv_sec + ts.tv_nsec) - monotonic_started;
+ const uint64_t curr_time = getTime() - monotonic_started;
// Sample ten times a second ignoring gSessionData->mSampleRate
next_time += NS_PER_S/10;//gSessionData->mSampleRate;
if (next_time < curr_time) {
@@ -67,6 +58,7 @@ void UserSpaceSource::run() {
if (mBuffer.eventHeader(curr_time)) {
gSessionData->hwmon.read(&mBuffer);
+ gSessionData->fsDriver.read(&mBuffer);
// Only check after writing all counters so that time and corresponding counters appear in the same frame
mBuffer.check(curr_time);
}