Changeset View
Changeset View
Standalone View
Standalone View
ksysguardd/Linux/stat.c
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 504 | if ( strcmp( "cpu", tag ) == 0 ) { | |||
---|---|---|---|---|---|
519 | registerLegacyMonitor( "cpu/wait", "float", printCPUWait, printCPUWaitInfo, StatSM ); | 519 | registerLegacyMonitor( "cpu/wait", "float", printCPUWait, printCPUWaitInfo, StatSM ); | ||
520 | } | 520 | } | ||
521 | else if ( strncmp( "cpu", tag, 3 ) == 0 ) { | 521 | else if ( strncmp( "cpu", tag, 3 ) == 0 ) { | ||
522 | char cmdName[ 24 ]; | 522 | char cmdName[ 24 ]; | ||
523 | /* Load for each SMP CPU */ | 523 | /* Load for each SMP CPU */ | ||
524 | int id; | 524 | int id; | ||
525 | 525 | | |||
526 | sscanf( tag + 3, "%d", &id ); | 526 | sscanf( tag + 3, "%d", &id ); | ||
527 | CPUCount++; | 527 | if ( CPUCount < id + 1 ) | ||
528 | CPUCount = id + 1; | ||||
528 | sprintf( cmdName, "cpu/cpu%d/user", id ); | 529 | sprintf( cmdName, "cpu/cpu%d/user", id ); | ||
529 | registerMonitor( cmdName, "float", printCPUxUser, printCPUxUserInfo, StatSM ); | 530 | registerMonitor( cmdName, "float", printCPUxUser, printCPUxUserInfo, StatSM ); | ||
530 | sprintf( cmdName, "cpu/cpu%d/nice", id ); | 531 | sprintf( cmdName, "cpu/cpu%d/nice", id ); | ||
531 | registerMonitor( cmdName, "float", printCPUxNice, printCPUxNiceInfo, StatSM ); | 532 | registerMonitor( cmdName, "float", printCPUxNice, printCPUxNiceInfo, StatSM ); | ||
532 | sprintf( cmdName, "cpu/cpu%d/sys", id ); | 533 | sprintf( cmdName, "cpu/cpu%d/sys", id ); | ||
533 | registerMonitor( cmdName, "float", printCPUxSys, printCPUxSysInfo, StatSM ); | 534 | registerMonitor( cmdName, "float", printCPUxSys, printCPUxSysInfo, StatSM ); | ||
534 | sprintf( cmdName, "cpu/cpu%d/TotalLoad", id ); | 535 | sprintf( cmdName, "cpu/cpu%d/TotalLoad", id ); | ||
535 | registerMonitor( cmdName, "float", printCPUxTotalLoad, printCPUxTotalLoadInfo, StatSM ); | 536 | registerMonitor( cmdName, "float", printCPUxTotalLoad, printCPUxTotalLoadInfo, StatSM ); | ||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |