Replies: 1 comment 4 replies
-
I'd be open to it, we just need to figure out a good API for both successful (Program.VerifierLog) and unsuccessful (VerifierError) cases. A VerifierStats struct could be embedded into VerifierError. For Program, I'm not sure what to do. The VerifierLog field is kind of a one-off; all other functionality like prog info is behind methods. I'd probably choose the same approach today, e.g. an unexported Alternatively, we might want to opt for Also, I'd take a more defensive and granular approach to the parsing itself, for example:
.. etc., so that when things do change (likely adding things at the end or in the middle), we degrade gracefully and still provide some useful output. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
With
ebpf.LogLevelStats
the verifier outputs stats about the verification process. It would be nice to have a parser that provides the metrics as a dedicated data structure.Up to now the format was quite stable. Although it was introduced with the note that "the format is expected to change in the future", it hasn't changed since it was added. Even if it changes in the future, it would be possible to support multiple formats.
The kernel bpf selftests have a parser for those stats. It would be easy to adapt it: a separate helper function that takes a verifier log string and outputs a dedicated stats data structure.
Would you be open to accept a PR for such a verifier stats parser? If so, where would be the best place for it? Should it be added to
prog.go
?Beta Was this translation helpful? Give feedback.
All reactions