Warn if some looms don't have the rank
Fallback to sorting by loom name instead.
This commit is contained in:
parent
bfff1a815e
commit
6eead7e28e
@ -482,22 +482,20 @@ init_offsets(struct system *sys, struct trace *trace)
|
|||||||
static int
|
static int
|
||||||
set_sort_criteria(struct system *sys)
|
set_sort_criteria(struct system *sys)
|
||||||
{
|
{
|
||||||
|
int some_have = 0;
|
||||||
|
int all_have = 1;
|
||||||
for (struct loom *l = sys->looms; l; l = l->next) {
|
for (struct loom *l = sys->looms; l; l = l->next) {
|
||||||
if (l->rank_enabled) {
|
if (l->rank_enabled)
|
||||||
sys->sort_by_rank = 1;
|
some_have = 1;
|
||||||
break;
|
else
|
||||||
}
|
all_have = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sys->sort_by_rank)
|
/* Only sort by rank if all looms have the rank information */
|
||||||
return 0;
|
if (all_have)
|
||||||
|
sys->sort_by_rank = 1;
|
||||||
for (struct loom *l = sys->looms; l; l = l->next) {
|
else if (some_have)
|
||||||
if (!l->rank_enabled) {
|
warn("missing rank in some looms, cannot sort CPUs by rank");
|
||||||
err("missing rank for loom %s", l->id);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user