summaryrefslogtreecommitdiffstats
path: root/solaris/Platform.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-06-13 12:22:00 +0200
committerBenny Baumann <BenBE@geshi.org>2021-07-18 07:53:01 +0200
commit90cc16efc0cc400f6ff375eacdd3ac169d100985 (patch)
tree852a986818c5ec6a4dfecddcb498d3ce81138add /solaris/Platform.c
parentf47e88f5e89e1b72f3c309dfb1644c2e3d07a797 (diff)
Solaris: support offline CPUs and hot-swapping
Example hot-swapping: psradm -F -f 2
Diffstat (limited to 'solaris/Platform.c')
-rw-r--r--solaris/Platform.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/solaris/Platform.c b/solaris/Platform.c
index 30d10d8f..4923b790 100644
--- a/solaris/Platform.c
+++ b/solaris/Platform.c
@@ -184,7 +184,7 @@ int Platform_getMaxPid() {
double Platform_setCPUValues(Meter* this, unsigned int cpu) {
const SolarisProcessList* spl = (const SolarisProcessList*) this->pl;
- unsigned int cpus = this->pl->activeCPUs;
+ unsigned int cpus = this->pl->existingCPUs;
const CPUData* cpuData = NULL;
if (cpus == 1) {
@@ -194,6 +194,11 @@ double Platform_setCPUValues(Meter* this, unsigned int cpu) {
cpuData = &(spl->cpus[cpu]);
}
+ if (!cpuData->online) {
+ this->curItems = 0;
+ return NAN;
+ }
+
double percent;
double* v = this->values;

© 2014-2024 Faster IT GmbH | imprint | privacy policy