(SIGAR-179) Increase buffer size in cpu_list query from 16 to 128
This commit is contained in:
		
							parent
							
								
									e3068f466a
								
							
						
					
					
						commit
						e3b378ecd1
					
				| @ -725,6 +725,8 @@ static PERF_INSTANCE_DEFINITION *get_cpu_instance(sigar_t *sigar, | |||||||
|     return PdhFirstInstance(object); |     return PdhFirstInstance(object); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | #define SPPI_MAX 128 /* XXX unhardcode; should move off this api anyhow */ | ||||||
|  | 
 | ||||||
| #define sigar_NtQuerySystemInformation \ | #define sigar_NtQuerySystemInformation \ | ||||||
|    sigar->ntdll.query_sys_info.func |    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); |         DLLMOD_INIT(ntdll, FALSE); | ||||||
|         if (sigar_NtQuerySystemInformation) { |         if (sigar_NtQuerySystemInformation) { | ||||||
|             DWORD retval, num; |             DWORD retval, num; | ||||||
|             /* XXX unhardcode 16 */ |             SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION info[SPPI_MAX]; | ||||||
|             SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION info[16]; |  | ||||||
|             /* into the lungs of hell */ |             /* into the lungs of hell */ | ||||||
|             sigar_NtQuerySystemInformation(SystemProcessorPerformanceInformation, |             sigar_NtQuerySystemInformation(SystemProcessorPerformanceInformation, | ||||||
|                                            &info, sizeof(info), &retval); |                                            &info, sizeof(info), &retval); | ||||||
| @ -815,8 +816,7 @@ static int sigar_cpu_ntsys_get(sigar_t *sigar, sigar_cpu_t *cpu) | |||||||
| { | { | ||||||
|     DWORD retval, num; |     DWORD retval, num; | ||||||
|     int i; |     int i; | ||||||
|     /* XXX unhardcode 16 */ |     SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION info[SPPI_MAX]; | ||||||
|     SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION info[16]; |  | ||||||
|     /* into the lungs of hell */ |     /* into the lungs of hell */ | ||||||
|     sigar_NtQuerySystemInformation(SystemProcessorPerformanceInformation, |     sigar_NtQuerySystemInformation(SystemProcessorPerformanceInformation, | ||||||
|                                    &info, sizeof(info), &retval); |                                    &info, sizeof(info), &retval); | ||||||
| @ -918,8 +918,7 @@ static int sigar_cpu_list_ntsys_get(sigar_t *sigar, | |||||||
|     int status, i, j; |     int status, i, j; | ||||||
|     int core_rollup = sigar_cpu_core_rollup(sigar); |     int core_rollup = sigar_cpu_core_rollup(sigar); | ||||||
| 
 | 
 | ||||||
|     /* XXX unhardcode 16 */ |     SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION info[SPPI_MAX]; | ||||||
|     SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION info[16]; |  | ||||||
|     /* into the lungs of hell */ |     /* into the lungs of hell */ | ||||||
|     sigar_NtQuerySystemInformation(SystemProcessorPerformanceInformation, |     sigar_NtQuerySystemInformation(SystemProcessorPerformanceInformation, | ||||||
|                           &info, sizeof(info), &retval); |                           &info, sizeof(info), &retval); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Doug MacEachern
						Doug MacEachern