]> xenbits.xensource.com Git - people/andrewcoop/hwloc.git/commitdiff
hwloc-ps: don't report locations as caches unless there is nothing equivalent
authorBrice Goglin <Brice.Goglin@inria.fr>
Wed, 18 Dec 2013 19:46:03 +0000 (20:46 +0100)
committerBrice Goglin <Brice.Goglin@inria.fr>
Wed, 18 Dec 2013 19:53:49 +0000 (20:53 +0100)
We report the higher object matching the binding.
Go down if it's a cache that has a single identical child.

NEWS
utils/hwloc-ps.c

diff --git a/NEWS b/NEWS
index eb70283f756798de1bb3b77985b816b41b3d5c1a..eec10eaaa4ebbbc81c50a520234a3b8bf2c43ea4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,8 @@ Version 1.9.0
 * Tools
   + Add -e or --get-last-cpu-location to hwloc-ps to report where
     processes/threads run instead of where they are bound.
+  + hwloc-ps reports locations as likely-more-useful objects such as Cores
+    or Sockets instead of Caches when possible.
   + Add -e as a synonym to --get-last-cpu-location in hwloc-bind.
 
 
index 42f3d090a095775f87b0692e563cef121c467599..6c3fe502f6a849a9ef43b20af95b93dec8e2e719 100644 (file)
@@ -58,6 +58,9 @@ static void print_task(hwloc_topology_t topology,
       char type[64];
       unsigned idx;
       hwloc_obj_t obj = hwloc_get_first_largest_obj_inside_cpuset(topology, remaining);
+      /* don't show a cache if there's something equivalent and nicer */
+      while (obj->type == HWLOC_OBJ_CACHE && obj->arity == 1)
+       obj = obj->first_child;
       hwloc_obj_type_snprintf(type, sizeof(type), obj, 1);
       idx = logical ? obj->logical_index : obj->os_index;
       if (idx == (unsigned) -1)