Skip to content

Commit 8f67418

Browse files
committed
lstopo/graphical: only print osdev storage|memory size once
PMEM OS devices had their Size printed both for Storage and Memory attrs. Signed-off-by: Brice Goglin <[email protected]>
1 parent 79e8321 commit 8f67418

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

utils/lstopo/lstopo-draw.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,8 +1341,8 @@ prepare_text(struct lstopo_output *loutput, hwloc_obj_t obj)
13411341
}
13421342

13431343
}
1344-
if (HWLOC_OBJ_OSDEV_STORAGE & obj->attr->osdev.type) {
1345-
/* Storage */
1344+
if ((HWLOC_OBJ_OSDEV_STORAGE|HWLOC_OBJ_OSDEV_MEMORY) & obj->attr->osdev.type) {
1345+
/* Storage or Memory size */
13461346
const char *value;
13471347
value = hwloc_obj_get_info_by_name(obj, "Size");
13481348
if (value) {
@@ -1351,14 +1351,11 @@ prepare_text(struct lstopo_output *loutput, hwloc_obj_t obj)
13511351
}
13521352

13531353
}
1354-
if (HWLOC_OBJ_OSDEV_MEMORY & obj->attr->osdev.type) {
1355-
/* Memory */
1354+
if (HWLOC_OBJ_OSDEV_MEMORY) {
1355+
/* Memory
1356+
* Size was printed above in STORAGE|MEMORY.
1357+
*/
13561358
const char *value;
1357-
value = hwloc_obj_get_info_by_name(obj, "Size");
1358-
if (value) {
1359-
unsigned long long bytes = strtoull(value, NULL, 10) * 1024;
1360-
hwloc_memory_size_snprintf(lud->text[lud->ntext++].text, sizeof(lud->text[0].text), bytes, loutput->obj_snprintf_flags);
1361-
}
13621359
value = hwloc_obj_get_info_by_name(obj, "CXLRAMSize");
13631360
if (value) {
13641361
unsigned long long bytes = strtoull(value, NULL, 10) * 1024;

0 commit comments

Comments
 (0)