Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BPFModule

Hierarchy

  • BPFModule

Index

Accessors

  • get functions(): string[]
  • Retrieves all registered eBPF maps on this program and their information, as a (path, tableDesc) dictionary. See TableDesc.

    Returns Map<string, TableDesc>

Event attaching Methods

  • attachKprobe(kernelFunc: string, probeFunc: string, options?: { attachType?: ProbeAttachType; kernelFuncOffset?: bigint; maxActive?: number }): void
  • Parameters

    • kernelFunc: string
    • probeFunc: string
    • Optional options: { attachType?: ProbeAttachType; kernelFuncOffset?: bigint; maxActive?: number }
      • Optional attachType?: ProbeAttachType
      • Optional kernelFuncOffset?: bigint
      • Optional maxActive?: number

    Returns void

  • attachKretprobe(kernelFunc: string, probeFunc: string, options?: { attachType?: ProbeAttachType; kernelFuncOffset?: bigint; maxActive?: number }): void
  • Convenience method, see attachKprobe.

    Parameters

    • kernelFunc: string
    • probeFunc: string
    • Optional options: { attachType?: ProbeAttachType; kernelFuncOffset?: bigint; maxActive?: number }
      • Optional attachType?: ProbeAttachType
      • Optional kernelFuncOffset?: bigint
      • Optional maxActive?: number

    Returns void

  • attachPerfEvent(evType: number, evConfig: number, probeFunc: string, samplePeriod: bigint, sampleFreq: bigint, options?: { cpu?: number; groupFd?: number; pid?: number }): void
  • Parameters

    • evType: number
    • evConfig: number
    • probeFunc: string
    • samplePeriod: bigint
    • sampleFreq: bigint
    • Optional options: { cpu?: number; groupFd?: number; pid?: number }
      • Optional cpu?: number
      • Optional groupFd?: number
      • Optional pid?: number

    Returns void

  • attachTracepoint(tracepoint: string, probeFunc: string): void
  • Parameters

    • tracepoint: string
    • probeFunc: string

    Returns void

  • attachUprobe(binaryPath: string, symbol: string, probeFunc: string, options?: { attachType?: ProbeAttachType; pid?: number; symbolAddr?: bigint; symbolOffset?: bigint }): void
  • Parameters

    • binaryPath: string
    • symbol: string
    • probeFunc: string
    • Optional options: { attachType?: ProbeAttachType; pid?: number; symbolAddr?: bigint; symbolOffset?: bigint }
      • Optional attachType?: ProbeAttachType
      • Optional pid?: number
      • Optional symbolAddr?: bigint
      • Optional symbolOffset?: bigint

    Returns void

  • attachUretprobe(binaryPath: string, symbol: string, probeFunc: string, options?: { attachType?: ProbeAttachType; pid?: number; symbolAddr?: bigint; symbolOffset?: bigint }): void
  • Convenience method, see attachUprobe.

    Parameters

    • binaryPath: string
    • symbol: string
    • probeFunc: string
    • Optional options: { attachType?: ProbeAttachType; pid?: number; symbolAddr?: bigint; symbolOffset?: bigint }
      • Optional attachType?: ProbeAttachType
      • Optional pid?: number
      • Optional symbolAddr?: bigint
      • Optional symbolOffset?: bigint

    Returns void

  • attachUsdt(usdt: USDT, options?: { pid?: number }): void
  • Parameters

    • usdt: USDT
    • Optional options: { pid?: number }
      • Optional pid?: number

    Returns void

  • detachAll(): void
  • detachKprobe(kernelFunc: string, options?: { attachType?: ProbeAttachType }): void
  • detachKretprobe(kernelFunc: string): void
  • detachPerfEvent(evType: number, evConfig: number): void
  • detachTracepoint(tracepoint: string): void
  • detachUprobe(binaryPath: string, symbol: string, options?: { attachType?: ProbeAttachType; pid?: number; symbolAddr?: bigint; symbolOffset?: bigint }): void
  • Parameters

    • binaryPath: string
    • symbol: string
    • Optional options: { attachType?: ProbeAttachType; pid?: number; symbolAddr?: bigint; symbolOffset?: bigint }
      • Optional attachType?: ProbeAttachType
      • Optional pid?: number
      • Optional symbolAddr?: bigint
      • Optional symbolOffset?: bigint

    Returns void

  • detachUretprobe(binaryPath: string, symbol: string, options?: { attachType?: ProbeAttachType; pid?: number; symbolAddr?: bigint; symbolOffset?: bigint }): void
  • Convenience method, see detachUprobe.

    Parameters

    • binaryPath: string
    • symbol: string
    • Optional options: { attachType?: ProbeAttachType; pid?: number; symbolAddr?: bigint; symbolOffset?: bigint }
      • Optional attachType?: ProbeAttachType
      • Optional pid?: number
      • Optional symbolAddr?: bigint
      • Optional symbolOffset?: bigint

    Returns void

  • detachUsdt(usdt: USDT, options?: { pid?: number }): void
  • Parameters

    • usdt: USDT
    • Optional options: { pid?: number }
      • Optional pid?: number

    Returns void

