Closed lmb closed 2 years ago
See #537 for some discussion on what the default argument for input should be.
RunOptions should also include Reset
, so that program interruption can be handled by the caller.
Run(RunOptions)
sounds reasonable to me. Adding a reset callback also sounds good. Just lmk on #647 and I'll send an update
This is now in master!
Some recent kernel version introduced
BPF_PROG_RUN
. It's just an alias forBPF_PROG_TEST_RUN
but it shows that upstream considers RUN to be a basic primitive on programs. Another thing that has become apparent is that the input required by different types of programs differs wildly.Instead of
TestWithContext
I would add a methodProgram.Run(RunOptions) (RunResult, error)
. Names TBD.RunOptions
contains all the possible fields likeData
,Context
, etc. RunResult contains data output, context output, etc.Test
andBenchmark
keep the same API but are wrappers aroundRun
.cc @ti-mo
Originally posted by @lmb in https://github.com/cilium/ebpf/pull/511#pullrequestreview-823817507