kfl / ebpf-tools Goto Github PK
View Code? Open in Web Editor NEWExperiments with eBPF bytecode
License: MIT License
Experiments with eBPF bytecode
License: MIT License
Test that uBPF can run the code we produce.
The Instruction
type in Ebpf.Asm
with an annotation construction. For instance:
data Instruction =
...
| Annotation String
Alternatively Instruction
could be parameterised with the kind of annotations:
data Instruction anno =
...
| Annotation anno
Likewise the concrete syntax should support annotations. For instance by using the prefix ;;*
:
; a normal comment
;;* an annotation comment
;;* assume { r1 != 0 }
add r0 r1
exit
Implement exporting an assembled eBPF bytecode program to an ELF object, similar to e.g. clang -target bpf someProgram -o someProgram.o
.
This would allow us to use tools like bpftool
to load programs as well as dump both their xlated and JIT'ed versions.
It might be useful for asserting correctness in ebpf-tools, as well as making it easier to use ebpf-tools with projects like the PREVAIL-verifier and uBPF. (Although uBPF accepts non-ELF raw bytecode).
I am unsure of the extent of this proposal, but I am quite certain it amounts to more than "wrap the bytecode in a header".
LLVM has chosen an unconventional syntax for their eBPF assembly syntax. And this style is also used for output by, for instance, bpftool
. Thus it makes sense to support this syntax both as input and output.
Add support for labels in the assembly format.
Complete the Decode
module, and extend the CLI with a disassembly command.
The are too many eBPF assembly syntaxes (see also #8).
We should follow uBPF's lead and match GCC's assembly format iovisor/ubpf#250
%
.Now that we have a working test-suite, we should set up CI so that every commit is tested.
We should probably use the Test supported GHC versions action or something like that, so that we can catch unintentional regressions in supported GHC versions.
I Started using the Helpers module and noticed for 64-Bit they are defined as such:
add64_i :: Reg -> Imm32 -> Instruction
add64_i dst imm = Binary B64 Add dst (Right $ fromIntegral imm)
should it not be:
add64_i :: Reg -> Imm64 -> Instruction
Or have i misunderstood something?
Add at least some sort minimal test suite.
Currently the level of "testing" is eyeballing the binary output.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.