perfstat_partition_config interface

The perfstat_partition_config interface returns a perfstat_partition_config_t structure, which is defined in the libperfstat.h file.

The selected fields from the perfstat_partition_config_t structure include:
Item Descriptor
partitionname Partition name
processorFamily Processor type
processorModel Processor model
machineID Machine ID
processorMHz Processor clock speed in megahertz
numProcessors Number of configured physical processors in frame
OSName Name of operating system
OSVersion Version of operating system
OSBuild Build of operating system
lcpus Number of logical CPUs
smtthreads Number of SMT threads
drives Total number of drives
nw_adapters Total number of network adapters
vcpus Minimum, maximum, and online virtual CPUs
cpucap Minimum, maximum, and online CPU capacity
entitled_proc_capacity Number of processor units that this partition is entitled to receive
cpucap_weightage Variable processor capacity weightage
mem_weightage Variable memory capacity weightage
cpupool_weightage Pool weightage
activecpusinpool Count of physical CPUs in the shared processor pool to which the partition belongs
sharedpcpu Number of physical processors allocated for the use of the shared processor
maxpoolcap Maximum processor capacity of partition's pool
entpoolcap Entitled processor capacity of partition's pool
mem Minimum, maximum, and online memory
totiomement I/O memory entitlement of the partition in bytes
mempoolid AMS pool ID of the pool to which the logical partition (LPAR) belongs
hyperpgsize Hypervisor page size in kilobytes
exp_mem Minimum, maximum, and online expanded memory
targetmemexpfactor Target memory expansion factor scaled by 100
targetmemexpsize Expanded memory size in megabytes
Subprocessormode Subprocessor mode for the partition
For a complete list, see the perfstat_partition_config_t section in the libperfstat.h header file.
The usage of the code for the perfstat_partition_config API is as follows:
#include <libperfstat.h>

int main(int argc, char *argv[])
{
   perfstat_partition_config_t pinfo;
   int rc;

   rc = perfstat_partition_config(NULL, &pinfo, sizeof(perfstat_partition_config_t), 1);
   if(rc != 1)
   { 
    perror("Error in perfstat_partition_config"); 
    exit(-1);
   } 
   printf("==========Configuration Information of Partition==========\n"); 
   printf("Partition Name =       %s\n",pinfo.partitionname); 
   printf("Node Name =            %s\n",pinfo.nodename); 
   printf("Partition Number =     %u\n",pinfo.partitionnum); 
   printf("Group ID =             %u\n",pinfo.groupid); 
   printf("\n\n========General Partition Properties(1=YES, 0=NO)=========\n"); 
   printf("SMT Capable =          %u\n",pinfo.conf.b.smt_capable);
              /* 1, if OS supports SMT mode */
   printf("SMT Enabled =          %u\n",pinfo.conf.b.smt_enabled);
              /* 1, if SMT mode is on */
   printf("LPAR Capable =         %u\n",pinfo.conf.b.lpar_capable);
              /* 1, if OS supports logical partitioning */
   printf("LPAR Enabled =         %u\n",pinfo.conf.b.lpar_enabled);
              /* 1, if logical partitioning is on */
   printf("Shared Capable =       %u\n",pinfo.conf.b.shared_capable);
              /* 1, if OS supports shared processor LPAR */
   printf("Shared Enabled =       %u\n",pinfo.conf.b.shared_enabled);
              /* 1, if partition runs in shared mode */
   printf("DLPAR Capable =        %u\n",pinfo.conf.b.dlpar_capable);
              /* 1, if OS supports dynamic LPAR */
   printf("Capped =               %u\n",pinfo.conf.b.capped);
              /* 1, if partition is capped */
   printf("64-Bit Kernel =        %u\n",pinfo.conf.b.kernel_is_64);
              /* 1, if kernel is 64 bit */
   printf("Pool Util Authority =  %u\n",pinfo.conf.b.pool_util_authority);
              /* 1, if pool utilization available */
   printf("Donate Capable =       %u\n",pinfo.conf.b.donate_capable);
              /* 1, if capable of donating cycles */
   printf("Donate Enabled =       %u\n",pinfo.conf.b.donate_enabled);
              /* 1, if capable of donating cycles */
   printf("AMS Capable =          %u\n",pinfo.conf.b.ams_capable);
              /* 1, if AMS(Active Memory Sharing) capable */
   printf("AMS Enabled =          %u\n",pinfo.conf.b.ams_enabled);
              /* 1, if AMS(Active Memory Sharing) enabled */
   printf("Power Saving Mode =    %u\n",pinfo.conf.b.power_save);
              /* 1, if Power saving mode is enabled */
   printf("AME Enabled =          %u\n",pinfo.conf.b.ame_enabled);
              /* 1, if Active Memory Expansion is enabled */
   printf("Shared Extended =      %u\n",pinfo.conf.b.shared_extended);
              /* 1, if Shared Extended */
   printf("\n\n==================Hardware Configuration==================\n");
   printf("Processor Type =               %s\n",pinfo.processorFamily);
   printf("Processor Model =              %s\n",pinfo.processorModel);
   printf("Machine ID =                   %s\n",pinfo.machineID);
   printf("Processor Clock Speed =        %lf MHz\n",pinfo.processorMHz);
   printf("Online Configured Processors = %lld\n",pinfo.numProcessors.online);
   printf("Max Configured Processors =    %lld\n",pinfo.numProcessors.max);
   printf("\n\n==================Software Configuration==================\n");
   printf("OS Name =                      %s\n",pinfo.OSName);
   printf("OS Version =                   %s\n",pinfo.OSVersion);
   printf("OS Build =                     %s\n",pinfo.OSBuild);
   printf("\n\n====================LPAR Configuration====================\n");
   printf("Number of Logical CPUs =       %u\n",pinfo.lcpus);
   printf("Number of SMT Threads =        %u\n",pinfo.smtthreads);
   printf("Number of Drives =             %u\n",pinfo.drives);
   printf("Number of NW Adapters =        %u\n",pinfo.nw_adapters);
   printf("\n\n===========Physical CPU Related Configuration=============\n");
   printf("Minimum CPU Capacity =         %.2f\n",(float)pinfo.cpucap.min/100.0);
   printf("Maximum CPU Capacity =         %.2f\n",(float)pinfo.cpucap.max/100.0);
   printf("CPU Capacity Weightage =       %u\n",pinfo.cpucap_weightage);
   printf("Entitled Proc Capacity =       %.2f\n",pinfo.entitled_proc_capacity/100.0);
   printf("\n\n============Virtual CPU Related Configuration=============\n");
   printf("Minimum Virtual CPUs =         %lld\n",pinfo.vcpus.min);
   printf("Maximum Virtual CPUs =         %lld\n",pinfo.vcpus.max);
   printf("Online Virtual CPUs =          %lld\n",pinfo.vcpus.online);
   printf("\n\n==========Processor Pool Related Configuration============\n");
   printf("Processor Pool Id =            %u\n",pinfo.processor_poolid);
   printf("Active CPUs in pool =          %u\n",pinfo.activecpusinpool);
   printf("Pool Weightage =               %u\n",pinfo.cpupool_weightage);
   printf("Shared processors Count =      %u\n",pinfo.sharedpcpu);
   printf("Max pool Capacity =            %u\n",pinfo.maxpoolcap);
   printf("Entitled pool Capacity =       %u\n",pinfo.entpoolcap);
   printf("\n\n==============Memory Related Configuration================\n");
   printf("Minimum Memory =               %lld\n",pinfo.mem.min);
   printf("Maximum memory =               %lld\n",pinfo.mem.max);
   printf("Online memory =                %lld\n",pinfo.mem.online);
   printf("Memory capacity Weightage =    %u\n",pinfo.mem_weightage);
   printf("\n\n===============AMS Related Configuration==================\n");
   printf("I/O memory Entitlement =       %lld\n",pinfo.totiomement);
   printf("AMS Pool ID =                  %d\n",pinfo.mempoolid);
   printf("Hypervisor Page Size =         %f\n",pinfo.hyperpgsize);
   printf("\n\n===============AME Related Configuration==================\n");
   printf("Minimum Expanded memory =      %lld\n",pinfo.exp_mem.min);
   printf("Maximum Expanded Memory =      %lld\n",pinfo.exp_mem.max);
   printf("Online Expanded memory =       %lld\n",pinfo.exp_mem.online);
   printf("Target memory Expansion factor = %lld\n",pinfo.targetmemexpfactor);
   printf("Target Memory Expansion Size = %lld\n",pinfo.targetmemexpsize);
   printf("\n==========================================================");
}    
The output of the program is as follows:
==========Configuration Information of Partition==========
Partition Name = clock15
Node Name = clock15
Partition Number = 9
Group ID = 0


