Skip to content

Commit ffd209f

Browse files
committed
hwloc/shmem: dump /proc/self/maps if failed to find a hole and verbosity > 4
Signed-off-by: Brice Goglin <[email protected]>
1 parent baf762d commit ffd209f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

opal/mca/hwloc/base/hwloc_base_util.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,22 @@ int opal_hwloc_base_get_topology(void)
310310
free(shmemfile);
311311
if (0 != hwloc_shmem_topology_adopt(&opal_hwloc_topology, fd,
312312
0, (void*)addr, size, 0)) {
313+
if (4 < opal_output_get_verbosity(opal_hwloc_base_framework.framework_output)) {
314+
FILE *file = fopen("/proc/self/maps", "r");
315+
if (file) {
316+
char line[256];
317+
opal_output(0, opal_hwloc_base_framework.framework_output,
318+
"Dumping /proc/self/maps");
319+
while (fgets(line, sizeof(line), file) != NULL) {
320+
char *end = strchr(line, '\n');
321+
if (end)
322+
*end = '\0';
323+
opal_output(0, opal_hwloc_base_framework.framework_output,
324+
"%s", line);
325+
}
326+
fclose(file);
327+
}
328+
}
313329
OPAL_ERROR_LOG(OPAL_ERR_FILE_READ_FAILURE);
314330
return OPAL_ERR_FILE_READ_FAILURE;
315331
}

0 commit comments

Comments
 (0)