Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

humility ringbuf list table is misaligned when a ringbuf has a long path #448

Open
hawkw opened this issue Feb 22, 2024 · 0 comments
Open

Comments

@hawkw
Copy link
Member

hawkw commented Feb 22, 2024

If the path to a ringbuf is longer than 30 characters, the ADDR and SIZE columns in the table printed by humility ringbuf list aren't aligned nicely. And, it turns out that when building Humility for a Gimlet, there are several ringbufs with paths longer than 30 characters:

eliza@cadbury ~ $ pfexec humility -t c71 ringbuf --list
humility: attached to 0483:3754:001100184741500820383733 via ST-Link V3
MODULE             BUFFER                         ADDR       SIZE
gimlet_seq         drv_gimlet_seq_server::__RINGBUF 0x2403e640 3088
power              drv_i2c_devices::adm1272::__RINGBUF 0x2403d500 652
thermal            drv_i2c_devices::max31790::__RINGBUF 0x24003770 84
sbrmi              drv_i2c_devices::sbrmi::__RINGBUF 0x2404d4ec 252
gimlet_seq         drv_oxide_vpd::__RINGBUF       0x2403f250 108
host_sp_comms      drv_oxide_vpd::__RINGBUF       0x24021ab0 108
gimlet_seq         drv_packrat_vpd_loader::__RINGBUF 0x2403f2bc 588
sbrmi              drv_sbrmi::__RINGBUF           0x2404d320 460
spi2_driver        drv_stm32h7_spi_server_core::__RINGBUF 0x24048368 1036
sprot              drv_stm32h7_spi_server_core::__RINGBUF 0x24034000 1036
sprot              drv_stm32h7_sprot_server::__RINGBUF 0x2403440c 1804
i2c_driver         drv_stm32xx_i2c::__RINGBUF     0x24049bb4 780
spd                drv_stm32xx_i2c::__RINGBUF     0x2404a48c 780
i2c_driver         drv_stm32xx_i2c_server::__RINGBUF 0x24049380 2100
net                ksz8463::__RINGBUF             0x24019628 268
host_sp_comms      ksz8463::__RINGBUF             0x24027c9c 268
update_server      stm32h7_update_server::__RINGBUF 0x24045800 1036
control_plane_agent task_control_plane_agent::CRITICAL 0x2402b850 656
control_plane_agent task_control_plane_agent::__RINGBUF 0x24029000 1040
control_plane_agent task_control_plane_agent::update::rot::__RINGBUF 0x2402b244 1548
dump_agent         task_dump_agent::__RINGBUF     0x24038960 60
dump_agent         task_dump_agent::udp::__RINGBUF 0x240389a0 528
hiffy              task_hiffy::stm32h7::__RINGBUF 0x24008408 1548
host_sp_comms      task_host_sp_comms::__RINGBUF  0x24021000 2736
jefe               task_jefe::dump::__RINGBUF     0x2404c600 236
jefe               task_jefe::external::__RINGBUF 0x2404c6ec 60
net                task_net::mgmt::__RINGBUF      0x24012158 528
packrat            task_packrat::__RINGBUF        0x24006380 656
power              task_power::__RINGBUF          0x2403c9c8 44
power              task_power::bsp::__RINGBUF     0x2403c9f4 2828
spd                task_spd::__RINGBUF            0x2404a380 268
thermal            task_thermal::__RINGBUF        0x240039e0 784
validate           task_validate::__RINGBUF       0x240443e8 1036
net                vsc85xx::__RINGBUF             0x240197b4 204

Humility version:

eliza@cadbury ~ $ pfexec humility --version
humility 0.10.38

My guess is that the current lengths of these columns was selected to fit nicely in an 80-column terminal, which makes sense. But, when there are long paths, it's hard to read regardless of the terminal, and making the terminal wider doesn't help. We probably want to default to the current lengths, but scan the ringbuf paths first to see if there's any entry that's too long, and make it wider in that case?

Alternatively, since the address and size columns are almost always much shorter, we could just put them first, although I'll admit it's kinda weird to see the address and size without knowing what it is that you're looking at (as a right-to-left language reader)...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant