aboutsummaryrefslogtreecommitdiff
path: root/daemon/KMod.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/KMod.cpp')
-rw-r--r--daemon/KMod.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/daemon/KMod.cpp b/daemon/KMod.cpp
index 9300002..73e123d 100644
--- a/daemon/KMod.cpp
+++ b/daemon/KMod.cpp
@@ -58,10 +58,15 @@ void KMod::setupCounter(Counter &counter) {
return;
}
+ int value = 0;
snprintf(text, sizeof(text), "%s/key", base);
- int key = 0;
- DriverSource::readIntDriver(text, &key);
- counter.setKey(key);
+ DriverSource::readIntDriver(text, &value);
+ counter.setKey(value);
+
+ snprintf(text, sizeof(text), "%s/cores", base);
+ if (DriverSource::readIntDriver(text, &value) == 0) {
+ counter.setCores(value);
+ }
snprintf(text, sizeof(text), "%s/event", base);
DriverSource::writeDriver(text, counter.getEvent());