google / buzzer

Apache License 2.0
411 stars 28 forks source link

Make eBPF program writing easier #23

Closed thatjiaozi closed 3 months ago

thatjiaozi commented 1 year ago

Currently, this pattern gets repeated often to write an ebpf program:

var root, ptr, next ebpf.EBPFOperation
root := ALUIMMOperation(...)
ptr = root

next := ...
ptr.SetNextInstruction(next)
ptr = next 

...

Ideally, programs should be built in a more readable and easier to write way, for example:


newEBPFSequence(
MOV64(R0, 0),
MOV64(R1, R0),
MUL64(R1, 10),
...
)
thatjiaozi commented 3 months ago

This has been implemented