diff options
author | Drew Richardson <drew.richardson@arm.com> | 2013-06-17 12:00:00 -0700 |
---|---|---|
committer | Drew Richardson <drew.richardson@arm.com> | 2014-12-19 15:44:26 -0800 |
commit | febe35e3fa5d8ac027b914f14991c95846f49251 (patch) | |
tree | c197d0085de10108749260486198c8381bf01f81 /daemon/KMod.cpp | |
parent | 1b5637426bfc10a64571c81e24019032206d651b (diff) |
gator: Version 5.155.15
Signed-off-by: Drew Richardson <drew.richardson@arm.com>
Diffstat (limited to 'daemon/KMod.cpp')
-rw-r--r-- | daemon/KMod.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/daemon/KMod.cpp b/daemon/KMod.cpp index 5f12046..04f3330 100644 --- a/daemon/KMod.cpp +++ b/daemon/KMod.cpp @@ -58,25 +58,23 @@ void KMod::setupCounter(Counter &counter) { } snprintf(text, sizeof(text), "%s/key", base); - int key; + int key = 0; Collector::readIntDriver(text, &key); counter.setKey(key); snprintf(text, sizeof(text), "%s/event", base); Collector::writeDriver(text, counter.getEvent()); - if (counter.isEBSCapable()) { - snprintf(text, sizeof(text), "%s/count", base); - if (access(text, F_OK) == 0) { - int count = counter.getCount(); - if (Collector::writeReadDriver(text, &count) && counter.getCount() > 0) { - logg->logError(__FILE__, __LINE__, "Cannot enable EBS for %s:%s with a count of %d\n", counter.getTitle(), counter.getName(), counter.getCount()); - handleException(); - } - counter.setCount(count); - } else if (counter.getCount() > 0) { - logg->logError(__FILE__, __LINE__, "Event Based Sampling is only supported with kernel versions 3.0.0 and higher with CONFIG_PERF_EVENTS=y, and CONFIG_HW_PERF_EVENTS=y\n"); + snprintf(text, sizeof(text), "%s/count", base); + if (access(text, F_OK) == 0) { + int count = counter.getCount(); + if (Collector::writeReadDriver(text, &count) && counter.getCount() > 0) { + logg->logError(__FILE__, __LINE__, "Cannot enable EBS for %s:%i with a count of %d\n", counter.getType(), counter.getEvent(), counter.getCount()); handleException(); } + counter.setCount(count); + } else if (counter.getCount() > 0) { + logg->logError(__FILE__, __LINE__, "Event Based Sampling is only supported with kernel versions 3.0.0 and higher with CONFIG_PERF_EVENTS=y, and CONFIG_HW_PERF_EVENTS=y\n"); + handleException(); } } |