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

net: Use counters for event counters, count errors #1637

Merged
merged 9 commits into from
Mar 21, 2024
Merged

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Feb 28, 2024

Currently, the net task has some hand-implemented event counters.
Although these are simple and efficient, they don't match the format
that humility counters will look for when finding counters in a dump,
so they can't be queried using that command. Instead, they have to be
inspected using a series of humility readvar commands. This branch,
therefore, replaces the hand-written counters with the counters crate,
allowing the net task's event counters to be understood by humility counters.

Additionally, I've added counters to the ringbufs in some of the BSP
modules (currently, only Gimletlet actually has ringbufs). For these, we
skip counting the various status and control register ringbuf entries
because they don't really seem to represent a countable event, just the
state of a register, and skipping all of them lets us avoid several
words of counters. Instead, we just count the number of error event
variants.

task/net/src/bsp/gimletlet_mgmt.rs Show resolved Hide resolved
task/net/src/main.rs Show resolved Hide resolved
@hawkw hawkw requested review from cbiffle and mkeeter March 21, 2024 18:55
@hawkw hawkw changed the title Eliza/net counters net: Use counters for event counters, count errors Mar 21, 2024
@hawkw hawkw marked this pull request as ready for review March 21, 2024 18:55
hawkw added a commit that referenced this pull request Mar 21, 2024
Depends on #1637

Now that the `vsc-err` types have `Count` implementations (as of #1637),
I thought it might be worthwhile to add counters to the
`monorail-server` ring bufs. This is especially nice because the one in
`main` only has two entries, and it seems worthwhile to be able to get a
total count of errors that have been observed.
task/net/src/bsp/gimletlet_mgmt.rs Show resolved Hide resolved
task/net/src/main.rs Show resolved Hide resolved
@@ -25,7 +25,7 @@ request_reset = ["hiffy"]
name = "drv-stm32xx-sys"
features = ["h753"]
priority = 1
max-sizes = {flash = 2048, ram = 1024}
max-sizes = {flash = 2048, ram = 2048}
Copy link
Collaborator

Choose a reason for hiding this comment

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

what happened here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I suspect app-mgmt.toml was broken, because it's not checked by CI

Copy link
Member Author

Choose a reason for hiding this comment

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

We apparently don't actually build this task on CI, so it had, yet again, bitrotted. Since I had modified the Gimletlet net tasks, I wanted to make sure I hadn't made the net task too big for any of the Gimletlet apps, and had to fix this in order to verify that.

Happy to back out the change, because it is, admittedly, unrelated to the diff.

@hawkw hawkw requested review from cbiffle and mkeeter March 21, 2024 20:44
@hawkw hawkw merged commit 6303792 into master Mar 21, 2024
103 checks passed
hawkw added a commit that referenced this pull request Mar 21, 2024
Depends on #1637

Now that the `vsc-err` types have `Count` implementations (as of #1637),
I thought it might be worthwhile to add counters to the
`monorail-server` ring bufs. This is especially nice because the one in
`main` only has two entries, and it seems worthwhile to be able to get a
total count of errors that have been observed.
lzrd pushed a commit that referenced this pull request Mar 26, 2024
Currently, the `net` task has some hand-implemented event counters.
Although these are simple and efficient, they don't match the format
that `humility counters` will look for when finding counters in a dump,
so they can't be queried using that command. Instead, they have to be
inspected using a series of `humility readvar` commands. This branch,
therefore, replaces the hand-written counters with the `counters` crate,
allowing the `net` task's event counters to be understood by `humility
counters`.

Additionally, I've added counters to the ringbufs in some of the BSP
modules (currently, only Gimletlet actually has ringbufs). For these, we
skip counting the various status and control register ringbuf entries
because they don't really seem to represent a countable event, just the
state of a register, and skipping all of them lets us avoid several
words of counters. Instead, we just count the number of error event
variants.
lzrd pushed a commit that referenced this pull request Mar 26, 2024
Depends on #1637

Now that the `vsc-err` types have `Count` implementations (as of #1637),
I thought it might be worthwhile to add counters to the
`monorail-server` ring bufs. This is especially nice because the one in
`main` only has two entries, and it seems worthwhile to be able to get a
total count of errors that have been observed.
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.

3 participants