static void print_children(topo_topology_t topology, topo_obj_t obj, int depth) { char string[128]; int i; topo_obj_snprintf(string, sizeof(string), topology, obj, "#", 0); printf("%*s%s\n", 2 * depth, "", string); for (i = 0; i < obj->arity; i++) print_children(topology, obj->children[i], depth + 1); }
/* Just for debugging. */ static void print_objects(struct topo_topology *topology, int indent, topo_obj_t obj) { char line[TOPO_CPUSET_STRING_LENGTH+1]; topo_debug("%*s", 2*indent, ""); topo_obj_snprintf(line, sizeof(line), topology, obj, "#", 1); topo_debug("%s", line); topo_cpuset_snprintf(line, sizeof(line), &obj->cpuset); topo_debug(" %s", line); if (obj->arity) topo_debug(" arity %d", obj->arity); topo_debug("\n"); for (obj = obj->first_child; obj; obj = obj->next_sibling) print_objects(topology, indent + 1, obj); }