summaryrefslogtreecommitdiffstats
path: root/ProcessList.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2020-08-26 10:15:00 +1000
committerNathan Scott <nathans@redhat.com>2020-08-26 10:39:43 +1000
commit728b04bbb5667291f1e56058240fcd7e03cbfe74 (patch)
treead199ce3a3303e723eb9332aa6cb847b9530084a /ProcessList.c
parentd0f31ede5624ed2f35ca25043f6a28adfe3bc171 (diff)
Merge branch 'ci-hwloc-job' of https://github.com/bertwesarg/htop into bertwesarg-ci-hwloc-job
Diffstat (limited to 'ProcessList.c')
-rw-r--r--ProcessList.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/ProcessList.c b/ProcessList.c
index edbc114c..36b494e2 100644
--- a/ProcessList.c
+++ b/ProcessList.c
@@ -93,12 +93,19 @@ ProcessList* ProcessList_init(ProcessList* this, ObjectClass* klass, UsersTable*
#ifdef HAVE_LIBHWLOC
this->topologyOk = false;
- int topoErr = hwloc_topology_init(&this->topology);
- if (topoErr == 0) {
- topoErr = hwloc_topology_load(this->topology);
- }
- if (topoErr == 0) {
- this->topologyOk = true;
+ if (hwloc_topology_init(&this->topology) == 0) {
+ this->topologyOk =
+ #if HWLOC_API_VERSION < 0x00020000
+ /* try to ignore the top-level machine object type */
+ 0 == hwloc_topology_ignore_type_keep_structure(this->topology, HWLOC_OBJ_MACHINE) &&
+ /* ignore caches, which don't add structure */
+ 0 == hwloc_topology_ignore_type_keep_structure(this->topology, HWLOC_OBJ_CORE) &&
+ 0 == hwloc_topology_ignore_type_keep_structure(this->topology, HWLOC_OBJ_CACHE) &&
+ 0 == hwloc_topology_set_flags(this->topology, HWLOC_TOPOLOGY_FLAG_WHOLE_SYSTEM) &&
+ #else
+ 0 == hwloc_topology_set_all_types_filter(this->topology, HWLOC_TYPE_FILTER_KEEP_STRUCTURE) &&
+ #endif
+ 0 == hwloc_topology_load(this->topology);
}
#endif

© 2014-2024 Faster IT GmbH | imprint | privacy policy