Skip to content

Commit e297144

Browse files
committed
CPUUsage: fix multi core data detection
1 parent 42cf88b commit e297144

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/detection/cpuusage/cpuusage_linux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const char* ffGetCpuUsageInfo(FFlist* cpuTimes)
2121
return "fscanf() first line failed";
2222

2323
uint64_t user = 0, nice = 0, system = 0, idle = 0, iowait = 0, irq = 0, softirq = 0;
24-
while (fscanf(procStat, "cpu%*d%" PRIu64 "%" PRIu64 "%" PRIu64 "%" PRIu64 "%" PRIu64 "%" PRIu64 "%" PRIu64, &user, &nice, &system, &idle, &iowait, &irq, &softirq) == 7)
24+
while (fscanf(procStat, "cpu%*d%" PRIu64 "%" PRIu64 "%" PRIu64 "%" PRIu64 "%" PRIu64 "%" PRIu64 "%" PRIu64 "%*[^\n]\n", &user, &nice, &system, &idle, &iowait, &irq, &softirq) == 7)
2525
{
2626
uint64_t inUse = user + nice + system;
2727
uint64_t total = inUse + idle + iowait + irq + softirq;

0 commit comments

Comments
 (0)