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

counters: small UX fixes & tweaks #474

Merged
merged 3 commits into from
Apr 16, 2024
Merged

counters: small UX fixes & tweaks #474

merged 3 commits into from
Apr 16, 2024

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Apr 11, 2024

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

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:

```console
$ 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:

```console

$ 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
```
Copy link
Contributor

@mkeeter mkeeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small note, but otherwise looks good

@hawkw hawkw merged commit 6ef7feb into master Apr 16, 2024
11 checks passed
@hawkw hawkw deleted the eliza/typos branch April 16, 2024 19:44
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

Successfully merging this pull request may close these issues.

2 participants