// Code generated by bpf2go; DO NOT EDIT.
//go:build arm64

package producer

import (
	"bytes"
	_ "embed"
	"fmt"
	"io"
	"structs"

	"github.com/cilium/ebpf"
)

type bpf_no_tpKafkaRequestT struct {
	_         structs.HostLayout
	StartTime uint64
	EndTime   uint64
	Psc       bpf_no_tpSpanContext
	Msgs      [10]struct {
		_     structs.HostLayout
		Sc    bpf_no_tpSpanContext
		Topic [256]int8
		Key   [256]int8
	}
	GlobalTopic   [256]int8
	ValidMessages uint64
}

type bpf_no_tpSliceArrayBuff struct {
	_    structs.HostLayout
	Buff [1024]uint8
}

type bpf_no_tpSpanContext struct {
	_          structs.HostLayout
	TraceID    [16]uint8
	SpanID     [8]uint8
	TraceFlags uint8
	Padding    [7]uint8
}

// loadBpf_no_tp returns the embedded CollectionSpec for bpf_no_tp.
func loadBpf_no_tp() (*ebpf.CollectionSpec, error) {
	reader := bytes.NewReader(_Bpf_no_tpBytes)
	spec, err := ebpf.LoadCollectionSpecFromReader(reader)
	if err != nil {
		return nil, fmt.Errorf("can't load bpf_no_tp: %w", err)
	}

	return spec, err
}

// loadBpf_no_tpObjects loads bpf_no_tp and converts it into a struct.
//
// The following types are suitable as obj argument:
//
//	*bpf_no_tpObjects
//	*bpf_no_tpPrograms
//	*bpf_no_tpMaps
//
// See ebpf.CollectionSpec.LoadAndAssign documentation for details.
func loadBpf_no_tpObjects(obj interface{}, opts *ebpf.CollectionOptions) error {
	spec, err := loadBpf_no_tp()
	if err != nil {
		return err
	}

	return spec.LoadAndAssign(obj, opts)
}

// bpf_no_tpSpecs contains maps and programs before they are loaded into the kernel.
//
// It can be passed ebpf.CollectionSpec.Assign.
type bpf_no_tpSpecs struct {
	bpf_no_tpProgramSpecs
	bpf_no_tpMapSpecs
	bpf_no_tpVariableSpecs
}

// bpf_no_tpProgramSpecs contains programs before they are loaded into the kernel.
//
// It can be passed ebpf.CollectionSpec.Assign.
type bpf_no_tpProgramSpecs struct {
	UprobeWriteMessages        *ebpf.ProgramSpec `ebpf:"uprobe_WriteMessages"`
	UprobeWriteMessagesReturns *ebpf.ProgramSpec `ebpf:"uprobe_WriteMessages_Returns"`
}

// bpf_no_tpMapSpecs contains maps before they are loaded into the kernel.
//
// It can be passed ebpf.CollectionSpec.Assign.
type bpf_no_tpMapSpecs struct {
	AllocMap               *ebpf.MapSpec `ebpf:"alloc_map"`
	Events                 *ebpf.MapSpec `ebpf:"events"`
	GoContextToSc          *ebpf.MapSpec `ebpf:"go_context_to_sc"`
	KafkaEvents            *ebpf.MapSpec `ebpf:"kafka_events"`
	KafkaRequestStorageMap *ebpf.MapSpec `ebpf:"kafka_request_storage_map"`
	ProbeActiveSamplerMap  *ebpf.MapSpec `ebpf:"probe_active_sampler_map"`
	SamplersConfigMap      *ebpf.MapSpec `ebpf:"samplers_config_map"`
	SliceArrayBuffMap      *ebpf.MapSpec `ebpf:"slice_array_buff_map"`
	TrackedSpansBySc       *ebpf.MapSpec `ebpf:"tracked_spans_by_sc"`
}

// bpf_no_tpVariableSpecs contains global variables before they are loaded into the kernel.
//
// It can be passed ebpf.CollectionSpec.Assign.
type bpf_no_tpVariableSpecs struct {
	EndAddr           *ebpf.VariableSpec `ebpf:"end_addr"`
	Hex               *ebpf.VariableSpec `ebpf:"hex"`
	MessageHeadersPos *ebpf.VariableSpec `ebpf:"message_headers_pos"`
	MessageKeyPos     *ebpf.VariableSpec `ebpf:"message_key_pos"`
	MessageTimePos    *ebpf.VariableSpec `ebpf:"message_time_pos"`
	MessageTopicPos   *ebpf.VariableSpec `ebpf:"message_topic_pos"`
	StartAddr         *ebpf.VariableSpec `ebpf:"start_addr"`
	TotalCpus         *ebpf.VariableSpec `ebpf:"total_cpus"`
	WriterTopicPos    *ebpf.VariableSpec `ebpf:"writer_topic_pos"`
}

