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

features: centralize error semantics, remove maxMiscType, etc. #571

Merged
merged 5 commits into from Feb 17, 2022

Conversation

ti-mo
Copy link
Collaborator

@ti-mo ti-mo commented Feb 16, 2022

Best reviewed per commit.

These are some changes I'd liked to see in #541, but did not have the bandwidth to review at the time. apologies.

The function documentation was getting a bit repetitive to my liking, I think it fits better in the package doc, with any exceptions (currently none) documented on the function in question.

I don't feel very strongly about ErrUnsatisfiedProgramReference, but it's potentially confusing during troubleshooting, so IMO it's better to be specific.

As this function is a relatively lean wrapper around setting ins.Offset
and doesn't do any particular sanity checking to see if e.g. the offset
is within bounds, it's not clear what benefit this provides being part
of the exported API.

As its only use is within the test suite where the instruction stream
is known up front, remove the function for now.

Signed-off-by: Timo Beckers <timo@isovalent.com>
As miscTypes cannot be specified by the caller, there's no strong reason
to input check these arguments. Calls to createMiscProbeAttr() will fail
when the miscTyps is not implemented anyway.

Signed-off-by: Timo Beckers <timo@isovalent.com>
Signed-off-by: Timo Beckers <timo@isovalent.com>
The error string was changed when it was exported in cilium#541 and is potentially
ambiguous.

Signed-off-by: Timo Beckers <timo@isovalent.com>
@ti-mo ti-mo requested a review from florianl February 16, 2022 15:05
asm/instruction.go Outdated Show resolved Hide resolved
I keep reading the switch in FixupReferences wrong: I always assume that
any instruction with a reference will trigger the unsatisfied reference
error. This isn't the case since only the program reference switch cases
execute a break.

Make the whole thing easier to understand by copying the error message
into two places.
@ti-mo ti-mo merged commit 62da0a7 into cilium:master Feb 17, 2022
@ti-mo ti-mo deleted the tb/misc-probes-feedback branch February 17, 2022 14:18
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.

None yet

2 participants