Map access Methods

  • getArrayMap<V>(name: string, valueConv: TypeConversion<V>): ConvArrayMap<V>
  • Creates and returns a generic IArrayMap instance to manipulate the given array map, using the given conversion for values.

    Type parameters

    • V

    Parameters

    • name: string

      Map name

    • valueConv: TypeConversion<V>

    Returns ConvArrayMap<V>

  • getMap<K, V>(name: string, keyConv: TypeConversion<K>, valueConv: TypeConversion<V>): ConvMap<K, V>
  • Creates and returns a generic IMap instance to manipulate the given map, using the given conversions for keys and values.

    Type parameters

    • K

    • V

    Parameters

    • name: string

      Map name

    • keyConv: TypeConversion<K>
    • valueConv: TypeConversion<V>

    Returns ConvMap<K, V>

  • Creates and returns a custom MapRef reference to the given map.

    The reference doesn't support closing the FD, and keeps the full BPF program alive for convenience.

    Parameters

    • name: string

      Map name

    Returns BCCMapRef

  • getQueueMap<V>(name: string, valueConv: TypeConversion<V>): ConvQueueMap<V>
  • Creates and returns a generic IQueueMap instance to manipulate the given queue or stack map, using the given conversion for values.

    Type parameters

    • V

    Parameters

    • name: string

      Map name

    • valueConv: TypeConversion<V>

    Returns ConvQueueMap<V>

  • getRawArrayMap(name: string): RawArrayMap
  • Creates and returns a RawArrayMap instance to manipulate the given array map.

    Parameters

    • name: string

      Map name

    Returns RawArrayMap

  • getRawMap(name: string): RawMap
  • Creates and returns a RawMap instance to manipulate the given map.

    Parameters

    • name: string

      Map name

    Returns RawMap

  • getRawQueueMap(name: string): RawQueueMap
  • Creates and returns a RawQueueMap instance to manipulate the given queue or stack map.

    Parameters

    • name: string

      Map name

    Returns RawQueueMap

Module info Methods

  • Find the information of a map by name. Returns undefined if the map is not found.

    Parameters

    • name: string

      Map name

    Returns undefined | TableDesc

Other Methods

  • addModule(module: string): void
  • autoload(): void
  • Automatically load and attach functions beginning with special prefixes (kprobe__, tracepoint__, etc.).

    By default, this is automatically called by load or loadSync.

    Returns void

  • closePerfEvent(name: string): void
  • freeBccMemory(): void
  • getSyscallFnName(name: string): string
  • loadFunction(funcName: string, type: ProgramType): number
  • Parameters

    • funcName: string
    • type: ProgramType

    Returns number

  • openPerfEvent(name: string, type: number, config: bigint): void
  • Parameters

    • name: string
    • type: number
    • config: bigint

    Returns void

  • unloadFunction(funcName: string): void

Generated using TypeDoc