Skip to content

Commit 26c9bae

Browse files
Luciano Chaveztyreld
authored andcommitted
lparstat: Use pool_capacity for determining active cpus in a pool
The function get_active_cpus_in_pool() primarily used the value from the physical_procs_allocated_to_virtualization sysentry to represent the cpus active in a pool. This is incorrect as that value represents the physical processors in the system allocated to virtualization. This patch changes the get_active_cpus_in_pool() function to only use the pool_capacity sysentry for correctly determining the active cpus in a pool. Fixes: efa87d9 ("lparstat: Correct presentation of some stats") Signed-off-by: Luciano Chavez <[email protected]> Signed-off-by: Tyrel Datwyler <[email protected]>
1 parent 4039866 commit 26c9bae

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/lparstat.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -785,13 +785,8 @@ void get_active_cpus_in_pool(struct sysentry *se, char *buf)
785785
{
786786
struct sysentry *tmp;
787787

788-
tmp = get_sysentry("physical_procs_allocated_to_virtualization");
789-
if (tmp) {
790-
sprintf(buf, "%d", atoi(tmp->value));
791-
} else {
792-
tmp = get_sysentry("pool_capacity");
793-
sprintf(buf, "%d", atoi(tmp->value)/100);
794-
}
788+
tmp = get_sysentry("pool_capacity");
789+
sprintf(buf, "%d", atoi(tmp->value)/100);
795790
}
796791

797792
void get_memory_mode(struct sysentry *se, char *buf)

0 commit comments

Comments
 (0)