Le 21/11/2010 08:22, Christopher Samuel a écrit :
> > Then reconfigure with --enable-debug and send the whole
> > stdout/stderr of "HWLOC_FSROOT=/tmp/sles10sp1-ppc64 lstopo"
>
> OK, here's both a good run and a bad run for you to compare.

It looks like it's using /proc/cpuinfo instead of /sys. It may be a
problem with accessat. Could you apply the attached debug patch and
rerun the above command line?

Brice

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");
     }

Reply via email to