Skip to content

Commit

Permalink
lstopo/draw: better place the PCI linkspeed
Browse files Browse the repository at this point in the history
The previous value (3) is fairly close to the object on the right.
2 would be too close to the vertical bar on the left.
Use 2.5 instead.

The ascii output might have to round that down to 2,
but that output doesn't have such issues anyway since characters are well separated.

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Oct 24, 2018
1 parent f121096 commit 6edae19
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/lstopo/lstopo-draw.c
Expand Up @@ -1092,6 +1092,7 @@ bridge_draw(struct lstopo_output *loutput, hwloc_obj_t level, unsigned depth, un
struct lstopo_obj_userdata *lud = level->userdata;
unsigned gridsize = loutput->gridsize;
unsigned fontsize = loutput->fontsize;
/* align all children even if only some of them have a linkspeed */
unsigned speedwidth = loutput->show_text[HWLOC_OBJ_BRIDGE] ? fontsize + gridsize : 0;

if (loutput->drawing == LSTOPO_DRAWING_PREPARE) {
Expand Down Expand Up @@ -1132,7 +1133,7 @@ bridge_draw(struct lstopo_output *loutput, hwloc_obj_t level, unsigned depth, un
snprintf(text, sizeof(text), "%.0f", child->attr->pcidev.linkspeed);
else
snprintf(text, sizeof(text), "%0.1f", child->attr->pcidev.linkspeed);
methods->text(loutput, style.t2, fontsize, depth-1, x + 3*gridsize, ymid + BRIDGE_HEIGHT/2, text);
methods->text(loutput, style.t2, fontsize, depth-1, x + 2.5*gridsize, ymid + BRIDGE_HEIGHT/2, text);
}
}
}
Expand Down

0 comments on commit 6edae19

Please sign in to comment.