(SIGAR-179) Increase buffer size in cpu_list query from 16 to 128

This commit is contained in:
Doug MacEachern 2009-08-23 15:58:52 -07:00
parent e3068f466a
commit e3b378ecd1
1 changed files with 5 additions and 6 deletions

View File

@ -725,6 +725,8 @@ static PERF_INSTANCE_DEFINITION *get_cpu_instance(sigar_t *sigar,
return PdhFirstInstance(object);
}
#define SPPI_MAX 128 /* XXX unhardcode; should move off this api anyhow */
#define sigar_NtQuerySystemInformation \
sigar->ntdll.query_sys_info.func
@ -743,8 +745,7 @@ static int get_idle_cpu(sigar_t *sigar, sigar_cpu_t *cpu,
DLLMOD_INIT(ntdll, FALSE);
if (sigar_NtQuerySystemInformation) {
DWORD retval, num;
/* XXX unhardcode 16 */
SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION info[16];
SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION info[SPPI_MAX];
/* into the lungs of hell */
sigar_NtQuerySystemInformation(SystemProcessorPerformanceInformation,
&info, sizeof(info), &retval);
@ -815,8 +816,7 @@ static int sigar_cpu_ntsys_get(sigar_t *sigar, sigar_cpu_t *cpu)
{
DWORD retval, num;
int i;
/* XXX unhardcode 16 */
SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION info[16];
SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION info[SPPI_MAX];
/* into the lungs of hell */
sigar_NtQuerySystemInformation(SystemProcessorPerformanceInformation,
&info, sizeof(info), &retval);
@ -918,8 +918,7 @@ static int sigar_cpu_list_ntsys_get(sigar_t *sigar,
int status, i, j;
int core_rollup = sigar_cpu_core_rollup(sigar);
/* XXX unhardcode 16 */
SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION info[16];
SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION info[SPPI_MAX];
/* into the lungs of hell */
sigar_NtQuerySystemInformation(SystemProcessorPerformanceInformation,
&info, sizeof(info), &retval);