google / buzzer

Apache License 2.0
429 stars 32 forks source link

Create a proto with the representation of ebpf instructions #46

Closed thatjiaozi closed 6 months ago

thatjiaozi commented 6 months ago

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.