diff --git a/src/arm/midr.c b/src/arm/midr.c index a04f664..3318909 100644 --- a/src/arm/midr.c +++ b/src/arm/midr.c @@ -431,6 +431,8 @@ struct cpuInfo* get_cpu_info(void) { struct cpuInfo* cpu = malloc(sizeof(struct cpuInfo)); init_cpu_info(cpu); + test_thread_siblings_list(); + #ifdef __linux__ return get_cpu_info_linux(cpu); #elif defined __APPLE__ || __MACH__ diff --git a/src/common/udev.c b/src/common/udev.c index 953ae71..ff028d8 100644 --- a/src/common/udev.c +++ b/src/common/udev.c @@ -315,6 +315,24 @@ int get_num_caches_by_level(struct cpuInfo* cpu, uint32_t level) { return ret; } +// Just to check what is going on with missing thread_siblings_list +void test_thread_siblings_list(void) { + int num_cores = 12; + int filelen; + char* buf = NULL; + + for(int i=0; i < num_cores; i++) { + char* path = ecalloc(500, sizeof(char)); + sprintf(path, "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", i); + + if((buf = read_file(path, &filelen)) == NULL) { + printf("Could not open '%s'", path); + } + + printf("%s: %s\n", path, buf); + } +} + int get_num_sockets_package_cpus(struct topology* topo) { // Get number of sockets using // /sys/devices/system/cpu/cpu*/topology/package_cpus diff --git a/src/common/udev.h b/src/common/udev.h index f2c4c2e..142b4bd 100644 --- a/src/common/udev.h +++ b/src/common/udev.h @@ -43,5 +43,6 @@ int get_num_sockets_package_cpus(struct topology* topo); int get_ncores_from_cpuinfo(void); char* get_field_from_cpuinfo(char* CPUINFO_FIELD); bool is_devtree_compatible(char* str); +void test_thread_siblings_list(void); #endif