Signed-off-by: Anastasios Simeonidis symeonidis@csd.auth.gr --- dlls/ntdll/tests/info.c | 166 +++++++++++++++++++++++++++++++++++----- 1 file changed, 146 insertions(+), 20 deletions(-)
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index 30ed6e5ef9..caa123e982 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -738,8 +738,9 @@ static void test_query_logicalproc(void)
static void test_query_logicalprocex(void) { - SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *infoex, *infoex2; - DWORD relationship, len2, len; + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *infoex, *infoex_public, *infoex_core, *infoex_numa, + *infoex_cache, *infoex_package, *infoex_group, *ex; + DWORD relationship, len, len_public, len_core, len_numa, len_cache, len_package, len_group, len_union; NTSTATUS status; BOOL ret;
@@ -747,40 +748,69 @@ static void test_query_logicalprocex(void) return;
len = 0; - relationship = RelationProcessorCore; + relationship = RelationAll; status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), NULL, 0, &len); ok(status == STATUS_INFO_LENGTH_MISMATCH, "got 0x%08x\n", status); ok(len > 0, "got %u\n", len);
- len = 0; - relationship = RelationAll; - status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), NULL, 0, &len); + len_core = 0; + relationship = RelationProcessorCore; + status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), NULL, 0, &len_core); ok(status == STATUS_INFO_LENGTH_MISMATCH, "got 0x%08x\n", status); - ok(len > 0, "got %u\n", len); + ok(len_core > 0, "got %u\n", len_core); + + len_numa = 0; + relationship = RelationNumaNode; + status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), NULL, 0, &len_numa); + ok(status == STATUS_INFO_LENGTH_MISMATCH, "got 0x%08x\n", status); + ok(len_numa > 0, "got %u\n", len_numa); + + len_cache = 0; + relationship = RelationCache; + status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), NULL, 0, &len_cache); + ok(status == STATUS_INFO_LENGTH_MISMATCH, "got 0x%08x\n", status); + ok(len_cache > 0, "got %u\n", len_cache); + + len_package = 0; + relationship = RelationProcessorPackage; + status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), NULL, 0, &len_package); + ok(status == STATUS_INFO_LENGTH_MISMATCH, "got 0x%08x\n", status); + ok(len_package > 0, "got %u\n", len_package); + + len_group = 0; + relationship = RelationGroup; + status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), NULL, 0, &len_group); + ok(status == STATUS_INFO_LENGTH_MISMATCH, "got 0x%08x\n", status); + ok(len_group > 0, "got %u\n", len_group);
- len2 = 0; - ret = pGetLogicalProcessorInformationEx(RelationAll, NULL, &len2); + len_public = 0; + ret = pGetLogicalProcessorInformationEx(RelationAll, NULL, &len_public); ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d, error %d\n", ret, GetLastError()); - ok(len == len2, "got %u, expected %u\n", len2, len); + ok(len == len_public, "got %u, expected %u\n", len_public, len);
- if (len && len == len2) { + if (len && len == len_public) { int j, i;
infoex = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); - infoex2 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); - + infoex_public = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len_public); + infoex_core = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len_core); + infoex_numa = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len_numa); + infoex_cache = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len_cache); + infoex_package = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len_package); + infoex_group = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len_group); + + relationship = RelationAll; status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), infoex, len, &len); ok(status == STATUS_SUCCESS, "got 0x%08x\n", status);
- ret = pGetLogicalProcessorInformationEx(RelationAll, infoex2, &len2); + ret = pGetLogicalProcessorInformationEx(RelationAll, infoex_public, &len_public); ok(ret, "got %d, error %d\n", ret, GetLastError()); - ok(!memcmp(infoex, infoex2, len), "returned info data mismatch\n"); + ok(!memcmp(infoex, infoex_public, len), "returned info data mismatch\n");
+ /* Test for RelationAll. */ for(i = 0; status == STATUS_SUCCESS && i < len; ){ - SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *ex = (void*)(((char *)infoex) + i); + ex = (void*)(((char *)infoex) + i);
- ok(ex->Relationship >= RelationProcessorCore && ex->Relationship <= RelationGroup, - "Got invalid relationship value: 0x%x\n", ex->Relationship); if (!ex->Size) { ok(0, "got infoex[%u].Size=0\n", i); @@ -791,7 +821,7 @@ static void test_query_logicalprocex(void) switch(ex->Relationship){ case RelationProcessorCore: case RelationProcessorPackage: - trace("infoex[%u].Relationship: 0x%x (Core == 0x0 or Package == 0x3)\n", i, ex->Relationship); + trace("infoex[%u].Relationship: 0x%x (%s)\n", i, ex->Relationship, ex->Relationship == RelationProcessorCore ? "Core" : "Package"); trace("infoex[%u].Processor.Flags: 0x%x\n", i, ex->Processor.Flags); trace("infoex[%u].Processor.EfficiencyClass: 0x%x\n", i, ex->Processor.EfficiencyClass); trace("infoex[%u].Processor.GroupCount: 0x%x\n", i, ex->Processor.GroupCount); @@ -827,14 +857,110 @@ static void test_query_logicalprocex(void) } break; default: + ok(0, "Got invalid relationship value: 0x%x\n", ex->Relationship); break; }
i += ex->Size; }
+ /* Test Relationship filtering. */ + + relationship = RelationProcessorCore; + status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), infoex_core, len_core, &len_core); + ok(status == STATUS_SUCCESS, "got 0x%08x\n", status); + + for(i = 0; status == STATUS_SUCCESS && i < len_core;) { + ex = (void*)(((char*)infoex_core) + i); + if (ex->Size == 0) { + ok(0, "Got infoex_core[%u].Size=0\n", i); + break; + } + if (ex->Relationship != RelationProcessorCore) { + ok(0, "Expected 0x%x, got 0x%x\n", RelationProcessorCore, ex->Relationship); + break; + } + i += ex->Size; + } + + relationship = RelationNumaNode; + status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), infoex_numa, len_numa, &len_numa); + ok(status == STATUS_SUCCESS, "got 0x%08x\n", status); + + for(i = 0; status == STATUS_SUCCESS && i < len_numa;) { + ex = (void*)(((char*)infoex_numa) + i); + if (ex->Size == 0) { + ok(0, "Got infoex_numa[%u].Size=0\n", i); + break; + } + if (ex->Relationship != RelationNumaNode) { + ok(0, "Expected 0x%x, got 0x%x\n", RelationNumaNode, ex->Relationship); + break; + } + i += ex->Size; + } + + relationship = RelationCache; + status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), infoex_cache, len_cache, &len_cache); + ok(status == STATUS_SUCCESS, "got 0x%08x\n", status); + + for(i = 0; status == STATUS_SUCCESS && i < len_cache;) { + ex = (void*)(((char*)infoex_cache) + i); + if (ex->Size == 0) { + ok(0, "Got infoex_cache[%u].Size=0\n", i); + break; + } + if (ex->Relationship != RelationCache) { + ok(0, "Expected 0x%x, got 0x%x\n", RelationCache, ex->Relationship); + break; + } + i += ex->Size; + } + + relationship = RelationProcessorPackage; + status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), infoex_package, len_package, &len_package); + ok(status == STATUS_SUCCESS, "got 0x%08x\n", status); + + for(i = 0; status == STATUS_SUCCESS && i < len_package;) { + ex = (void*)(((char*)infoex_package) + i); + if (ex->Size == 0) { + ok(0, "Got infoex_package[%u].Size=0\n", i); + break; + } + if (ex->Relationship != RelationProcessorPackage) { + ok(0, "Expected 0x%x, got 0x%x\n", RelationProcessorPackage, ex->Relationship); + break; + } + i += ex->Size; + } + + relationship = RelationGroup; + status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), infoex_group, len_group, &len_group); + ok(status == STATUS_SUCCESS, "got 0x%08x\n", status); + + for(i = 0; status == STATUS_SUCCESS && i < len_group;) { + ex = (void*)(((char *)infoex_group) + i); + if (ex->Size == 0) { + ok(0, "Got infoex_group[%u].Size=0\n", i); + break; + } + if (ex->Relationship != RelationGroup) { + ok(0, "Expected 0x%x, got 0x%x\n", RelationGroup, ex->Relationship); + break; + } + i += ex->Size; + } + + len_union = len_core + len_numa + len_cache + len_package + len_group; + ok(len == len_union, "Expected 0x%x, got 0x%0x\n", len, len_union); + HeapFree(GetProcessHeap(), 0, infoex); - HeapFree(GetProcessHeap(), 0, infoex2); + HeapFree(GetProcessHeap(), 0, infoex_public); + HeapFree(GetProcessHeap(), 0, infoex_core); + HeapFree(GetProcessHeap(), 0, infoex_numa); + HeapFree(GetProcessHeap(), 0, infoex_cache); + HeapFree(GetProcessHeap(), 0, infoex_package); + HeapFree(GetProcessHeap(), 0, infoex_group); } }
Signed-off-by: Anastasios Simeonidis symeonidis@csd.auth.gr --- dlls/ntdll/nt.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index b6daa226b3..8c652a0615 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -1675,7 +1675,7 @@ static BOOL sysfs_count_list_elements(const char *filename, DWORD *result)
/* for 'data', max_len is the array count. for 'dataex', max_len is in bytes */ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **data, - SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX **dataex, DWORD *max_len) + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX **dataex, DWORD *max_len, DWORD relation) { static const char core_info[] = "/sys/devices/system/cpu/cpu%u/topology/%s"; static const char cache_info[] = "/sys/devices/system/cpu/cpu%u/cache/index%u/%s"; @@ -1686,6 +1686,9 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** char op, name[MAX_PATH]; ULONG_PTR all_cpus_mask = 0;
+ if (relation != RelationAll) + FIXME("Relationship filtering not implemented: 0x%x\n", relation); + /* On systems with a large number of CPU cores (32 or 64 depending on 32-bit or 64-bit), * we have issues parsing processor information: * - ULONG_PTR masks as used in data structures can't hold all cores. Requires splitting @@ -1895,7 +1898,7 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** #elif defined(__APPLE__) /* for 'data', max_len is the array count. for 'dataex', max_len is in bytes */ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **data, - SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX **dataex, DWORD *max_len) + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX **dataex, DWORD *max_len, DWORD relation) { DWORD pkgs_no, cores_no, lcpu_no, lcpu_per_core, cores_per_package, assoc, len = 0; DWORD cache_ctrs[10] = {0}; @@ -1905,6 +1908,9 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** size_t size; DWORD p,i,j,k;
+ if (relation != RelationAll) + FIXME("Relationship filtering not implemented: 0x%x\n", relation); + lcpu_no = NtCurrentTeb()->Peb->NumberOfProcessors;
size = sizeof(pkgs_no); @@ -2030,7 +2036,7 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** } #else static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **data, - SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX **dataex, DWORD *max_len) + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX **dataex, DWORD *max_len, DWORD relation) { FIXME("stub\n"); return STATUS_NOT_IMPLEMENTED; @@ -2868,7 +2874,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( break; }
- ret = create_logical_proc_info(&buf, NULL, &len); + ret = create_logical_proc_info(&buf, NULL, &len, RelationAll); if( ret != STATUS_SUCCESS ) { RtlFreeHeap(GetProcessHeap(), 0, buf); @@ -2957,9 +2963,6 @@ NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS SystemInform break; }
- if (*(DWORD*)Query != RelationAll) - FIXME("Relationship filtering not implemented: 0x%x\n", *(DWORD*)Query); - len = 3 * sizeof(*buf); buf = RtlAllocateHeap(GetProcessHeap(), 0, len); if (!buf) @@ -2968,7 +2971,7 @@ NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS SystemInform break; }
- ret = create_logical_proc_info(NULL, &buf, &len); + ret = create_logical_proc_info(NULL, &buf, &len, *(DWORD*)Query); if (ret != STATUS_SUCCESS) { RtlFreeHeap(GetProcessHeap(), 0, buf); @@ -2980,7 +2983,7 @@ NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS SystemInform if (!SystemInformation) ret = STATUS_ACCESS_VIOLATION; else - memcpy( SystemInformation, buf, len); + memcpy(SystemInformation, buf, len); } else ret = STATUS_INFO_LENGTH_MISMATCH;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=60830
Your paranoid android.
=== debian10 (32 bit report) ===
ntdll: info.c:880: Test failed: Expected 0x0, got 0x3 info.c:897: Test failed: Expected 0x1, got 0x3 info.c:914: Test failed: Expected 0x2, got 0x3 info.c:931: Test failed: Expected 0x3, got 0x0 info.c:948: Test failed: Expected 0x4, got 0x3 info.c:955: Test failed: Expected 0x518, got 0x1978
=== debian10 (32 bit Chinese:China report) ===
ntdll: info.c:880: Test failed: Expected 0x0, got 0x3 info.c:897: Test failed: Expected 0x1, got 0x3 info.c:914: Test failed: Expected 0x2, got 0x3 info.c:931: Test failed: Expected 0x3, got 0x0 info.c:948: Test failed: Expected 0x4, got 0x3 info.c:955: Test failed: Expected 0x518, got 0x1978
=== debian10 (32 bit WoW report) ===
ntdll: info.c:880: Test failed: Expected 0x0, got 0x3 info.c:897: Test failed: Expected 0x1, got 0x3 info.c:914: Test failed: Expected 0x2, got 0x3 info.c:931: Test failed: Expected 0x3, got 0x0 info.c:948: Test failed: Expected 0x4, got 0x3 info.c:955: Test failed: Expected 0x518, got 0x1978
=== debian10 (64 bit WoW report) ===
ntdll: info.c:880: Test failed: Expected 0x0, got 0x3 info.c:897: Test failed: Expected 0x1, got 0x3 info.c:914: Test failed: Expected 0x2, got 0x3 info.c:931: Test failed: Expected 0x3, got 0x0 info.c:948: Test failed: Expected 0x4, got 0x3 info.c:955: Test failed: Expected 0x518, got 0x1978
Also calculate all_cpus_mask on first pass.
Signed-off-by: Anastasios Simeonidis symeonidis@csd.auth.gr --- dlls/ntdll/nt.c | 254 ++++++++++++++++++++++++------------------------ 1 file changed, 128 insertions(+), 126 deletions(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 8c652a0615..52616b37be 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -1686,9 +1686,6 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** char op, name[MAX_PATH]; ULONG_PTR all_cpus_mask = 0;
- if (relation != RelationAll) - FIXME("Relationship filtering not implemented: 0x%x\n", relation); - /* On systems with a large number of CPU cores (32 or 64 depending on 32-bit or 64-bit), * we have issues parsing processor information: * - ULONG_PTR masks as used in data structures can't hold all cores. Requires splitting @@ -1725,18 +1722,21 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** continue; }
- sprintf(name, core_info, i, "physical_package_id"); - f = fopen(name, "r"); - if(f) - { - fscanf(f, "%u", &r); - fclose(f); - } - else r = 0; - if(!logical_proc_info_add_by_id(data, dataex, &len, max_len, RelationProcessorPackage, r, (ULONG_PTR)1 << i)) + if(relation == RelationAll || relation == RelationProcessorPackage) { - fclose(fcpu_list); - return STATUS_NO_MEMORY; + sprintf(name, core_info, i, "physical_package_id"); + f = fopen(name, "r"); + if(f) + { + fscanf(f, "%u", &r); + fclose(f); + } + else r = 0; + if(!logical_proc_info_add_by_id(data, dataex, &len, max_len, RelationProcessorPackage, r, (ULONG_PTR)1 << i)) + { + fclose(fcpu_list); + return STATUS_NO_MEMORY; + } }
/* Sysfs enumerates logical cores (and not physical cores), but Windows enumerates @@ -1749,143 +1749,145 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** * on kernel cpu core numbering as opposed to a hardware core ID like provided through * 'core_id', so are suitable as a unique ID. */ - sprintf(name, core_info, i, "thread_siblings_list"); - f = fopen(name, "r"); - if(f) + if(relation == RelationAll || relation == RelationProcessorCore || + relation == RelationNumaNode || relation == RelationGroup) { - fscanf(f, "%d%c", &phys_core, &op); - fclose(f); - } - else phys_core = i; + /* Mask of logical threads sharing same physical core in kernel core numbering. */ + sprintf(name, core_info, i, "thread_siblings"); + if(!sysfs_parse_bitmap(name, &thread_mask)) + thread_mask = 1<<i;
- /* Mask of logical threads sharing same physical core in kernel core numbering. */ - sprintf(name, core_info, i, "thread_siblings"); - if(!sysfs_parse_bitmap(name, &thread_mask)) - thread_mask = 1<<i; - if(!logical_proc_info_add_by_id(data, dataex, &len, max_len, RelationProcessorCore, phys_core, thread_mask)) - { - fclose(fcpu_list); - return STATUS_NO_MEMORY; - } + /* Needed later for NumaNode and Group. */ + all_cpus_mask |= thread_mask;
- for(j=0; j<4; j++) - { - CACHE_DESCRIPTOR cache; - ULONG_PTR mask = 0; - - sprintf(name, cache_info, i, j, "shared_cpu_map"); - if(!sysfs_parse_bitmap(name, &mask)) continue; - - sprintf(name, cache_info, i, j, "level"); - f = fopen(name, "r"); - if(!f) continue; - fscanf(f, "%u", &r); - fclose(f); - cache.Level = r; - - sprintf(name, cache_info, i, j, "ways_of_associativity"); - f = fopen(name, "r"); - if(!f) continue; - fscanf(f, "%u", &r); - fclose(f); - cache.Associativity = r; - - sprintf(name, cache_info, i, j, "coherency_line_size"); - f = fopen(name, "r"); - if(!f) continue; - fscanf(f, "%u", &r); - fclose(f); - cache.LineSize = r; + if(relation == RelationAll || relation == RelationProcessorCore) + { + sprintf(name, core_info, i, "thread_siblings_list"); + f = fopen(name, "r"); + if(f) + { + fscanf(f, "%d%c", &phys_core, &op); + fclose(f); + } + else phys_core = i;
- sprintf(name, cache_info, i, j, "size"); - f = fopen(name, "r"); - if(!f) continue; - fscanf(f, "%u%c", &r, &op); - fclose(f); - if(op != 'K') - WARN("unknown cache size %u%c\n", r, op); - cache.Size = (op=='K' ? r*1024 : r); - - sprintf(name, cache_info, i, j, "type"); - f = fopen(name, "r"); - if(!f) continue; - fscanf(f, "%s", name); - fclose(f); - if(!memcmp(name, "Data", 5)) - cache.Type = CacheData; - else if(!memcmp(name, "Instruction", 11)) - cache.Type = CacheInstruction; - else - cache.Type = CacheUnified; + if(!logical_proc_info_add_by_id(data, dataex, &len, max_len, RelationProcessorCore, phys_core, thread_mask)) + { + fclose(fcpu_list); + return STATUS_NO_MEMORY; + } + } + }
- if(!logical_proc_info_add_cache(data, dataex, &len, max_len, mask, &cache)) + if (relation == RelationAll || relation == RelationCache) + { + for(j=0; j<4; j++) { - fclose(fcpu_list); - return STATUS_NO_MEMORY; + CACHE_DESCRIPTOR cache; + ULONG_PTR mask = 0; + + sprintf(name, cache_info, i, j, "shared_cpu_map"); + if(!sysfs_parse_bitmap(name, &mask)) continue; + + sprintf(name, cache_info, i, j, "level"); + f = fopen(name, "r"); + if(!f) continue; + fscanf(f, "%u", &r); + fclose(f); + cache.Level = r; + + sprintf(name, cache_info, i, j, "ways_of_associativity"); + f = fopen(name, "r"); + if(!f) continue; + fscanf(f, "%u", &r); + fclose(f); + cache.Associativity = r; + + sprintf(name, cache_info, i, j, "coherency_line_size"); + f = fopen(name, "r"); + if(!f) continue; + fscanf(f, "%u", &r); + fclose(f); + cache.LineSize = r; + + sprintf(name, cache_info, i, j, "size"); + f = fopen(name, "r"); + if(!f) continue; + fscanf(f, "%u%c", &r, &op); + fclose(f); + if(op != 'K') + WARN("unknown cache size %u%c\n", r, op); + cache.Size = (op=='K' ? r*1024 : r); + + sprintf(name, cache_info, i, j, "type"); + f = fopen(name, "r"); + if(!f) continue; + fscanf(f, "%s", name); + fclose(f); + if(!memcmp(name, "Data", 5)) + cache.Type = CacheData; + else if(!memcmp(name, "Instruction", 11)) + cache.Type = CacheInstruction; + else + cache.Type = CacheUnified; + + if(!logical_proc_info_add_cache(data, dataex, &len, max_len, mask, &cache)) + { + fclose(fcpu_list); + return STATUS_NO_MEMORY; + } } } } } fclose(fcpu_list);
- if(data){ - for(i=0; i<len; i++){ - if((*data)[i].Relationship == RelationProcessorCore){ - all_cpus_mask |= (*data)[i].ProcessorMask; - } - } - }else{ - for(i = 0; i < len; ){ - SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *infoex = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *)(((char *)*dataex) + i); - if(infoex->Relationship == RelationProcessorCore){ - all_cpus_mask |= infoex->u.Processor.GroupMask[0].Mask; - } - i += infoex->Size; - } - } num_cpus = count_bits(all_cpus_mask);
- fnuma_list = fopen("/sys/devices/system/node/online", "r"); - if(!fnuma_list) + if(relation == RelationAll || relation == RelationNumaNode) { - if(!logical_proc_info_add_numa_node(data, dataex, &len, max_len, all_cpus_mask, 0)) - return STATUS_NO_MEMORY; - } - else - { - while(!feof(fnuma_list)) + fnuma_list = fopen("/sys/devices/system/node/online", "r"); + if(!fnuma_list) { - if(!fscanf(fnuma_list, "%u%c ", &beg, &op)) - break; - if(op == '-') fscanf(fnuma_list, "%u%c ", &end, &op); - else end = beg; - - for(i=beg; i<=end; i++) + if(!logical_proc_info_add_numa_node(data, dataex, &len, max_len, all_cpus_mask, 0)) + return STATUS_NO_MEMORY; + } + else + { + while(!feof(fnuma_list)) { - ULONG_PTR mask = 0; + if(!fscanf(fnuma_list, "%u%c ", &beg, &op)) + break; + if(op == '-') fscanf(fnuma_list, "%u%c ", &end, &op); + else end = beg;
- sprintf(name, numa_info, i); - f = fopen(name, "r"); - if(!f) continue; - while(!feof(f)) + for(i=beg; i<=end; i++) { - if(!fscanf(f, "%x%c ", &r, &op)) - break; - mask = (sizeof(ULONG_PTR)>sizeof(int) ? mask<<(8*sizeof(DWORD)) : 0) + r; - } - fclose(f); + ULONG_PTR mask = 0;
- if(!logical_proc_info_add_numa_node(data, dataex, &len, max_len, mask, i)) - { - fclose(fnuma_list); - return STATUS_NO_MEMORY; + sprintf(name, numa_info, i); + f = fopen(name, "r"); + if(!f) continue; + while(!feof(f)) + { + if(!fscanf(f, "%x%c ", &r, &op)) + break; + mask = (sizeof(ULONG_PTR)>sizeof(int) ? mask<<(8*sizeof(DWORD)) : 0) + r; + } + fclose(f); + + if(!logical_proc_info_add_numa_node(data, dataex, &len, max_len, mask, i)) + { + fclose(fnuma_list); + return STATUS_NO_MEMORY; + } } } + fclose(fnuma_list); } - fclose(fnuma_list); }
- if(dataex) + if(dataex && (relation == RelationAll || relation == RelationGroup)) logical_proc_info_add_group(dataex, &len, max_len, num_cpus, all_cpus_mask);
if(data)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=60829
Your paranoid android.
=== wxppro (task log) ===
Task errors: The task timed out
=== debian10 (32 bit report) ===
ntdll: info.c:880: Test failed: Expected 0x0, got 0x3 info.c:897: Test failed: Expected 0x1, got 0x3 info.c:914: Test failed: Expected 0x2, got 0x3 info.c:931: Test failed: Expected 0x3, got 0x0 info.c:948: Test failed: Expected 0x4, got 0x3 info.c:955: Test failed: Expected 0x518, got 0x1978
=== debian10 (32 bit French report) ===
ntdll: info.c:880: Test failed: Expected 0x0, got 0x3 info.c:897: Test failed: Expected 0x1, got 0x3 info.c:914: Test failed: Expected 0x2, got 0x3 info.c:931: Test failed: Expected 0x3, got 0x0 info.c:948: Test failed: Expected 0x4, got 0x3 info.c:955: Test failed: Expected 0x518, got 0x1978
=== debian10 (32 bit Japanese:Japan report) ===
ntdll: info.c:880: Test failed: Expected 0x0, got 0x3 info.c:897: Test failed: Expected 0x1, got 0x3 info.c:914: Test failed: Expected 0x2, got 0x3 info.c:931: Test failed: Expected 0x3, got 0x0 info.c:948: Test failed: Expected 0x4, got 0x3 info.c:955: Test failed: Expected 0x518, got 0x1978
=== debian10 (32 bit Chinese:China report) ===
ntdll: info.c:880: Test failed: Expected 0x0, got 0x3 info.c:897: Test failed: Expected 0x1, got 0x3 info.c:914: Test failed: Expected 0x2, got 0x3 info.c:931: Test failed: Expected 0x3, got 0x0 info.c:948: Test failed: Expected 0x4, got 0x3 info.c:955: Test failed: Expected 0x518, got 0x1978
=== debian10 (32 bit WoW report) ===
ntdll: info.c:880: Test failed: Expected 0x0, got 0x3 info.c:897: Test failed: Expected 0x1, got 0x3 info.c:914: Test failed: Expected 0x2, got 0x3 info.c:931: Test failed: Expected 0x3, got 0x0 info.c:948: Test failed: Expected 0x4, got 0x3 info.c:955: Test failed: Expected 0x518, got 0x1978
=== debian10 (64 bit WoW report) ===
ntdll: info.c:880: Test failed: Expected 0x0, got 0x3 info.c:897: Test failed: Expected 0x1, got 0x3 info.c:914: Test failed: Expected 0x2, got 0x3 info.c:931: Test failed: Expected 0x3, got 0x0 info.c:948: Test failed: Expected 0x4, got 0x3 info.c:955: Test failed: Expected 0x518, got 0x1978