aboutsummaryrefslogtreecommitdiff
path: root/daemon/CPUFreqDriver.cpp
diff options
context:
space:
mode:
authorDrew Richardson <drew.richardson@arm.com>2015-03-28 12:00:00 -0700
committerDrew Richardson <drew.richardson@arm.com>2015-04-01 14:41:00 -0700
commitabc3535c0d237bf7968b7092e545f2ff422af954 (patch)
tree778f83b3d8fd576762290b58b12c33cca5a193e1 /daemon/CPUFreqDriver.cpp
parente8f6a181be0b67fc9d9ac117bc2ed01737be654c (diff)
downloadgator-abc3535c0d237bf7968b7092e545f2ff422af954.tar.gz
gator: Version 5.215.21
Signed-off-by: Drew Richardson <drew.richardson@arm.com>
Diffstat (limited to 'daemon/CPUFreqDriver.cpp')
-rw-r--r--daemon/CPUFreqDriver.cpp58
1 files changed, 0 insertions, 58 deletions
diff --git a/daemon/CPUFreqDriver.cpp b/daemon/CPUFreqDriver.cpp
deleted file mode 100644
index 41f9d6f..0000000
--- a/daemon/CPUFreqDriver.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Copyright (C) ARM Limited 2013-2014. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include "CPUFreqDriver.h"
-
-#include "Buffer.h"
-#include "DriverSource.h"
-#include "Logging.h"
-#include "SessionData.h"
-
-CPUFreqDriver::CPUFreqDriver() : mPrev() {
-}
-
-CPUFreqDriver::~CPUFreqDriver() {
-}
-
-void CPUFreqDriver::readEvents(mxml_node_t *const) {
- // Only for use with perf
- if (!gSessionData->perf.isSetup()) {
- return;
- }
-
- setCounters(new DriverCounter(getCounters(), strdup("Linux_power_cpu_freq")));
-}
-
-void CPUFreqDriver::read(Buffer *const buffer) {
- char buf[64];
- const DriverCounter *const counter = getCounters();
- if ((counter == NULL) || !counter->isEnabled()) {
- return;
- }
-
- const int key = getCounters()->getKey();
- bool resetCores = false;
- for (int i = 0; i < gSessionData->mCores; ++i) {
- snprintf(buf, sizeof(buf), "/sys/devices/system/cpu/cpu%i/cpufreq/cpuinfo_cur_freq", i);
- int64_t freq;
- if (DriverSource::readInt64Driver(buf, &freq) != 0) {
- freq = 0;
- }
- if (mPrev[i] != freq) {
- mPrev[i] = freq;
- // Change cores
- buffer->event64(2, i);
- resetCores = true;
- buffer->event64(key, 1000*freq);
- }
- }
- if (resetCores) {
- // Revert cores, UserSpaceSource is all on core 0
- buffer->event64(2, 0);
- }
-}