The current way to represent ebpf instructions is hard to work with.
The initial abstraction layer where we made a distinction between imm and reg instructions makes it confusing when adding new operations. There is a lot of room for mistakes and it would make it easy if we condense everything into a single representation of instructions.
I was originally going to create a new struct in go but then I realized we get a lot of things for free if we use a proto, hence why I decided to go down this route.
The next step is replace all the structures we have for encoding/representing ebpf instructions for the proto generated ones. That one will be a long PR so I will send it in a separate patch.
The current way to represent ebpf instructions is hard to work with.
The initial abstraction layer where we made a distinction between imm and reg instructions makes it confusing when adding new operations. There is a lot of room for mistakes and it would make it easy if we condense everything into a single representation of instructions.
I was originally going to create a new struct in go but then I realized we get a lot of things for free if we use a proto, hence why I decided to go down this route.
The next step is replace all the structures we have for encoding/representing ebpf instructions for the proto generated ones. That one will be a long PR so I will send it in a separate patch.