diff --git a/src/topology-linux.c b/src/topology-linux.c index 9cdc82a..35af9ea 100644 --- a/src/topology-linux.c +++ b/src/topology-linux.c @@ -224,7 +224,15 @@ static inline int hwloc_access(const char *p, int m, int d __hwloc_attribute_unused) { #ifdef HAVE_OPENAT - return hwloc_accessat(p, m, d); +int err; +fprintf(stderr, "#### using hwloc_accessat\n"); +err = hwloc_accessat(p, m, d); +if (err < 0) + fprintf(stderr, "#### hwloc_accessat failed %m\n"); +else + fprintf(stderr, "#### hwloc_accessat success\n"); +return err; +// return hwloc_accessat(p, m, d); #else return access(p, m); #endif @@ -2641,8 +2649,10 @@ hwloc_look_linux(struct hwloc_topology *topology) } /* Gather the list of cpus now */ +fprintf(stderr, "#### use cpuinfo or sysfs?\n"); if (getenv("HWLOC_LINUX_USE_CPUINFO") || hwloc_access("/sys/devices/system/cpu/cpu0/topology", R_OK, topology->backend_params.sysfs.root_fd) < 0) { +fprintf(stderr, "#### using cpuinfo\n"); /* revert to reading cpuinfo only if /sys/.../topology unavailable (before 2.6.16) */ err = look_cpuinfo(topology, "/proc/cpuinfo", topology->levels[0][0]->online_cpuset); if (err < 0) { @@ -2654,6 +2664,7 @@ hwloc_look_linux(struct hwloc_topology *topology) hwloc_setup_pu_level(topology, 1); } } else { +fprintf(stderr, "#### using sysfs\n"); look_sysfscpu(topology, "/sys/devices/system/cpu"); }