Git Product home page Git Product logo

ebpf-tools's People

Contributors

kfl avatar korreman avatar matildebroloes avatar spaarmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ebpf-tools's Issues

Extend the AST and concrete syntax with support for annotations

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

export to ELF64

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".

Add support for LLVM-style syntax

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.

Setup CI

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.

Types of Helper are wrong??

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.