GithubHelp home page GithubHelp logo

Comments (3)

lmb avatar lmb commented on July 24, 2024

cc @rgo3

from ebpf.

rgo3 avatar rgo3 commented on July 24, 2024

Hello @Andreagit97!

The current behaviour of HaveProgramHelper(ebpf.Tracing, asm.FnSeqWrite) is a bug as it is returning a false negative. Previous to c7ba7f0 calling HaveProgramHelper(ebpf.Tracing, ...) would result in no feature probe for Tracing. Now that we have a probe for program type Tracing, this part of HaveProgramHelper(ebpf.Tracing, ...) will pass but we don't actually create a valid probe for any possible program type/helper combination which yields the false negative.

I'll spend some more time to investigate other options but the output of bpftool feature probe doesn't give hopeful results:

eBPF helpers supported for program type tracing:
	Could not determine which helpers are available
eBPF helpers supported for program type struct_ops:
	Could not determine which helpers are available
eBPF helpers supported for program type ext:
	Could not determine which helpers are available
eBPF helpers supported for program type lsm:
	Could not determine which helpers are available

I'm afraid that creating a generalized helper probe for certain program types (StructOps, Tracing, Extension, LSM) might be quite hard/cumbersome if available helpers depend on the attach type as well. In that case the easiest solution for now could be fixing the bug by returning an inconclusive result telling the caller that we are not able to probe helpers for those program types.

Wrt to HaveProgramType(ebpf.Tracing), there is currently no API to check different attach types, e.g. ebpf.AttachTraceIter. HaveProgramType is really only responsible to ensure a program type is available in the kernel, regardless of the attach type.

from ebpf.

Andreagit97 avatar Andreagit97 commented on July 24, 2024

I'm afraid that creating a generalized helper probe for certain program types (StructOps, Tracing, Extension, LSM) might be quite hard/cumbersome if available helpers depend on the attach type as well. In that case the easiest solution for now could be fixing the bug by returning an inconclusive result telling the caller that we are not able to probe helpers for those program types.

It seems a reasonable fix! thank you

Wrt to HaveProgramType(ebpf.Tracing), there is currently no API to check different attach types, e.g. ebpf.AttachTraceIter. HaveProgramType is really only responsible to ensure a program type is available in the kernel, regardless of the attach type.

Got it! thank you for the explanation

from ebpf.

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.