GithubHelp home page GithubHelp logo

willfindlay / pybpf Goto Github PK

View Code? Open in Web Editor NEW
17.0 3.0 0.0 164 KB

An opinionated BPF CO-RE library for Python3. Targets easy deployment on embedded systems with minimal dependency overhead.

License: GNU Lesser General Public License v2.1

Makefile 0.27% Python 85.92% C 13.81%
ebpf bpf co-re linux linux-kernel python3 library libbpf embedded-systems

pybpf's Introduction

PyBPF ๐Ÿ๐Ÿ’ž๐Ÿ

An opinionated libbpf/BPF CO-RE (Compile Once---Run Everywhere) library for the Python3 (read Python 3.6+) ecosystem.

DISCLAIMER: This library is in pre-alpha version and changes may result in API breakages. Pre-release version API breakages will be accompanied by a minor version number bump. Versions post 1.0.0 will follow semantic versioning and breakages will require a bump in major version number.

Compilation Requirements

  • Latest libbpf (https://github.com/libbpf/libbpf)
  • Linux kernel compiled with BTF debug info
  • bpftool (available from under linux/tools/bpf/bpftool from official kernel repositories)
  • Clang/LLVM 10+
  • gcc
  • Python 3.6+

Deployment Requirements

  • A pre-compiled shared library for your BPF program, generated with PyBPF (see requirements above)
  • Linux kernel compiled with BTF debug info
  • Python 3.6+

Development Roadmap

Completed Features:

  • Python BPFObjectBuilder that takes care of BPF program compilation and loading
  • Python BPFObject that provides an interface into BPF programs and maps
  • The following map types:
    • HASH
    • PERCPU_HASH
    • LRU_HASH
    • LRU_PERCPU_HASH
    • ARRAY
    • PERCPU_ARRAY
    • QUEUE
    • STACK

Coming Features

  • The following map types:
    • PROG_ARRAY
    • PERF_EVENT_ARRAY
    • STACK_TRACE
    • CGROUP_ARRAY
    • LPM_TRIE
    • ARRAY_OF_MAPS
    • HASH_OF_MAPS
    • DEVMAP
    • SOCKMAP
    • CPUMAP
    • XSKMAP
    • SOCKHASH
    • CGROUP_STORAGE
    • REUSEPORT_SOCKARRAY
    • PERCPU_CGROUP_STORAGE
    • SK_STORAGE
    • DEVMAP_HASH
    • STRUCT_OPS
  • USDT, uprobe loading
  • pybpf CLI tool for bootstrapping PyBPF projects

Distant Future:

  • Automatic map key/value type inference
  • Automatic per-event type inference

Reference Guide

Coming soon!

Cool PyBPF Projects

Coming soon!

pybpf's People

Contributors

willfindlay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.