oxidecomputer / humility

Debugger for Hubris
Mozilla Public License 2.0
526 stars 50 forks source link

counters: small UX fixes & tweaks #474

Closed hawkw closed 5 months ago

hawkw commented 5 months ago

Some of the help text for the humility counters and humility counters ipc commands is subtly wrong: it suggests using the -l flag to list all available counters, but that flag was changed to a subcommand in

454. This commit updates the help text to reflect that, so that we no

longer tell users to try a flag that doesn't exist.

before:

$ export HUMILITY_DUMP=tests/cmd/cores/hubris.core.counters.0
$ humility counters blah
humility: attached to dump
humility counters failed: no counters found with names containing "blah" (-l to list)

$ humility counters ipc blah
humility: attached to dump
humility counters failed: no IPC counters found with names containing "blah" (-l to list)

$ humility counters -l
error: Found argument '-l' which wasn't expected, or isn't valid in this context

        If you tried to supply `-l` as a value rather than a flag, use `-- -l`

USAGE:
    humility counters [OPTIONS] [NAME]
    humility counters <SUBCOMMAND>

For more information try --help

after:


$ export HUMILITY_DUMP=tests/cmd/cores/hubris.core.counters.0
$ humility counters blah
humility: attached to dump
humility counters failed: no counters found with names containing "blah"
hint: use `humility counters list` to list all available counters

$ humility counters ipc blah
humility: attached to dump
humility counters failed: no IPC counters found with names containing "blah"
hint: use `humility counters list` to list all available counters
hint: use `--client` to filter IPCs by client task name

$ humility counters list
humility: attached to dump
control_plane_agent:
    ADDR        SIZE VARIABLE
    0x2402b938   664 task_control_plane_agent::CRITICAL
    0x24029000  1272 task_control_plane_agent::__RINGBUF
gimlet_inspector:
    ADDR        SIZE VARIABLE
    0x2404ce40    12 task_gimlet_inspector::__COUNTERS
gimlet_seq:
    ADDR        SIZE VARIABLE
    0x2403f424    48 drv_gimlet_seq_server::IPC_REQUESTS
    0x2403e640  3448 drv_gimlet_seq_server::__RINGBUF
thermal:
    ADDR        SIZE VARIABLE
    0x240039e0   912 task_thermal::__RINGBUF

While I was messing with stuff, I also added ANSI formatting to a few things in the humility counters output