add cpu_info.cores_per_socket
This commit is contained in:
parent
e4c00a7b92
commit
51b607866f
|
@ -509,6 +509,10 @@ use vars qw(%classes %cmds);
|
|||
name => 'total_sockets', type => 'Int',
|
||||
desc => 'Total CPU sockets (physical)',
|
||||
},
|
||||
{
|
||||
name => 'cores_per_socket', type => 'Int',
|
||||
desc => 'Number of CPU cores per CPU socket',
|
||||
},
|
||||
],
|
||||
Uptime => [
|
||||
{
|
||||
|
|
|
@ -66,6 +66,7 @@ public class CpuInfo extends SigarCommandBase {
|
|||
println("Total CPUs....." + info.getTotalCores());
|
||||
if (info.getTotalCores() != info.getTotalSockets()) {
|
||||
println("Physical CPUs.." + info.getTotalSockets());
|
||||
println("Cores per CPU.." + info.getCoresPerSocket());
|
||||
}
|
||||
|
||||
if (cacheSize != Sigar.FIELD_NOTIMPL) {
|
||||
|
|
|
@ -188,6 +188,7 @@ typedef struct {
|
|||
sigar_uint64_t cache_size;
|
||||
int total_sockets;
|
||||
int total_cores;
|
||||
int cores_per_socket;
|
||||
} sigar_cpu_info_t;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -1987,8 +1987,9 @@ int sigar_cpu_info_list_get(sigar_t *sigar,
|
|||
|
||||
info = &cpu_infos->data[cpu_infos->number++];
|
||||
|
||||
info->total_sockets = ncpu;
|
||||
info->total_cores = ncpu;
|
||||
info->cores_per_socket = 1; /*XXX*/
|
||||
info->total_sockets = ncpu; /*XXX*/
|
||||
|
||||
info->cache_size = SIGAR_CPU_CACHE_SIZE;
|
||||
|
||||
|
|
|
@ -2132,6 +2132,7 @@ int sigar_cpu_info_list_get(sigar_t *sigar,
|
|||
info->mhz = mhz;
|
||||
info->cache_size = cache_size;
|
||||
info->total_cores = sigar->ncpu;
|
||||
info->cores_per_socket = sigar->lcpu;
|
||||
info->total_sockets = sigar_cpu_socket_count(sigar);
|
||||
}
|
||||
|
||||
|
|
|
@ -679,8 +679,9 @@ int sigar_cpu_info_list_get(sigar_t *sigar,
|
|||
|
||||
info = &cpu_infos->data[cpu_infos->number++];
|
||||
|
||||
info->total_sockets = sigar->ncpu;
|
||||
info->total_cores = sigar->ncpu;
|
||||
info->cores_per_socket = 1; /*XXX*/
|
||||
info->total_sockets = sigar->ncpu; /*XXX*/
|
||||
|
||||
#ifdef __ia64__
|
||||
SIGAR_SSTRCPY(info->vendor, "Intel"); /*XXX*/
|
||||
|
|
|
@ -1589,8 +1589,10 @@ int sigar_cpu_info_list_get(sigar_t *sigar,
|
|||
|
||||
cpu_info = &cpu_infos->data[cpu_infos->number];
|
||||
get_cpuinfo_max_freq(cpu_info, cpu_infos->number);
|
||||
cpu_info->total_sockets = sigar_cpu_socket_count(sigar);
|
||||
|
||||
cpu_info->total_cores = sigar->ncpu;
|
||||
info->cores_per_socket = sigar->lcpu;
|
||||
cpu_info->total_sockets = sigar_cpu_socket_count(sigar);
|
||||
|
||||
++cpu_infos->number;
|
||||
SIGAR_CPU_INFO_LIST_GROW(cpu_infos);
|
||||
|
|
|
@ -1799,6 +1799,7 @@ int sigar_cpu_info_list_get(sigar_t *sigar,
|
|||
sigar_cpu_info_t *info = &cpu_infos->data[i];
|
||||
info->total_sockets = nsockets;
|
||||
info->total_cores = sigar->ncpu;
|
||||
info->cores_per_socket = sigar->ncpu / nsockets;
|
||||
}
|
||||
|
||||
return SIGAR_OK;
|
||||
|
|
|
@ -2005,8 +2005,9 @@ static int sigar_cpu_info_get(sigar_t *sigar, sigar_cpu_info_t *info)
|
|||
RegCloseKey(key);
|
||||
RegCloseKey(cpu);
|
||||
|
||||
info->total_sockets = sigar_cpu_socket_count(sigar);
|
||||
info->total_cores = sigar->ncpu;
|
||||
info->cores_per_socket = sigar->lcpu;
|
||||
info->total_sockets = sigar_cpu_socket_count(sigar);
|
||||
|
||||
return SIGAR_OK;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue