Changeset 28506 in vbox for trunk/src/VBox/Additions/common/VBoxService
- Timestamp:
- Apr 20, 2010 8:36:25 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceStats.cpp
r28009 r28506 344 344 RTStrmClose(pStrm); 345 345 } 346 else 347 VBoxServiceVerbose(3, "VBoxStatsReportStatistics: memory info not available!\n"); 346 348 347 349 req.guestStats.u32PageSize = getpagesize(); … … 361 363 /** @todo req.guestStats.u32MemKernelNonPaged, make any sense? = 0? */ 362 364 365 bool fCpuInfoAvail = false; 363 366 rc = RTStrmOpen("/proc/stat", "r", &pStrm); 364 367 if (RT_SUCCESS(rc)) … … 414 417 + u64DeltaNice) * 100 / u64DeltaAll); 415 418 req.guestStats.u32StatCaps |= VBOX_GUEST_STAT_CPU_LOAD_IDLE \ 416 | VBOX_GUEST_STAT_CPU_LOAD_KERNEL \ 417 | VBOX_GUEST_STAT_CPU_LOAD_USER; 419 | VBOX_GUEST_STAT_CPU_LOAD_KERNEL \ 420 | VBOX_GUEST_STAT_CPU_LOAD_USER; 421 fCpuInfoAvail = true; 418 422 rc = VbglR3StatReport(&req); 419 423 if (RT_SUCCESS(rc)) … … 422 426 VBoxServiceVerbose(3, "VBoxStatsReportStatistics: stats report failed with rc=%Rrc\n", rc); 423 427 } 428 else 429 VBoxServiceVerbose(3, "VBoxStatsReportStatistics: skipping information for CPU%u\n", u32CpuId); 424 430 } 425 431 } 426 432 RTStrmClose(pStrm); 433 } 434 if (!fCpuInfoAvail) 435 { 436 VBoxServiceVerbose(3, "VBoxStatsReportStatistics: CPU info not available!\n"); 437 rc = VbglR3StatReport(&req); 438 if (RT_SUCCESS(rc)) 439 VBoxServiceVerbose(3, "VBoxStatsReportStatistics: new statistics reported successfully!\n"); 440 else 441 VBoxServiceVerbose(3, "VBoxStatsReportStatistics: stats report failed with rc=%Rrc\n", rc); 427 442 } 428 443 … … 542 557 req.guestStats.u32CpuLoad_Idle = (uint32_t)(u64DeltaIdle * 100 / u64DeltaAll); 543 558 req.guestStats.u32CpuLoad_Kernel = (uint32_t)(u64DeltaSystem * 100 / u64DeltaAll); 559 req.guestStats.u32CpuLoad_User = (uint32_t)(u64DeltaUser * 100 / u64DeltaAll); 544 560 545 561 req.guestStats.u32StatCaps |= VBOX_GUEST_STAT_CPU_LOAD_IDLE \ 546 | VBOX_GUEST_STAT_CPU_LOAD_KERNEL \547 | VBOX_GUEST_STAT_CPU_LOAD_USER;562 | VBOX_GUEST_STAT_CPU_LOAD_KERNEL \ 563 | VBOX_GUEST_STAT_CPU_LOAD_USER; 548 564 549 565 cCPUs++;
Note:
See TracChangeset
for help on using the changeset viewer.