use pointers to strings
This commit is contained in:
@@ -23,7 +23,7 @@ struct cpuSensors {
|
|||||||
uint32_t avg_freq = 0;
|
uint32_t avg_freq = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void detectHwmon(cpuSensors* target, std::string pci);
|
void detectHwmon(cpuSensors* target, const std::string& pci);
|
||||||
void update(cpuSensors* g);
|
void update(cpuSensors* g);
|
||||||
|
|
||||||
} // namespace cpu
|
} // namespace cpu
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ struct gpuSensors {
|
|||||||
// uint64_t vram_total = 0;
|
// uint64_t vram_total = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void detectHwmon(gpuSensors* target, std::string pci);
|
void detectHwmon(gpuSensors* target, const std::string& pci);
|
||||||
void update(gpuSensors* g);
|
void update(gpuSensors* g);
|
||||||
|
|
||||||
} // namespace gpu
|
} // namespace gpu
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
namespace cpu {
|
namespace cpu {
|
||||||
|
|
||||||
void detectHwmon(cpuSensors* target, std::string pci) {
|
void detectHwmon(cpuSensors* target, const std::string& pci) {
|
||||||
std::string path = "/sys/bus/pci/devices/" + pci + "/hwmon";
|
std::string path = "/sys/bus/pci/devices/" + pci + "/hwmon";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
namespace gpu {
|
namespace gpu {
|
||||||
|
|
||||||
/* takes pointer to a target gpu::sensors struct and updates its hwmon path and detects gpu_metrics */
|
/* takes pointer to a target gpu::sensors struct and updates its hwmon path and detects gpu_metrics */
|
||||||
void detectHwmon(gpuSensors* target, std::string pci) {
|
void detectHwmon(gpuSensors* target, const std::string& pci) {
|
||||||
target->hwmon = getFirstDir("/sys/bus/pci/devices/" + pci + "/hwmon");
|
target->hwmon = getFirstDir("/sys/bus/pci/devices/" + pci + "/hwmon");
|
||||||
log(LOG::INF, "gpu::detectHwmon", "Detected path \"{}\"", target->hwmon);
|
log(LOG::INF, "gpu::detectHwmon", "Detected path \"{}\"", target->hwmon);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user