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 thatmaps
: Describes map declarations that are used in this ebpf object.progs
: Describes ebpf programs (functions) in this ebpf objectobj_name
: The name of this ebpf objectdoc
: 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 variablety
: The C type of this variablevalue
: The default value of this variable. If not provided and not filled by command line parser,bpf-loader
will fill the variable with zero bytesdescription
: The description of the variable. Will be used to generate command line parsercmdarg
: 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 argumentlong
: The long name of this argumentshort
: 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§
- BpfSkel
Doc - 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..
- BpfSkeleton
Meta - Describe a bpf skeleton elf
- Composed
Object - Describe a full eunomia json(with ebpf object inside) The original json should be like:
- Data
Section Meta - Describe a data section
- Data
Section Variable Meta - Describe a variable in a data section
- Eunomia
Object Meta - global meta data config
- Exported
Types Struct Member Meta - Describe a struct member in an exported type
- Exported
Types Struct Meta - Describe an exported struct
- MapMeta
- Describe a map
- MapSample
Meta - Extra info for a map which will be used for sampling
- Overrided
Struct Member - Describe a member of an overriding struct
- Prog
Meta - Describe the meta of a bpf program
- Runner
Config - Global config to control the behavior of eunomia-bpf TODO: load config from json or config files
- Stack
Trace Field Mapping - Specify which field in the provided input struct will be mapped to the corresponding field
- TCHook
- TC Hook options
- TCOpts
- Options for TC program
- TCProg
Extra Meta - Extra fields in prog meta for TC programs
- Variable
Command Argument - The command line argument that can be used to retrive the value of this variable
- XDPOpts
- XDP hook options
- XDPProg
Extra Meta - Extra fields in prog meta for XDP programs
Enums§
- Buffer
Value Interpreter - 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
- MapExport
Config - Describe whether and how a map’s value will be exported
- Sample
MapType - Sample types
- TCAttach
Point - TC attach point options