========General Partition Properties(1=YES, 0=NO)=========
SMT Capable = 1
SMT Enabled = 1
LPAR Capable = 1
LPAR Enabled = 1
Shared Capable = 1
Shared Enabled = 1
DLPAR Capable = 1
Capped = 0
64-Bit Kernel = 1
Pool Util Authority = 0
Donate Capable = 0
Donate Enabled = 0
AMS Capable = 0
AMS Enabled = 0
Power Saving Mode = 1
AME Enabled = 0
Shared Extended = 0


==================Hardware Configuration==================
Processor Type = POWER_5
Processor Model = IBM,9133-55A
Machine ID = 061500H
Processor Clock Speed = 1648.350000 MHz
Online Configured Processors = 8
Max Configured Processors = 8


==================Software Configuration==================
OS Name = AIX
OS Version = 7.1
OS Build = Feb 17 2011 15:57:15 1107A_71D


====================LPAR Configuration====================
Number of Logical CPUs = 2
Number of SMT Threads = 2
Number of Drives = 2
Number of NW Adapters = 2


===========Physical CPU Related Configuration=============
Minimum CPU Capacity = 0.10
Maximum CPU Capacity = 8.00
CPU Capacity Weightage = 128
Entitled Proc Capacity = 0.75


============Virtual CPU Related Configuration=============
Minimum Virtual CPUs = 1
Maximum Virtual CPUs = 8
Online Virtual CPUs = 1


==========Processor Pool Related Configuration============
Processor Pool Id = 0
Active CPUs in pool = 3
Pool Weightage = 128
Shared processors Count = 0
Max pool Capacity = 0
Entitled pool Capacity = 0


==============Memory Related Configuration================
Minimum Memory = 256
Maximum memory = 4096
Online memory = 2048
Memory capacity Weightage = 0


===============AMS Related Configuration==================
I/O memory Entitlement = 0
AMS Pool ID = 0
Hypervisor Page Size = 0.000000
===============AME Related Configuration==================
Minimum Expanded memory = 0
Maximum Expanded Memory = 0
Online Expanded memory = 0
Target memory Expansion factor = 0
Target Memory Expansion Size = 0
==========================================================