-
Notifications
You must be signed in to change notification settings - Fork 163
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
integrate Idol-generated API client counters #1642
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is now obviated by the new autogenerated counters.
this way, it can be toggled in app.toml
cbiffle
approved these changes
Mar 8, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed the mechanical parts of this change mostly by shape, so if you've e.g. swapped the IDL file paths between two build.rses, I am unlikely to have noticed.
With that caveat, this looks good.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As of oxidecomputer/idolatry#43, Idol code-generation has grown the
ability to automatically generate counters of IPC operations when
generating client and server stubs. This branch integrates this feature
with Hubris' existing IPC APIs.
Idolatry codegen is capable of generating counters in both IPC client
stubs and server stubs. This branch enables client-side counter
generation only, because after experimenting with this feature, I've
realized that generating counters on the client side lets us do
substantially more interesting things with IPC count data: we can break
down the total number of IPC requests by client, without requiring
complex dynamic tracking of client IDs in the server task. Instead, when
clients count their IPC requests, each client has its own version of the
counters. We can sum them to determine the total number of IPCs, but we
can also break them down per-client very easily, because...they're
already broken down per-client.
Because counting IPC operations and their return values requires a bit
of RAM in each client task, I've exposed it as a feature flag in the
client tasks, so it can be enabled or disabled in an
app.toml
, ratherthan in the client task's dependency on the API crate. This way, the
boards with more RAM can enable counters, but we can leave them disabled
in the small demo apps. This feature flag controls whether
idol
generates the counters or not, so adding feature flags to the client
tasks required some of them to add their own build deps on
idol
toenable the feature.
All the counters added in this branch can be read using the existing
humility counters
command. An upcoming Humility PR will also add ahumility counters --ipc
option, for grouping counters by IPC interfacerather than displaying each client's IPC counters separately.
Here's an example of the cool new
humility counters --ipc
command(coming soon to a Humility near you!), from a Gimlet
rev-c-lab
dump:And, some longer samples of humility output, hidden for conciseness:
`humility counters --list`
`humility counters __SYS_CLIENT_COUNTERS`
`humility counters --ipc`
`humility counters --ipc --full sys_api