Git Product home page Git Product logo

Comments (3)

brendangregg avatar brendangregg commented on May 14, 2024

Or even supporting both explicit or implicit value types (3rd argument optional):

BPF_HASH(start, struct request *, u64);
BPF_HASH(start, struct request *);

from bcc.

brendangregg avatar brendangregg commented on May 14, 2024

This has been working, so the ticket can be closed.

It works for hashes that exist only for the C program; eg, temporarily storing timestamps.

I hit issues accessing a BPF_HASH() key (when a key_t is not in use, like in the example above) from Python, complaining about it not being c_int, but that can be a separate issue.

from bcc.

drzaeus77 avatar drzaeus77 commented on May 14, 2024

For the python case you mentioned, what I tend to do is wrap things that should be a ctype with a Table.Key() or Table.Leaf() type.

For instance, if Key is a complex type like struct { int a; int b; }:

b["stats"][b["stats"].Key(0, 1)] = b["stats"].Leaf(42)

from bcc.

Related Issues (20)

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.