Skip to content

Commit

Permalink
lstopo/draw: display PCI linkspeed below bridge instead of above
Browse files Browse the repository at this point in the history
When above, it moves the bridge down, which means the PCI children
must be high enough to still touch the line coming from the bridge.
It would not work if there was a linespeed for the bridge but no
text shown for PCI devices (very small box).

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed May 3, 2018
1 parent a4a71fa commit afeaa99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/lstopo/lstopo-draw.c
Expand Up @@ -992,8 +992,8 @@ pci_device_draw(struct lstopo_output *loutput, hwloc_obj_t level, unsigned depth
}
}

/* bridge object height: linkspeed + a small empty box */
#define BRIDGE_HEIGHT (gridsize + fontsize + FONTGRIDSIZE)
/* bridge object height: small empty box */
#define BRIDGE_HEIGHT (gridsize)

static void
bridge_draw(struct lstopo_output *loutput, hwloc_obj_t level, unsigned depth, unsigned x, unsigned y)
Expand Down Expand Up @@ -1045,7 +1045,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 + 3*gridsize, ymid + BRIDGE_HEIGHT/2, text);
}
}
}
Expand Down

0 comments on commit afeaa99

Please sign in to comment.