Module meta

Source
Expand description

Skeleton data types SPDX-License-Identifier: MIT

Copyright (c) 2023, eunomia-bpf All rights reserved.

§bpf-loader-meta

Here are metadata types used for deserilizing JSON skeletons

A valid json skeleton is encoded using one of the two types:

  • EunomiaObjectMeta
  • ComposedObject

In fact, the second one is EunomiaObjectMeta + ELF binary. So in another words, they are same

§EunomiaObjectMeta

Two fields need extra explanation:

§export_types : Vec<ExportedTypesStructMeta>

Here describes the types (usually a struct) of the data that this ebpf program exported to the userspace program. The types described here will be verified using BTF, and used to format the output the ebpf program gives, and passed to the user-callback or stdout. Due to a strange limitation, each program can only have one export types in the Vec

§bpf_skel: BpfSkeletonMeta

Will be explained in the next words.

§BpfSkeletonMeta

This struct describes the skeleton of an ebpf object.

  • data_sections: Describes .rodata and .bss sections, and variables in that
  • maps: Describes map declarations that are used in this ebpf object.
  • progs: Describes ebpf programs (functions) in this ebpf object
  • obj_name: The name of this ebpf object
  • doc: Docs, will be used to generate command line parser

§DataSectionMeta

Describes a data section, and variables declared in it.

§DataSectionVariableMeta

Describes a variable in the corresponding data section.

  • name: The name of this variable
  • ty: The C type of this variable
  • value: The default value of this variable. If not provided and not filled by command line parser, bpf-loader will fill the variable with zero bytes
  • description: The description of the variable. Will be used to generate command line parser
  • cmdarg: Detailed configuration on the command line argument of this variable

§VariableCommandArgument

Describes the detailed configuration of this variable’s command line argument.

  • default: The default value of this command line argument
  • long: The long name of this argument
  • short: The short name of this argument, in one char.

§MapMeta

Describes an eBPF map

§ProgMeta

Describes an eBPF program

Modules§

arg_builder
The builder of Command SPDX-License-Identifier: MIT
arg_parser
A parser that can parse values from command line SPDX-License-Identifier: MIT

Structs§

BpfSkelDoc
Docs of a bpf skeleton I’m sure you can understand the meaning of the fields without any docs… UPD: I’ve forgotten deep source..
BpfSkeletonMeta
Describe a bpf skeleton elf
ComposedObject
Describe a full eunomia json(with ebpf object inside) The original json should be like:
DataSectionMeta
Describe a data section
DataSectionVariableMeta
Describe a variable in a data section
EunomiaObjectMeta
global meta data config
ExportedTypesStructMemberMeta
Describe a struct member in an exported type
ExportedTypesStructMeta
Describe an exported struct
MapMeta
Describe a map
MapSampleMeta
Extra info for a map which will be used for sampling
OverridedStructMember
Describe a member of an overriding struct
ProgMeta
Describe the meta of a bpf program
RunnerConfig
Global config to control the behavior of eunomia-bpf TODO: load config from json or config files
StackTraceFieldMapping
Specify which field in the provided input struct will be mapped to the corresponding field
TCHook
TC Hook options
TCOpts
Options for TC program
TCProgExtraMeta
Extra fields in prog meta for TC programs
VariableCommandArgument
The command line argument that can be used to retrive the value of this variable
XDPOpts
XDP hook options
XDPProgExtraMeta
Extra fields in prog meta for XDP programs

Enums§

BufferValueInterpreter
Indicate how to inteprete the buffer value polled by the userspace program DefaultStruct - Inteprete the data to a map constructed using BTF StackTrace - Inteprete the data that received as StackTrace data. Will also use BTF, but the user is responsible to provide a function to translate the fields to the corresponding requiring fields
MapExportConfig
Describe whether and how a map’s value will be exported
SampleMapType
Sample types
TCAttachPoint
TC attach point options