// bpf_no_tpObjects contains all objects after they have been loaded into the kernel.
//
// It can be passed to loadBpf_no_tpObjects or ebpf.CollectionSpec.LoadAndAssign.
type bpf_no_tpObjects struct {
	bpf_no_tpPrograms
	bpf_no_tpMaps
	bpf_no_tpVariables
}

func (o *bpf_no_tpObjects) Close() error {
	return _Bpf_no_tpClose(
		&o.bpf_no_tpPrograms,
		&o.bpf_no_tpMaps,
	)
}

// bpf_no_tpMaps contains all maps after they have been loaded into the kernel.
//
// It can be passed to loadBpf_no_tpObjects or ebpf.CollectionSpec.LoadAndAssign.
type bpf_no_tpMaps struct {
	AllocMap               *ebpf.Map `ebpf:"alloc_map"`
	Events                 *ebpf.Map `ebpf:"events"`
	GoContextToSc          *ebpf.Map `ebpf:"go_context_to_sc"`
	KafkaEvents            *ebpf.Map `ebpf:"kafka_events"`
	KafkaRequestStorageMap *ebpf.Map `ebpf:"kafka_request_storage_map"`
	ProbeActiveSamplerMap  *ebpf.Map `ebpf:"probe_active_sampler_map"`
	SamplersConfigMap      *ebpf.Map `ebpf:"samplers_config_map"`
	SliceArrayBuffMap      *ebpf.Map `ebpf:"slice_array_buff_map"`
	TrackedSpansBySc       *ebpf.Map `ebpf:"tracked_spans_by_sc"`
}

func (m *bpf_no_tpMaps) Close() error {
	return _Bpf_no_tpClose(
		m.AllocMap,
		m.Events,
		m.GoContextToSc,
		m.KafkaEvents,
		m.KafkaRequestStorageMap,
		m.ProbeActiveSamplerMap,
		m.SamplersConfigMap,
		m.SliceArrayBuffMap,
		m.TrackedSpansBySc,
	)
}

// bpf_no_tpVariables contains all global variables after they have been loaded into the kernel.
//
// It can be passed to loadBpf_no_tpObjects or ebpf.CollectionSpec.LoadAndAssign.
type bpf_no_tpVariables struct {
	EndAddr           *ebpf.Variable `ebpf:"end_addr"`
	Hex               *ebpf.Variable `ebpf:"hex"`
	MessageHeadersPos *ebpf.Variable `ebpf:"message_headers_pos"`
	MessageKeyPos     *ebpf.Variable `ebpf:"message_key_pos"`
	MessageTimePos    *ebpf.Variable `ebpf:"message_time_pos"`
	MessageTopicPos   *ebpf.Variable `ebpf:"message_topic_pos"`
	StartAddr         *ebpf.Variable `ebpf:"start_addr"`
	TotalCpus         *ebpf.Variable `ebpf:"total_cpus"`
	WriterTopicPos    *ebpf.Variable `ebpf:"writer_topic_pos"`
}

// bpf_no_tpPrograms contains all programs after they have been loaded into the kernel.
//
// It can be passed to loadBpf_no_tpObjects or ebpf.CollectionSpec.LoadAndAssign.
type bpf_no_tpPrograms struct {
	UprobeWriteMessages        *ebpf.Program `ebpf:"uprobe_WriteMessages"`
	UprobeWriteMessagesReturns *ebpf.Program `ebpf:"uprobe_WriteMessages_Returns"`
}

func (p *bpf_no_tpPrograms) Close() error {
	return _Bpf_no_tpClose(
		p.UprobeWriteMessages,
		p.UprobeWriteMessagesReturns,
	)
}

func _Bpf_no_tpClose(closers ...io.Closer) error {
	for _, closer := range closers {
		if err := closer.Close(); err != nil {
			return err
		}
	}
	return nil
}

// Do not access this directly.
//
//go:embed bpf_no_tp_arm64_bpfel.o
var _Bpf_no_tpBytes []byte
