Commit a20dd95f authored by Micha Mueller's avatar Micha Mueller
Browse files

Perfevent plugin: make counter names unique

parent d53f3fd3
......@@ -85,7 +85,7 @@ void PerfCounter::startPolling() {
_fd = syscall(__NR_perf_event_open, &pe, -1, _cpuId, -1, 0);
if (_fd == -1) {
LOG(error) << "Failed to open performance-counter \"" << _name << "\" on CPU " << _cpuId;
LOG(error) << "Failed to open performance-counter \"" << _name << "\"";
return;
}
......
......@@ -8,6 +8,7 @@
#include "PerfeventConfigurator.h"
#include <iostream>
#include <sstream>
#include <string>
#include <unistd.h>
#include <iomanip>
#include <sys/sysinfo.h>
......@@ -154,6 +155,7 @@ bool PerfeventConfigurator::readConfig(std::string cfgPath) {
*perfCC = perfCounter;
string incMqtt = increaseMqtt(startMqtt, i);
perfCC->setName(perfCC->getName() + std::to_string(i));
perfCC->setCpuId(i);
perfCC->setMqtt(_mqttPrefix + incMqtt);
LOG(debug) << " CPU " << perfCC->getCpuId() << " using MQTT-Topic " << perfCC->getMqtt();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment