Changeset 98020 in vbox for trunk/src/VBox/Main/src-server/solaris
- Timestamp:
- Jan 6, 2023 8:34:59 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/solaris/PerformanceSolaris.cpp
r96407 r98020 296 296 { 297 297 *total = totalRAM; 298 *available = cb / 1024;298 *available = (ULONG)RT_MIN(cb / 1024, ~(ULONG)0); 299 299 *used = *total - *available; 300 300 } … … 322 322 { 323 323 Assert((pid_t)process == psinfo.pr_pid); 324 *used = psinfo.pr_rssize;324 *used = (ULONG)RT_MIN(psinfo.pr_rssize, ~(ULONG)0); 325 325 } 326 326 else … … 378 378 uint64_t CollectorSolaris::wrapDetection(uint64_t cur, uint64_t prev, const char *name) 379 379 { 380 static bool fNotSeen = true; 381 382 if (fNotSeen && cur < prev) 383 { 384 fNotSeen = false; 385 LogRel(("Detected wrap on %s (%llu < %llu).\n", name, cur, prev)); 386 } 380 if (cur < prev) 381 LogRelMax(2, ("Detected wrap on %s (%llu < %llu).\n", name, cur, prev)); 387 382 return cur; 388 383 } … … 429 424 } 430 425 kstat_named_t *kn; 431 if ((kn = (kstat_named_t *)kstat_data_lookup(ksAdapter, (char *)"rbytes64")) == 0) 432 { 426 if ((kn = (kstat_named_t *)kstat_data_lookup(ksAdapter, (char *)"rbytes64")) == NULL) 427 { 428 if ((kn = (kstat_named_t *)kstat_data_lookup(ksAdapter, (char *)"rbytes")) == NULL) 429 { 430 LogRel(("kstat_data_lookup(rbytes) -> %d, name=%s\n", errno, name)); 431 return VERR_INTERNAL_ERROR; 432 } 433 #if ARCH_BITS == 32 433 434 if (g_fNotReported) 434 435 { … … 436 437 LogRel(("Failed to locate rbytes64, falling back to 32-bit counters...\n")); 437 438 } 438 if ((kn = (kstat_named_t *)kstat_data_lookup(ksAdapter, (char *)"rbytes")) == 0) 439 { 440 LogRel(("kstat_data_lookup(rbytes) -> %d, name=%s\n", errno, name)); 439 *rx = wrapCorrection(kn->value.ul, *rx, "rbytes"); 440 #else 441 AssertCompile(sizeof(kn->value.ul) == sizeof(uint64_t)); 442 *rx = wrapDetection(kn->value.ul, *rx, "rbytes"); 443 #endif 444 } 445 else 446 *rx = wrapDetection(kn->value.ull, *rx, "rbytes64"); 447 if ((kn = (kstat_named_t *)kstat_data_lookup(ksAdapter, (char *)"obytes64")) == NULL) 448 { 449 if ((kn = (kstat_named_t *)kstat_data_lookup(ksAdapter, (char *)"obytes")) == NULL) 450 { 451 LogRel(("kstat_data_lookup(obytes) -> %d\n", errno)); 441 452 return VERR_INTERNAL_ERROR; 442 453 } 443 *rx = wrapCorrection(kn->value.ul, *rx, "rbytes"); 444 } 445 else 446 *rx = wrapDetection(kn->value.ull, *rx, "rbytes64"); 447 if ((kn = (kstat_named_t *)kstat_data_lookup(ksAdapter, (char *)"obytes64")) == 0) 448 { 454 #if ARCH_BITS == 32 449 455 if (g_fNotReported) 450 456 { … … 452 458 LogRel(("Failed to locate obytes64, falling back to 32-bit counters...\n")); 453 459 } 454 if ((kn = (kstat_named_t *)kstat_data_lookup(ksAdapter, (char *)"obytes")) == 0)455 {456 LogRel(("kstat_data_lookup(obytes) -> %d\n", errno));457 return VERR_INTERNAL_ERROR;458 }459 460 *tx = wrapCorrection(kn->value.ul, *tx, "obytes"); 461 #else 462 AssertCompile(sizeof(kn->value.ul) == sizeof(uint64_t)); 463 *tx = wrapDetection(kn->value.ul, *tx, "obytes"); 464 #endif 460 465 } 461 466 else
Note:
See TracChangeset
for help on using the changeset viewer.