Skip to content

Commit 75e01ef

Browse files
committed
pci: add a Backend info attr
Only if adding objects, not if annotating with names. Signed-off-by: Brice Goglin <[email protected]>
1 parent 41e7d36 commit 75e01ef

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

hwloc/topology-pci.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ hwloc_look_pci(struct hwloc_backend *backend, struct hwloc_disc_status *dstatus)
141141
struct hwloc_topology *topology = backend->topology;
142142
enum hwloc_type_filter_e pfilter, bfilter;
143143
struct hwloc_obj *tree = NULL;
144+
unsigned added = 0;
144145
int ret;
145146
struct pci_device_iterator *iter;
146147
struct pci_device *pcidev;
@@ -362,6 +363,7 @@ hwloc_look_pci(struct hwloc_backend *backend, struct hwloc_disc_status *dstatus)
362363

363364
hwloc_pci_get_obj_names(obj, &m);
364365
hwloc_pcidisc_tree_insert_by_busid(&tree, obj);
366+
added++;
365367
}
366368

367369
/* finalize device scanning */
@@ -375,6 +377,9 @@ hwloc_look_pci(struct hwloc_backend *backend, struct hwloc_disc_status *dstatus)
375377
dstatus->excluded_phases |= HWLOC_DISC_PHASE_PCI;
376378
/* no need to run the annotate phase, we did it above */
377379
backend->phases &= HWLOC_DISC_PHASE_ANNOTATE;
380+
381+
if (added)
382+
hwloc_obj_add_info(hwloc_get_root_obj(topology), "Backend", "PCI");
378383
return 0;
379384
}
380385

0 commit comments

Comments
 (0)