[SIGAR-71] option for cpu_list to report cores rather than sockets
This commit is contained in:
1 parent
9955d435de
commit
ac8f9541cd
5 files changed
+14
-7
No files matched your search
@@ -248,6 +248,12 @@ static int is_ht_enabled(sigar_t *sigar)
|
||||
sigar->ht_enabled = 0;
|
||||
sigar->lcpu = 0;
|
||||
|
||||
if (sigar->cpu_list_cores) {
|
||||
sigar_log_printf(sigar, SIGAR_LOG_DEBUG,
|
||||
"[cpu] skipping HT check");
|
||||
return 0;
|
||||
}
|
||||
|
||||
sigar_cpuid(0, &eax, &ebx, &ecx, &edx);
|
||||
|
||||
if ((ebx == INTEL_ID) || (ebx == AMD_ID)) {
|
||||
|
||||
@@ -438,7 +438,7 @@ int sigar_cpu_list_get(sigar_t *sigar, sigar_cpu_list_t *cpulist)
|
||||
buf = ksp->ks_data;
|
||||
buf += sizeof(kmutex_t);
|
||||
memcpy(&cpuinfo[0], buf, sizeof(cpuinfo));
|
||||
chip_id = get_chip_id(sigar, i);
|
||||
chip_id = sigar->cpu_list_cores ? -1 : get_chip_id(sigar, i);
|
||||
|
||||
if (chip_id == -1) {
|
||||
SIGAR_CPU_LIST_GROW(cpulist);
|
||||
|
||||
@@ -39,6 +39,8 @@ SIGAR_DECLARE(int) sigar_open(sigar_t **sigar)
|
||||
int status = sigar_os_open(sigar);
|
||||
|
||||
if (status == SIGAR_OK) {
|
||||
/* XXX tmp hack */
|
||||
(*sigar)->cpu_list_cores = getenv("SIGAR_CPU_CORES") ? 1 : 0;
|
||||
(*sigar)->pid = 0;
|
||||
(*sigar)->ifconf_buf = NULL;
|
||||
(*sigar)->ifconf_len = 0;
|
||||
|
||||
Reference in new issue
Block a user