diff --git a/agent/agent.go b/agent/agent.go index fe6979b9..8100fcf2 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -1,120 +1,50 @@ package agent import ( - "bytes" - "cmp" - "container/list" - "encoding/binary" - "errors" - "fmt" - "io" - "io/fs" + "context" "kyanos/agent/analysis" + anc "kyanos/agent/analysis/common" ac "kyanos/agent/common" "kyanos/agent/compatible" "kyanos/agent/conn" "kyanos/agent/protocol" "kyanos/agent/render" - "kyanos/agent/uprobe" "kyanos/bpf" + "kyanos/bpf/loader" "kyanos/common" "os" "os/signal" - "path/filepath" - "runtime" - "slices" - "strconv" - "strings" "syscall" "time" - "unsafe" - "github.com/cilium/ebpf" - "github.com/cilium/ebpf/asm" - "github.com/cilium/ebpf/btf" - "github.com/cilium/ebpf/link" - "github.com/cilium/ebpf/perf" - "github.com/cilium/ebpf/ringbuf" "github.com/cilium/ebpf/rlimit" - "github.com/emirpasic/gods/maps/treemap" - "github.com/spf13/viper" - "github.com/zcalusic/sysinfo" ) -type LoadBpfProgramFunction func(programs interface{}) *list.List -type SyscallEventHook func(evt *bpf.SyscallEventData) -type SslEventHook func(evt *bpf.SslData) -type ConnEventHook func(evt *bpf.AgentConnEvtT) -type KernEventHook func(evt *bpf.AgentKernEvt) -type InitCompletedHook func() -type ConnManagerInitHook func(*conn.ConnManager) - -const perfEventDataBufferSize = 30 * 1024 * 1024 -const perfEventControlBufferSize = 1 * 1024 * 1024 - -type AgentOptions struct { - Stopper chan os.Signal - CustomSyscallEventHook SyscallEventHook - CustomConnEventHook ConnEventHook - CustomKernEventHook KernEventHook - CustomSslEventHook SslEventHook - InitCompletedHook InitCompletedHook - ConnManagerInitHook ConnManagerInitHook - LoadBpfProgramFunction LoadBpfProgramFunction - ProcessorsNum int - MessageFilter protocol.ProtocolFilter - LatencyFilter protocol.LatencyFilter - TraceSide common.SideEnum - IfName string - BTFFilePath string - BPFVerifyLogSize int - protocol.SizeFilter - AnalysisEnable bool - analysis.AnalysisOptions - PerfEventBufferSizeForData int - PerfEventBufferSizeForEvent int - DisableOpensslUprobe bool -} - -func validateAndRepairOptions(options AgentOptions) AgentOptions { - var newOptions = options - if newOptions.Stopper == nil { - newOptions.Stopper = make(chan os.Signal) - } - if newOptions.ProcessorsNum == 0 { - newOptions.ProcessorsNum = runtime.NumCPU() - } - if newOptions.MessageFilter == nil { - newOptions.MessageFilter = protocol.BaseFilter{} - } - if newOptions.BPFVerifyLogSize <= 0 { - newOptions.BPFVerifyLogSize = 10 * 1024 - } - if newOptions.PerfEventBufferSizeForData <= 0 { - newOptions.PerfEventBufferSizeForData = perfEventDataBufferSize - } - if newOptions.PerfEventBufferSizeForEvent <= 0 { - newOptions.PerfEventBufferSizeForEvent = perfEventControlBufferSize - } - return newOptions -} - -func SetupAgent(options AgentOptions) { - options = validateAndRepairOptions(options) +func SetupAgent(options ac.AgentOptions) { + options = ac.ValidateAndRepairOptions(options) common.LaunchEpochTime = GetMachineStartTimeNano() stopper := options.Stopper connManager := conn.InitConnManager() + + signal.Notify(stopper, os.Interrupt, syscall.SIGTERM) + ctx, stopFunc := signal.NotifyContext( + context.Background(), syscall.SIGINT, syscall.SIGTERM, + ) + options.Ctx = ctx + + defer stopFunc() + if options.ConnManagerInitHook != nil { options.ConnManagerInitHook(connManager) } statRecorder := analysis.InitStatRecorder() - var recordsChannel chan *analysis.AnnotatedRecord = nil + var recordsChannel chan *anc.AnnotatedRecord = nil if options.AnalysisEnable { - recordsChannel = make(chan *analysis.AnnotatedRecord, 1000) + recordsChannel = make(chan *anc.AnnotatedRecord, 1000) resultChannel := make(chan []*analysis.ConnStat, 1000) renderStopper := make(chan int) - analyzer := analysis.CreateAnalyzer(recordsChannel, &options.AnalysisOptions, resultChannel, renderStopper) + analyzer := analysis.CreateAnalyzer(recordsChannel, &options.AnalysisOptions, resultChannel, renderStopper, options.Ctx) go analyzer.Run() render := render.CreateRender(resultChannel, renderStopper, analyzer.AnalysisOptions) @@ -130,192 +60,50 @@ func SetupAgent(options AgentOptions) { return nil } - signal.Notify(stopper, os.Interrupt, syscall.SIGTERM) - // Remove resource limits for kernels <5.11. if err := rlimit.RemoveMemlock(); err != nil { common.AgentLog.Warn("Remove memlock:", err) } kernelVersion := compatible.GetCurrentKernelVersion() - var links *list.List - // Load the compiled eBPF ELF and load it into the kernel. - var objs any - var spec *ebpf.CollectionSpec + options.Kv = &kernelVersion var err error - var collectionOptions *ebpf.CollectionOptions - if options.BTFFilePath != "" { - btfPath, err := btf.LoadSpec(options.BTFFilePath) - if err != nil { - common.AgentLog.Fatalf("can't load btf spec: %v", err) - } - collectionOptions = &ebpf.CollectionOptions{ - Programs: ebpf.ProgramOptions{ - KernelTypes: btfPath, - LogSize: options.BPFVerifyLogSize, - }, - } - } else { - fileBytes, err := getBestMatchedBTFFile() - if err != nil { - common.AgentLog.Fatalln(err) - return - } - needGenerateBTF := fileBytes != nil - - if needGenerateBTF { - btfFilePath, err := writeToFile(fileBytes, ".kyanos.btf") - if err != nil { - common.AgentLog.Fatalln(err) - return - } - defer os.Remove(btfFilePath) - - btfPath, err := btf.LoadSpec(btfFilePath) - if err != nil { - common.AgentLog.Fatalf("can't load btf spec: %v", err) - } - collectionOptions = &ebpf.CollectionOptions{ - Programs: ebpf.ProgramOptions{ - KernelTypes: btfPath, - LogSize: options.BPFVerifyLogSize, - }, - } - } else { - collectionOptions = &ebpf.CollectionOptions{ - Programs: ebpf.ProgramOptions{ - LogSize: options.BPFVerifyLogSize, - }, - } - } - - } - if !kernelVersion.SupportCapability(compatible.SupportRingBuffer) { - objs = &bpf.AgentOldObjects{} - spec, err = bpf.LoadAgentOld() - if err != nil { - common.AgentLog.Fatal("load Agent error:", err) - } - } else { - objs = &bpf.AgentObjects{} - spec, err = bpf.LoadAgent() - if err != nil { - common.AgentLog.Fatal("load Agent error:", err) - } - } - bpf.Objs = objs - - filterFunctions(spec, kernelVersion) - err = spec.LoadAndAssign(objs, collectionOptions) - - agentOldObjects, ok := objs.(*bpf.AgentOldObjects) - agentObjects, ok := objs.(*bpf.AgentObjects) - if ok { - - } - + bf, err := loader.LoadBPF(options) if err != nil { - err = errors.Unwrap(errors.Unwrap(err)) - inner_err, ok := err.(*ebpf.VerifierError) - if ok { - inner_err.Truncated = false - common.AgentLog.Errorf("loadAgentObjects: %+v", inner_err) - } else { - common.AgentLog.Errorf("loadAgentObjects: %+v", err) + if bf != nil { + bf.Close() } return } - - defer func() { - var closer io.Closer - if !kernelVersion.SupportCapability(compatible.SupportRingBuffer) { - agentOldObjects := objs.(*bpf.AgentOldObjects) - closer = agentOldObjects - } else { - agentObjects := objs.(*bpf.AgentObjects) - closer = agentObjects - } - - closer.Close() - }() - var validateResult = setAndValidateParameters() - if !kernelVersion.SupportCapability(compatible.SupportRingBuffer) { - if options.LoadBpfProgramFunction != nil { - links = options.LoadBpfProgramFunction(agentOldObjects.AgentOldPrograms) - } else { - links = attachBpfProgs(agentOldObjects.AgentOldPrograms, options.IfName, kernelVersion, options) - } - } else { - - if options.LoadBpfProgramFunction != nil { - links = options.LoadBpfProgramFunction(agentObjects.AgentPrograms) - } else { - links = attachBpfProgs(agentObjects.AgentPrograms, options.IfName, kernelVersion, options) - } - } - - if !kernelVersion.SupportCapability(compatible.SupportXDP) { - enabledXdp := bpf.AgentControlValueIndexTKEnabledXdpIndex - var enableXdpValue int64 = 0 - bpf.GetMap("ControlValues").Update(&enabledXdp, &enableXdpValue, ebpf.UpdateAny) + defer bf.Close() + err = bpf.PullSyscallDataEvents(ctx, pm.GetSyscallEventsChannels(), 2048, options.CustomSyscallEventHook) + if err != nil { + return } - if !validateResult { + err = bpf.PullSslDataEvents(ctx, pm.GetSslEventsChannels(), 512, options.CustomSslEventHook) + if err != nil { return } - - if !options.DisableOpensslUprobe { - reader := attachOpenSslUprobes(links, options, kernelVersion, objs) - defer func() { - if reader != nil { - reader.Close() - } - }() + err = bpf.PullConnDataEvents(ctx, pm.GetConnEventsChannels(), 4, options.CustomConnEventHook) + if err != nil { + return } - - defer func() { - for e := links.Front(); e != nil; e = e.Next() { - if e.Value == nil { - continue - } - if l, ok := e.Value.(link.Link); ok { - err := l.Close() - if err != nil { - info, _ := l.Info() - common.AgentLog.Errorf("Fail to close link for: %v\n", info) - } - } - } - common.AgentLog.Debugln("All links closed!") - }() - // Close the reader when the process receives a signal, which will exit - // the read loop. - stop := false - readers, err := setupReaders(options, kernelVersion, objs) + err = bpf.PullKernEvents(ctx, pm.GetKernEventsChannels(), 32, options.CustomKernEventHook) if err != nil { - for _, reader := range readers { - reader.Close() - } - common.AgentLog.Warnf("setup event reader err: %v", err) return } + stop := false go func() { <-stopper - ac.SendStopSignal() + // ac.SendStopSignal() common.AgentLog.Debugln("stop!") - for _, reader := range readers { - if err := reader.Close(); err != nil { - common.AgentLog.Fatalf("closing reader(%v) error: %s", reader, err) - } - } pm.StopAll() stop = true }() common.AgentLog.Info("Waiting for events..") - startReaders(options, kernelVersion, pm, readers) - if options.InitCompletedHook != nil { options.InitCompletedHook() } @@ -325,595 +113,3 @@ func SetupAgent(options AgentOptions) { common.AgentLog.Infoln("Kyanos Stopped") return } - -func attachOpenSslUprobes(links *list.List, options AgentOptions, kernelVersion compatible.KernelVersion, objs any) io.Closer { - if attachOpensslToSpecificProcess() { - uprobeLinks, err := uprobe.AttachSslUprobe(int(viper.GetInt64(common.FilterPidVarName))) - if err == nil { - for _, l := range uprobeLinks { - links.PushBack(l) - } - } else { - common.AgentLog.Infof("Attach OpenSsl uprobes failed: %+v for pid: %d", err, viper.GetInt64(common.FilterPidVarName)) - } - } else { - pids, err := common.GetAllPids() - if err == nil { - for _, pid := range pids { - uprobeLinks, err := uprobe.AttachSslUprobe(int(pid)) - if err == nil && len(uprobeLinks) > 0 { - for _, l := range uprobeLinks { - links.PushBack(l) - } - common.AgentLog.Infof("Attach OpenSsl uprobes success for pid: %d", pid) - } else if err != nil { - common.AgentLog.Infof("Attach OpenSsl uprobes failed: %+v for pid: %d", err, pid) - } else if len(uprobeLinks) == 0 { - common.AgentLog.Infof("Attach OpenSsl uprobes success for pid: %d use previous libssl path", pid) - } - } - } else { - common.AgentLog.Warnf("get all pid failed: %v", err) - } - attachSchedProgs(links) - uprobeSchedExecEvent := uprobe.StartHandleSchedExecEvent() - reader, err := setupReader(options, kernelVersion, objs, "ProcExecEvents", false) - if err == nil { - startPerfeventReader(reader, func(record perf.Record) error { - var event bpf.AgentProcessExecEvent - err := binary.Read(bytes.NewBuffer(record.RawSample), binary.LittleEndian, &event) - if err != nil { - return err - } - uprobeSchedExecEvent <- &event - return nil - }) - return reader - } else { - common.AgentLog.Warnf("setup process exec events perf reader failed: %v", err) - } - } - return nil -} - -func startReaders(options AgentOptions, kernel compatible.KernelVersion, pm *conn.ProcessorManager, readers []io.Closer) { - if kernel.SupportCapability(compatible.SupportRingBuffer) { - // syscall - startRingbufferReader(readers[0], func(r ringbuf.Record) error { - return handleSyscallEvt(r.RawSample, pm, options.ProcessorsNum, options.CustomSyscallEventHook) - }) - // ssl - startRingbufferReader(readers[1], func(r ringbuf.Record) error { - return handleSslDataEvt(r.RawSample, pm, options.ProcessorsNum, options.CustomSslEventHook) - }) - - // kernel event - startRingbufferReader(readers[2], func(r ringbuf.Record) error { - return handleKernEvt(r.RawSample, pm, options.ProcessorsNum, options.CustomKernEventHook) - }) - // conn event - startRingbufferReader(readers[3], func(r ringbuf.Record) error { - return handleConnEvt(r.RawSample, pm, options.ProcessorsNum, options.CustomConnEventHook) - }) - } else { - startPerfeventReader(readers[0], func(r perf.Record) error { - return handleSyscallEvt(r.RawSample, pm, options.ProcessorsNum, options.CustomSyscallEventHook) - }) - // ssl - startPerfeventReader(readers[1], func(r perf.Record) error { - return handleSslDataEvt(r.RawSample, pm, options.ProcessorsNum, options.CustomSslEventHook) - }) - startPerfeventReader(readers[2], func(r perf.Record) error { - return handleKernEvt(r.RawSample, pm, options.ProcessorsNum, options.CustomKernEventHook) - }) - startPerfeventReader(readers[3], func(r perf.Record) error { - return handleConnEvt(r.RawSample, pm, options.ProcessorsNum, options.CustomConnEventHook) - }) - } -} - -func setupReaders(options AgentOptions, kernel compatible.KernelVersion, objs any) ([]io.Closer, error) { - closers := make([]io.Closer, 0) - syscallDataReader, err := setupReader(options, kernel, objs, "SyscallRb", true) - if err != nil { - return nil, err - } - closers = append(closers, syscallDataReader) - - sslDataReader, err := setupReader(options, kernel, objs, "SslRb", true) - if err != nil { - return nil, err - } - closers = append(closers, sslDataReader) - - kernEventReader, err := setupReader(options, kernel, objs, "Rb", false) - if err != nil { - return closers, err - } - closers = append(closers, kernEventReader) - - connEvtReader, err := setupReader(options, kernel, objs, "ConnEvtRb", false) - if err != nil { - return closers, err - } - closers = append(closers, connEvtReader) - return closers, nil -} - -func setupReader(options AgentOptions, kernel compatible.KernelVersion, objs any, mapName string, isDataBuffer bool) (io.Closer, error) { - if kernel.SupportCapability(compatible.SupportRingBuffer) { - return ringbuf.NewReader(bpf.GetMapByObjs(mapName, objs)) - } else { - if isDataBuffer { - return perf.NewReader(bpf.GetMapByObjs(mapName, objs), options.PerfEventBufferSizeForData) - } else { - return perf.NewReader(bpf.GetMapByObjs(mapName, objs), options.PerfEventBufferSizeForEvent) - } - } -} - -func startRingbufferReader(reader io.Closer, consumeFunction func(ringbuf.Record) error) { - ringbuffer := reader.(*ringbuf.Reader) - go func() { - for { - record, err := ringbuffer.Read() - if err != nil { - if errors.Is(err, perf.ErrClosed) { - common.AgentLog.Debug("[dataReader] Received signal, exiting..") - return - } - common.AgentLog.Debugf("[dataReader] reading from reader: %s\n", err) - continue - } - if err := consumeFunction(record); err != nil { - common.AgentLog.Errorf("[dataReader] handleKernEvt err: %s\n", err) - continue - } - } - }() -} - -func startPerfeventReader(reader io.Closer, consumeFunction func(perf.Record) error) { - perfReader := reader.(*perf.Reader) - go func() { - for { - record, err := perfReader.Read() - if err != nil { - if errors.Is(err, perf.ErrClosed) { - common.AgentLog.Debug("[dataReader] Received signal, exiting..") - return - } - common.AgentLog.Debugf("[dataReader] reading from reader: %s\n", err) - continue - } - if err := consumeFunction(record); err != nil { - common.AgentLog.Errorf("[dataReader] handleKernEvt err: %s\n", err) - continue - } else if record.LostSamples > 0 { - common.AgentLog.Warnf("[dataReader] lost sample: %d", record.LostSamples) - } - } - }() -} - -func attachOpensslToSpecificProcess() bool { - return viper.GetInt64(common.FilterPidVarName) > 0 -} - -func setAndValidateParameters() bool { - var controlValues *ebpf.Map = bpf.GetMap("ControlValues") - var enabledRemotePortMap *ebpf.Map = bpf.GetMap("EnabledRemotePortMap") - var enabledRemoteIpv4Map *ebpf.Map = bpf.GetMap("EnabledRemoteIpv4Map") - var enabledLocalPortMap *ebpf.Map = bpf.GetMap("EnabledLocalPortMap") - - if targetPid := viper.GetInt64(common.FilterPidVarName); targetPid > 0 { - common.AgentLog.Infoln("filter for pid: ", targetPid) - controlValues.Update(bpf.AgentControlValueIndexTKTargetTGIDIndex, targetPid, ebpf.UpdateAny) - } - - remotePorts := viper.GetStringSlice(common.RemotePortsVarName) - oneKey := uint16(1) - zeroValue := uint8(0) - if len(remotePorts) > 0 { - common.AgentLog.Infoln("filter for remote ports: ", remotePorts) - err := enabledRemotePortMap.Update(oneKey, zeroValue, ebpf.UpdateAny) - if err != nil { - common.AgentLog.Errorln("Update EnabledRemotePortMap failed: ", err) - } - for _, each := range remotePorts { - portInt, err := strconv.Atoi(each) - if err != nil || portInt <= 0 { - common.AgentLog.Errorf("Invalid remote port : %s\n", each) - return false - } - portNumber := uint16(portInt) - err = enabledRemotePortMap.Update(portNumber, zeroValue, ebpf.UpdateAny) - if err != nil { - common.AgentLog.Errorln("Update EnabledRemotePortMap failed: ", err) - } - } - } - - remoteIps := viper.GetStringSlice(common.RemoteIpsVarName) - if len(remoteIps) > 0 { - common.AgentLog.Infoln("filter for remote ips: ", remoteIps) - oneKeyU32 := uint32(1) - err := enabledRemoteIpv4Map.Update(&oneKeyU32, &zeroValue, ebpf.UpdateAny) - if err != nil { - common.AgentLog.Errorln("Update EnabledRemoteIpv4Map failed: ", err) - } - for _, each := range remoteIps { - ipInt32, err := common.IPv4ToUint32(each) - if err != nil { - common.AgentLog.Errorf("IPv4ToUint32 parse failed, ip string is: %s, err: %v", each, err) - return false - } else { - common.AgentLog.Debugln("Update EnabledRemoteIpv4Map, key: ", ipInt32, common.IntToIP(ipInt32)) - err = enabledRemoteIpv4Map.Update(&ipInt32, &zeroValue, ebpf.UpdateAny) - if err != nil { - common.AgentLog.Errorln("Update EnabledRemoteIpv4Map failed: ", err) - } - } - } - } - - localPorts := viper.GetStringSlice(common.LocalPortsVarName) - if len(localPorts) > 0 { - common.AgentLog.Infoln("filter for local ports: ", localPorts) - err := enabledLocalPortMap.Update(oneKey, uint8(oneKey), ebpf.UpdateAny) - if err != nil { - common.AgentLog.Errorln("Update EnabledLocalPortMap failed: ", err) - } - for _, each := range localPorts { - portInt, err := strconv.Atoi(each) - if err != nil || portInt <= 0 { - common.AgentLog.Errorf("Invalid local port : %s\n", each) - return false - } - portNumber := uint16(portInt) - err = enabledLocalPortMap.Update(portNumber, zeroValue, ebpf.UpdateAny) - if err != nil { - common.AgentLog.Errorln("Update EnabledLocalPortMap failed: ", err) - } - } - } - - return true -} - -func handleConnEvt(record []byte, pm *conn.ProcessorManager, processorsNum int, customConnEventHook ConnEventHook) error { - var event bpf.AgentConnEvtT - err := binary.Read(bytes.NewBuffer(record), binary.LittleEndian, &event) - if err != nil { - return err - } - - tgidFd := uint64(event.ConnInfo.ConnId.Upid.Pid)<<32 | uint64(event.ConnInfo.ConnId.Fd) - p := pm.GetProcessor(int(tgidFd) % processorsNum) - if customConnEventHook != nil { - customConnEventHook(&event) - } - p.AddConnEvent(&event) - return nil -} - -func handleSslDataEvt(record []byte, pm *conn.ProcessorManager, processorsNum int, customSslEventHook SslEventHook) error { - event := new(bpf.SslData) - err := binary.Read(bytes.NewBuffer(record), binary.LittleEndian, &event.SslEventHeader) - if err != nil { - return err - } - msgSize := event.SslEventHeader.BufSize - headerSize := uint(unsafe.Sizeof(event.SslEventHeader)) - buf := make([]byte, msgSize) - err = binary.Read(bytes.NewBuffer(record[headerSize:]), binary.LittleEndian, &buf) - if err != nil { - return err - } - event.Buf = buf - tgidFd := event.SslEventHeader.Ke.ConnIdS.TgidFd - p := pm.GetProcessor(int(tgidFd) % processorsNum) - // err := - if customSslEventHook != nil { - customSslEventHook(event) - } - p.AddSslEvent(event) - return nil -} -func handleSyscallEvt(record []byte, pm *conn.ProcessorManager, processorsNum int, customSyscallEventHook SyscallEventHook) error { - // 首先看这个连接上有没有堆积的请求,如果有继续堆积 - // 如果没有作为新的请求 - event := new(bpf.SyscallEventData) - err := binary.Read(bytes.NewBuffer(record), binary.LittleEndian, &event.SyscallEvent) - if err != nil { - return err - } - msgSize := event.SyscallEvent.BufSize - buf := make([]byte, msgSize) - if msgSize > 0 { - headerSize := uint(unsafe.Sizeof(event.SyscallEvent)) - 4 - err = binary.Read(bytes.NewBuffer(record[headerSize:]), binary.LittleEndian, &buf) - if err != nil { - return err - } - } - event.Buf = buf - - tgidFd := event.SyscallEvent.Ke.ConnIdS.TgidFd - p := pm.GetProcessor(int(tgidFd) % processorsNum) - if customSyscallEventHook != nil { - customSyscallEventHook(event) - } - p.AddSyscallEvent(event) - return nil -} -func handleKernEvt(record []byte, pm *conn.ProcessorManager, processorsNum int, customKernEventHook KernEventHook) error { - var event bpf.AgentKernEvt - err := binary.Read(bytes.NewBuffer(record), binary.LittleEndian, &event) - if err != nil { - return err - } - tgidFd := event.ConnIdS.TgidFd - p := pm.GetProcessor(int(tgidFd) % processorsNum) - if customKernEventHook != nil { - customKernEventHook(&event) - } - p.AddKernEvent(&event) - return nil -} - -func attachBpfProgs(programs any, ifName string, kernelVersion compatible.KernelVersion, options AgentOptions) *list.List { - linkList := list.New() - - if kernelVersion.SupportCapability(compatible.SupportXDP) { - l, err := bpf.AttachXdpWithSpecifiedIfName(programs, options.IfName) - if err != nil { - common.AgentLog.Warnf("Attach XDP program failed, fallbacking...") - } else { - linkList.PushBack(l) - } - } - - if kernelVersion.SupportCapability(compatible.SupportRawTracepoint) { - l, err := bpf.AttachRawTracepointTcpDestroySockEntry(programs) - if err != nil { - common.AgentLog.Warnf("Attach TCP destroy raw tracepoint failed, fallbacking...") - } else { - linkList.PushBack(l) - } - } - - for _, functions := range kernelVersion.InstrumentFunctions { - for idx, function := range functions { - var err error - var l link.Link - if function.IsKprobe() { - l, err = bpf.Kprobe(function.GetKprobeName(), bpf.GetProgram(programs, function.BPFGoProgName)) - } else if function.IsTracepoint() { - l, err = bpf.Tracepoint(function.GetTracepointGroupName(), function.GetTracepointName(), - bpf.GetProgram(programs, function.BPFGoProgName)) - } else if function.IsKRetprobe() { - l, err = bpf.Kretprobe(function.GetKprobeName(), bpf.GetProgram(programs, function.BPFGoProgName)) - } else { - panic(fmt.Sprintf("invalid program type: %v", function)) - } - if err != nil { - if idx == len(functions)-1 { - common.AgentLog.Fatalf("Attach failed: %v, functions: %v", err, functions) - } else { - common.AgentLog.Debugf("Attach failed but has fallback: %v, functions: %v", err, functions) - } - } else { - linkList.PushBack(l) - break - } - } - } - - linkList.PushBack(bpf.AttachSyscallAcceptEntry(programs)) - linkList.PushBack(bpf.AttachSyscallAcceptExit(programs)) - - linkList.PushBack(bpf.AttachSyscallSockAllocExit(programs)) - - linkList.PushBack(bpf.AttachSyscallConnectEntry(programs)) - linkList.PushBack(bpf.AttachSyscallConnectExit(programs)) - - linkList.PushBack(bpf.AttachSyscallCloseEntry(programs)) - linkList.PushBack(bpf.AttachSyscallCloseExit(programs)) - - linkList.PushBack(bpf.AttachSyscallWriteEntry(programs)) - linkList.PushBack(bpf.AttachSyscallWriteExit(programs)) - - linkList.PushBack(bpf.AttachSyscallSendMsgEntry(programs)) - linkList.PushBack(bpf.AttachSyscallSendMsgExit(programs)) - - linkList.PushBack(bpf.AttachSyscallRecvMsgEntry(programs)) - linkList.PushBack(bpf.AttachSyscallRecvMsgExit(programs)) - - linkList.PushBack(bpf.AttachSyscallWritevEntry(programs)) - linkList.PushBack(bpf.AttachSyscallWritevExit(programs)) - - linkList.PushBack(bpf.AttachSyscallSendtoEntry(programs)) - linkList.PushBack(bpf.AttachSyscallSendtoExit(programs)) - - linkList.PushBack(bpf.AttachSyscallReadEntry(programs)) - linkList.PushBack(bpf.AttachSyscallReadExit(programs)) - - linkList.PushBack(bpf.AttachSyscallReadvEntry(programs)) - linkList.PushBack(bpf.AttachSyscallReadvExit(programs)) - - linkList.PushBack(bpf.AttachSyscallRecvfromEntry(programs)) - linkList.PushBack(bpf.AttachSyscallRecvfromExit(programs)) - - linkList.PushBack(bpf.AttachKProbeSecuritySocketRecvmsgEntry(programs)) - linkList.PushBack(bpf.AttachKProbeSecuritySocketSendmsgEntry(programs)) - - return linkList -} - -func attachSchedProgs(links *list.List) { - link, err := link.Tracepoint("sched", "sched_process_exec", bpf.GetProgramFromObjs(bpf.Objs, "TracepointSchedSchedProcessExec"), nil) - if err != nil { - common.AgentLog.Warnf("Attach tracepoint/sched/sched_process_exec error: %v", err) - } else { - links.PushBack(link) - } -} - -func filterFunctions(coll *ebpf.CollectionSpec, kernelVersion compatible.KernelVersion) { - finalCProgNames := make([]string, 0) - - if kernelVersion.SupportCapability(compatible.SupportXDP) { - finalCProgNames = append(finalCProgNames, bpf.XDPProgramName) - } - if kernelVersion.SupportCapability(compatible.SupportRawTracepoint) { - finalCProgNames = append(finalCProgNames, bpf.TcpDestroySocketProgName) - } - for step := bpf.AgentStepTStart; step < bpf.AgentStepTEnd; step++ { - functions, ok := kernelVersion.InstrumentFunctions[step] - if ok { - for _, function := range functions { - finalCProgNames = append(finalCProgNames, bpf.GoProgName2CProgName[function.BPFGoProgName]) - } - } - } - - finalCProgNames = append(finalCProgNames, bpf.SyscallExtraProgNames...) - for name := range coll.Programs { - if strings.HasPrefix(name, "tracepoint__syscalls") || strings.HasPrefix(name, "tracepoint__sched") { - finalCProgNames = append(finalCProgNames, name) - } - } - - needsDelete := make([]string, 0) - for cProgName, _ := range coll.Programs { - if slices.Index(finalCProgNames, cProgName) == -1 { - needsDelete = append(needsDelete, cProgName) - } - } - for _, each := range needsDelete { - coll.Programs[each] = socketFilterSpec - } -} - -var socketFilterSpec = &ebpf.ProgramSpec{ - Name: "test", - Type: ebpf.Kprobe, - SectionName: "kprobe/sys_accept", - Instructions: asm.Instructions{ - asm.LoadImm(asm.R0, 2, asm.DWord), - asm.Return(), - }, - License: "MIT", -} - -func getBestMatchedBTFFile() ([]uint8, error) { - if bpf.IsKernelSupportHasBTF() { - return nil, nil - } - - var si sysinfo.SysInfo - si.GetSysInfo() - common.AgentLog.Debugf("[sys info] vendor: %s, os_arch: %s, kernel_arch: %s", si.OS.Vendor, si.OS.Architecture, si.Kernel.Architecture) - - if si.OS.Vendor != "ubuntu" && si.OS.Vendor != "centos" { - common.AgentLog.Fatal("Current only support centos and ubuntu") - } - if si.OS.Architecture != "amd64" { - common.AgentLog.Fatal("Current only support amd64") - } - if si.Kernel.Architecture != "x86_64" { - common.AgentLog.Fatal("Current only support x86_64") - } - - var btfFileDir string - btfFileDir += "custom-archive" - btfFileDir += "/" + si.OS.Vendor - if si.OS.Vendor == "centos" { - btfFileDir += "/" + si.OS.Release[:1] - } else { - btfFileDir += "/" + si.OS.Release[:5] - } - btfFileDir += "/" + si.Kernel.Architecture - dir, err := bpf.BtfFiles.ReadDir(btfFileDir) - if err != nil { - common.AgentLog.Warnf("btf file not exists, path: %s", btfFileDir) - return nil, err - } - btfFileNames := treemap.NewWithStringComparator() - for _, entry := range dir { - btfFileName := entry.Name() - if idx := strings.Index(btfFileName, ".btf"); idx != -1 { - btfFileName = btfFileName[:idx] - btfFileNames.Put(btfFileName, entry) - } - } - - release := si.Kernel.Release - if value, found := btfFileNames.Get(release); found { - common.AgentLog.Debug("find btf file exactly!") - dirEntry := value.(fs.DirEntry) - fileName := dirEntry.Name() - file, err := bpf.BtfFiles.ReadFile(btfFileDir + "/" + fileName) - if err == nil { - return file, nil - } - } else { - common.AgentLog.Debug("find btf file exactly failed, try to find a lower version btf file...") - } - - sortedBtfFileNames := btfFileNames.Keys() - slices.SortFunc(sortedBtfFileNames, func(a, b interface{}) int { - return cmp.Compare(a.(string), b.(string)) - }) - var result string - var commonPrefixLength = 0 - for _, btfFileName := range btfFileNames.Keys() { - prefix := common.CommonPrefix(btfFileName.(string), release) - if len(prefix) > commonPrefixLength { - result = btfFileName.(string) - commonPrefixLength = len(prefix) - } - } - if result != "" { - value, _ := btfFileNames.Get(result) - dirEntry := value.(fs.DirEntry) - fileName := dirEntry.Name() - common.AgentLog.Debugf("find a btf file may be success: %s", fileName) - file, err := bpf.BtfFiles.ReadFile(btfFileDir + "/" + fileName) - if err == nil { - return file, nil - } - } - return nil, errors.New("no btf file found to load") -} - -// writeToFile writes the []uint8 slice to a specified file in the system's temp directory. -// If the temp directory does not exist, it creates a ".kyanos" directory in the current directory. -func writeToFile(data []uint8, filename string) (string, error) { - // Get the system's temp directory - tempDir := os.TempDir() - - // Check if the temp directory exists - if _, err := os.Stat(tempDir); os.IsNotExist(err) { - // Create a ".kyanos" directory in the current directory - tempDir = "." - } - - // Create the file path - filePath := filepath.Join(tempDir, filename) - - // Write the byte slice to the file - err := os.WriteFile(filePath, data, 0644) - if err != nil { - return "", fmt.Errorf("failed to write file: %v", err) - } - - // Return the absolute path of the file - absPath, err := filepath.Abs(filePath) - if err != nil { - return "", fmt.Errorf("failed to get absolute path: %v", err) - } - - return absPath, nil -} diff --git a/agent/agent_test.go b/agent/agent_test.go index 7264363d..d4686ad6 100644 --- a/agent/agent_test.go +++ b/agent/agent_test.go @@ -2,7 +2,7 @@ package agent_test import ( "fmt" - "kyanos/agent" + ac "kyanos/agent/common" "kyanos/agent/compatible" "kyanos/agent/conn" "kyanos/bpf" @@ -15,11 +15,11 @@ import ( "github.com/stretchr/testify/assert" ) -var customAgentOptions agent.AgentOptions = agent.AgentOptions{} +var customAgentOptions ac.AgentOptions = ac.AgentOptions{} func TestMain(m *testing.M) { // call flag.Parse() here if TestMain uses flags] - customAgentOptions = agent.AgentOptions{} + customAgentOptions = ac.AgentOptions{} retCode := m.Run() tearDown() os.Exit(retCode) @@ -586,26 +586,26 @@ func TestSslEventsCanRelatedToKernEvents(t *testing.T) { bpf.AttachSyscallWriteExit, bpf.AttachKProbeSecuritySocketSendmsgEntry, bpf.AttachKProbeSecuritySocketRecvmsgEntry, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTDEV_IN, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTDEV_IN) }, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTUSER_COPY, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTUSER_COPY) }, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTIP_IN, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTIP_IN) }, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTTCP_IN, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTTCP_IN) }, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTIP_OUT, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTIP_OUT) }, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTDEV_OUT, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTDEV_OUT) }, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTQDISC_OUT, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTQDISC_OUT) }, }, &connEventList, @@ -964,8 +964,8 @@ func TestIpXmit(t *testing.T) { bpf.AttachSyscallWriteEntry, bpf.AttachSyscallWriteExit, bpf.AttachKProbeSecuritySocketSendmsgEntry, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTIP_OUT, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTIP_OUT) }, }, "GET TestIpXmit\n", Write, Read, @@ -994,11 +994,11 @@ func TestDevQueueXmit(t *testing.T) { bpf.AttachSyscallWriteEntry, bpf.AttachSyscallWriteExit, bpf.AttachKProbeSecuritySocketSendmsgEntry, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTIP_OUT, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTIP_OUT) }, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTQDISC_OUT, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTQDISC_OUT) }, }, "GET DevQueueXmit\n", Write, Read, FindInterestedKernEventOptions{ @@ -1029,11 +1029,11 @@ func TestDevHardStartXmit(t *testing.T) { bpf.AttachSyscallWriteEntry, bpf.AttachSyscallWriteExit, bpf.AttachKProbeSecuritySocketSendmsgEntry, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTIP_OUT, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTIP_OUT) }, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTDEV_OUT, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTDEV_OUT) }, }, "GET DevHardStartXmit\n", Write, Read, FindInterestedKernEventOptions{ @@ -1110,11 +1110,11 @@ func TestIpRcvCore(t *testing.T) { bpf.AttachSyscallWriteExit, bpf.AttachKProbeSecuritySocketSendmsgEntry, bpf.AttachKProbeSecuritySocketRecvmsgEntry, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTDEV_IN, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTDEV_IN) }, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTIP_IN, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTIP_IN) }, }, FindInterestedKernEventOptions{ @@ -1150,11 +1150,11 @@ func TestTcpV4DoRcv(t *testing.T) { bpf.AttachSyscallWriteExit, bpf.AttachKProbeSecuritySocketSendmsgEntry, bpf.AttachKProbeSecuritySocketRecvmsgEntry, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTDEV_IN, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTDEV_IN) }, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTTCP_IN, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTTCP_IN) }, }, FindInterestedKernEventOptions{ @@ -1190,11 +1190,11 @@ func TestSkbCopyDatagramIter(t *testing.T) { bpf.AttachSyscallWriteExit, bpf.AttachKProbeSecuritySocketSendmsgEntry, bpf.AttachKProbeSecuritySocketRecvmsgEntry, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTDEV_IN, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTDEV_IN) }, - func(p interface{}) link.Link { - return ApplyKernelVersionFunctions(t, bpf.AgentStepTUSER_COPY, p) + func() link.Link { + return ApplyKernelVersionFunctions(t, bpf.AgentStepTUSER_COPY) }, }, FindInterestedKernEventOptions{ diff --git a/agent/agent_utils_test.go b/agent/agent_utils_test.go index 3463a3fc..c5cf2dfd 100644 --- a/agent/agent_utils_test.go +++ b/agent/agent_utils_test.go @@ -9,6 +9,7 @@ import ( "fmt" "io" "kyanos/agent" + ac "kyanos/agent/common" "kyanos/agent/compatible" "kyanos/agent/conn" "kyanos/bpf" @@ -45,13 +46,13 @@ func StartAgent0(bpfAttachFunctions []bpf.AttachBpfProgFunction, wg := sync.WaitGroup{} wg.Add(1) - var loadBpfProgramFunction agent.LoadBpfProgramFunction = nil + var loadBpfProgramFunction ac.LoadBpfProgramFunction = nil if bpfAttachFunctions != nil { - loadBpfProgramFunction = func(objs interface{}) *list.List { + loadBpfProgramFunction = func() *list.List { progs := list.New() for _, each := range bpfAttachFunctions { if each != nil { - progs.PushBack(each(objs)) + progs.PushBack(each()) } } return progs @@ -59,12 +60,12 @@ func StartAgent0(bpfAttachFunctions []bpf.AttachBpfProgFunction, } go func(pid int) { if useSelfPidAsFitler { - cmd.FilterPid = int64(pid) + cmd.FilterPids = []string{strconv.Itoa(pid)} } cmd.DefaultLogLevel = int32(logrus.DebugLevel) cmd.Debug = true cmd.InitLog() - agent.SetupAgent(agent.AgentOptions{ + agent.SetupAgent(ac.AgentOptions{ Stopper: agentStopper, LoadBpfProgramFunction: loadBpfProgramFunction, DisableOpensslUprobe: customAgentOptions.DisableOpensslUprobe, @@ -776,11 +777,11 @@ func min(a, b int) int { // compatilbeMode = b // } -func ApplyKernelVersionFunctions(t *testing.T, step bpf.AgentStepT, programs any) link.Link { +func ApplyKernelVersionFunctions(t *testing.T, step bpf.AgentStepT) link.Link { v := compatible.GetCurrentKernelVersion() if step == bpf.AgentStepTNIC_IN { if v.SupportCapability(compatible.SupportXDP) { - l, err := bpf.AttachXdp(programs) + l, err := bpf.AttachXdp() if err != nil { t.Fatal(err) } else { @@ -798,12 +799,12 @@ func ApplyKernelVersionFunctions(t *testing.T, step bpf.AgentStepT, programs any var err error var l link.Link if function.IsKprobe() { - l, err = bpf.Kprobe(function.GetKprobeName(), bpf.GetProgram(programs, function.BPFGoProgName)) + l, err = bpf.Kprobe(function.GetKprobeName(), bpf.GetProgramFromObjs(bpf.Objs, function.BPFGoProgName)) } else if function.IsTracepoint() { l, err = bpf.Tracepoint(function.GetTracepointGroupName(), function.GetTracepointName(), - bpf.GetProgram(programs, function.BPFGoProgName)) + bpf.GetProgramFromObjs(bpf.Objs, function.BPFGoProgName)) } else if function.IsKRetprobe() { - l, err = bpf.Kretprobe(function.GetKprobeName(), bpf.GetProgram(programs, function.BPFGoProgName)) + l, err = bpf.Kretprobe(function.GetKprobeName(), bpf.GetProgramFromObjs(bpf.Objs, function.BPFGoProgName)) } else { panic(fmt.Sprintf("invalid program type: %v", function)) } diff --git a/agent/analysis/analysis.go b/agent/analysis/analysis.go index 70600540..15c844ba 100644 --- a/agent/analysis/analysis.go +++ b/agent/analysis/analysis.go @@ -2,7 +2,8 @@ package analysis import ( "cmp" - ac "kyanos/agent/common" + "context" + analysis_common "kyanos/agent/analysis/common" "kyanos/agent/protocol" "kyanos/common" "math" @@ -10,55 +11,44 @@ import ( "time" ) -type AnalysisOptions struct { - EnabledMetricTypeSet MetricTypeSet - SampleLimit int - DisplayLimit int - Interval int - Side common.SideEnum - ClassfierType - SortBy LatencyMetric - FullRecordBody bool -} - type aggregator struct { - *AnalysisOptions + *analysis_common.AnalysisOptions *ConnStat } func createAggregatorWithHumanReadableClassId(humanReadableClassId string, - classId ClassId, aggregateOption *AnalysisOptions) *aggregator { + classId ClassId, aggregateOption *analysis_common.AnalysisOptions) *aggregator { aggregator := createAggregator(classId, aggregateOption) aggregator.HumanReadbleClassId = humanReadableClassId return aggregator } -func createAggregator(classId ClassId, aggregateOption *AnalysisOptions) *aggregator { +func createAggregator(classId ClassId, aggregateOption *analysis_common.AnalysisOptions) *aggregator { aggregator := aggregator{} aggregator.reset(classId, aggregateOption) return &aggregator } -func (a *aggregator) reset(classId ClassId, aggregateOption *AnalysisOptions) { +func (a *aggregator) reset(classId ClassId, aggregateOption *analysis_common.AnalysisOptions) { a.AnalysisOptions = aggregateOption a.ConnStat = &ConnStat{ ClassId: classId, ClassfierType: aggregateOption.ClassfierType, } - a.SamplesMap = make(map[MetricType][]*AnnotatedRecord) - a.PercentileCalculators = make(map[MetricType]*PercentileCalculator) - a.MaxMap = make(map[MetricType]float32) - a.SumMap = make(map[MetricType]float64) + a.SamplesMap = make(map[analysis_common.MetricType][]*analysis_common.AnnotatedRecord) + a.PercentileCalculators = make(map[analysis_common.MetricType]*PercentileCalculator) + a.MaxMap = make(map[analysis_common.MetricType]float32) + a.SumMap = make(map[analysis_common.MetricType]float64) for rawMetricType, enabled := range aggregateOption.EnabledMetricTypeSet { if enabled { - metricType := MetricType(rawMetricType) + metricType := analysis_common.MetricType(rawMetricType) a.PercentileCalculators[metricType] = NewPercentileCalculator() - a.SamplesMap[metricType] = make([]*AnnotatedRecord, 0) + a.SamplesMap[metricType] = make([]*analysis_common.AnnotatedRecord, 0) } } } -func (a *aggregator) receive(record *AnnotatedRecord) error { +func (a *aggregator) receive(record *analysis_common.AnnotatedRecord) error { o := a.ConnStat o.Count++ @@ -72,12 +62,12 @@ func (a *aggregator) receive(record *AnnotatedRecord) error { a.ConnStat.Side = record.ConnDesc.Side for rawMetricType, enabled := range a.AnalysisOptions.EnabledMetricTypeSet { - metricType := MetricType(rawMetricType) + metricType := analysis_common.MetricType(rawMetricType) if enabled { samples := a.SamplesMap[metricType] - MetricExtract := GetMetricExtractFunc[float64](metricType) - a.SamplesMap[metricType] = AddToSamples(samples, record, MetricExtract, a.SampleLimit) + MetricExtract := analysis_common.GetMetricExtractFunc[float64](metricType) + a.SamplesMap[metricType] = AddToSamples(samples, record, MetricExtract, a.AnalysisOptions.SampleLimit) metricValue := MetricExtract(record) @@ -91,10 +81,10 @@ func (a *aggregator) receive(record *AnnotatedRecord) error { return nil } -func AddToSamples[T MetricValueType](samples []*AnnotatedRecord, newSample *AnnotatedRecord, extractMetric MetricExtract[T], maxSamplesNum int) []*AnnotatedRecord { +func AddToSamples[T analysis_common.MetricValueType](samples []*analysis_common.AnnotatedRecord, newSample *analysis_common.AnnotatedRecord, extractMetric analysis_common.MetricExtract[T], maxSamplesNum int) []*analysis_common.AnnotatedRecord { result := samples isFull := len(samples) == maxSamplesNum - idx, _ := slices.BinarySearchFunc(samples, newSample, func(o1 *AnnotatedRecord, o2 *AnnotatedRecord) int { + idx, _ := slices.BinarySearchFunc(samples, newSample, func(o1 *analysis_common.AnnotatedRecord, o2 *analysis_common.AnnotatedRecord) int { t1, t2 := extractMetric(o1), extractMetric(o2) return cmp.Compare(t1, t2) }) @@ -112,20 +102,21 @@ func AddToSamples[T MetricValueType](samples []*AnnotatedRecord, newSample *Anno type Analyzer struct { Classfier - *AnalysisOptions + *analysis_common.AnalysisOptions common.SideEnum // 那一边的统计指标TODO 根据参数自动推断 Aggregators map[ClassId]*aggregator - recordsChannel <-chan *AnnotatedRecord + recordsChannel <-chan *analysis_common.AnnotatedRecord stopper <-chan int resultChannel chan<- []*ConnStat renderStopper chan int ticker *time.Ticker tickerC <-chan time.Time + ctx context.Context } -func CreateAnalyzer(recordsChannel <-chan *AnnotatedRecord, showOption *AnalysisOptions, resultChannel chan<- []*ConnStat, renderStopper chan int) *Analyzer { +func CreateAnalyzer(recordsChannel <-chan *analysis_common.AnnotatedRecord, showOption *analysis_common.AnalysisOptions, resultChannel chan<- []*ConnStat, renderStopper chan int, ctx context.Context) *Analyzer { stopper := make(chan int) - ac.AddToFastStopper(stopper) + // ac.AddToFastStopper(stopper) analyzer := &Analyzer{ Classfier: getClassfier(showOption.ClassfierType), recordsChannel: recordsChannel, @@ -147,7 +138,8 @@ func CreateAnalyzer(recordsChannel <-chan *AnnotatedRecord, showOption *Analysis func (a *Analyzer) Run() { for { select { - case <-a.stopper: + // case <-a.stopper: + case <-a.ctx.Done(): if a.AnalysisOptions.Interval == 0 { a.resultChannel <- a.harvest() time.Sleep(1 * time.Second) @@ -166,19 +158,19 @@ func (a *Analyzer) harvest() []*ConnStat { result := make([]*ConnStat, 0) for _, aggregator := range a.Aggregators { connstat := aggregator.ConnStat - // aggregator.reset(classId, a.AnalysisOptions) + // aggregator.reset(classId, a.analysis_common.AnalysisOptions) result = append(result, connstat) } a.Aggregators = make(map[ClassId]*aggregator) return result } -func (a *Analyzer) analyze(record *AnnotatedRecord) { +func (a *Analyzer) analyze(record *analysis_common.AnnotatedRecord) { class, err := a.Classfier(record) if err == nil { aggregator, exists := a.Aggregators[class] if !exists { - humanReadableFunc, ok := classIdHumanReadableMap[a.ClassfierType] + humanReadableFunc, ok := classIdHumanReadableMap[a.AnalysisOptions.ClassfierType] if ok { humanReadableClassId := humanReadableFunc(record) a.Aggregators[class] = createAggregatorWithHumanReadableClassId(humanReadableClassId, diff --git a/agent/analysis/classfier.go b/agent/analysis/classfier.go index 632057e4..81e773ac 100644 --- a/agent/analysis/classfier.go +++ b/agent/analysis/classfier.go @@ -2,16 +2,16 @@ package analysis import ( "fmt" + + anc "kyanos/agent/analysis/common" "kyanos/agent/protocol" "kyanos/bpf" ) -type ClassfierType int - -type Classfier func(*AnnotatedRecord) (ClassId, error) -type ClassIdAsHumanReadable func(*AnnotatedRecord) string +type Classfier func(*anc.AnnotatedRecord) (ClassId, error) +type ClassIdAsHumanReadable func(*anc.AnnotatedRecord) string -var ClassfierTypeNames = map[ClassfierType]string{ +var ClassfierTypeNames = map[anc.ClassfierType]string{ None: "none", Conn: "conn", RemotePort: "remote-port", @@ -23,7 +23,7 @@ var ClassfierTypeNames = map[ClassfierType]string{ } const ( - None ClassfierType = iota + None anc.ClassfierType = iota Conn RemotePort LocalPort @@ -39,25 +39,25 @@ const ( type ClassId string -var classfierMap map[ClassfierType]Classfier -var classIdHumanReadableMap map[ClassfierType]ClassIdAsHumanReadable +var classfierMap map[anc.ClassfierType]Classfier +var classIdHumanReadableMap map[anc.ClassfierType]ClassIdAsHumanReadable func init() { - classfierMap = make(map[ClassfierType]Classfier) - classfierMap[None] = func(ar *AnnotatedRecord) (ClassId, error) { return "none", nil } - classfierMap[Conn] = func(ar *AnnotatedRecord) (ClassId, error) { + classfierMap = make(map[anc.ClassfierType]Classfier) + classfierMap[None] = func(ar *anc.AnnotatedRecord) (ClassId, error) { return "none", nil } + classfierMap[Conn] = func(ar *anc.AnnotatedRecord) (ClassId, error) { return ClassId(ar.ConnDesc.Identity()), nil } - classfierMap[RemotePort] = func(ar *AnnotatedRecord) (ClassId, error) { return ClassId(fmt.Sprintf("%d", ar.RemotePort)), nil } - classfierMap[LocalPort] = func(ar *AnnotatedRecord) (ClassId, error) { return ClassId(fmt.Sprintf("%d", ar.LocalPort)), nil } - classfierMap[RemoteIp] = func(ar *AnnotatedRecord) (ClassId, error) { return ClassId(ar.RemoteAddr.String()), nil } - classfierMap[Protocol] = func(ar *AnnotatedRecord) (ClassId, error) { return ClassId(fmt.Sprintf("%d", ar.Protocol)), nil } + classfierMap[RemotePort] = func(ar *anc.AnnotatedRecord) (ClassId, error) { return ClassId(fmt.Sprintf("%d", ar.RemotePort)), nil } + classfierMap[LocalPort] = func(ar *anc.AnnotatedRecord) (ClassId, error) { return ClassId(fmt.Sprintf("%d", ar.LocalPort)), nil } + classfierMap[RemoteIp] = func(ar *anc.AnnotatedRecord) (ClassId, error) { return ClassId(ar.RemoteAddr.String()), nil } + classfierMap[Protocol] = func(ar *anc.AnnotatedRecord) (ClassId, error) { return ClassId(fmt.Sprintf("%d", ar.Protocol)), nil } - classIdHumanReadableMap = make(map[ClassfierType]ClassIdAsHumanReadable) - classIdHumanReadableMap[Conn] = func(ar *AnnotatedRecord) string { + classIdHumanReadableMap = make(map[anc.ClassfierType]ClassIdAsHumanReadable) + classIdHumanReadableMap[Conn] = func(ar *anc.AnnotatedRecord) string { return ar.ConnDesc.String() } - classIdHumanReadableMap[HttpPath] = func(ar *AnnotatedRecord) string { + classIdHumanReadableMap[HttpPath] = func(ar *anc.AnnotatedRecord) string { httpReq, ok := ar.Record.Request().(*protocol.ParsedHttpRequest) if !ok { return "__not_a_http_req__" @@ -66,11 +66,11 @@ func init() { } } - classIdHumanReadableMap[Protocol] = func(ar *AnnotatedRecord) string { + classIdHumanReadableMap[Protocol] = func(ar *anc.AnnotatedRecord) string { return bpf.ProtocolNamesMap[bpf.AgentTrafficProtocolT(ar.Protocol)] } } -func getClassfier(classfierType ClassfierType) Classfier { +func getClassfier(classfierType anc.ClassfierType) Classfier { return classfierMap[classfierType] } diff --git a/agent/analysis/common/types.go b/agent/analysis/common/types.go new file mode 100644 index 00000000..7efe21f2 --- /dev/null +++ b/agent/analysis/common/types.go @@ -0,0 +1,233 @@ +package common + +import ( + "fmt" + "kyanos/agent/protocol" + "kyanos/common" + ac "kyanos/common" + + "golang.org/x/exp/constraints" +) + +type AnalysisOptions struct { + EnabledMetricTypeSet MetricTypeSet + SampleLimit int + DisplayLimit int + Interval int + Side ac.SideEnum + ClassfierType + SortBy LatencyMetric + FullRecordBody bool +} + +type ClassfierType int + +type MetricType int + +type MetricValueType interface { + constraints.Integer | constraints.Float +} + +type MetricTypeSet map[MetricType]bool + +func NewMetricTypeSet(metricTypes []MetricType) MetricTypeSet { + result := make(map[MetricType]bool) + for _, t := range metricTypes { + result[t] = true + } + return result +} + +func (m MetricTypeSet) AllEnabledMetrciType() []MetricType { + var result []MetricType + for metricType, enabled := range m { + if enabled { + result = append(result, metricType) + } + } + return result +} + +func (m MetricTypeSet) GetFirstEnabledMetricType() MetricType { + for metricType, enabled := range m { + if enabled { + return metricType + } + } + return NoneType +} + +type MetricExtract[T MetricValueType] func(*AnnotatedRecord) T + +const ( + ResponseSize MetricType = iota + RequestSize + TotalDuration + BlackBoxDuration + ReadFromSocketBufferDuration + NoneType +) + +func GetMetricExtractFunc[T MetricValueType](t MetricType) MetricExtract[T] { + switch t { + case ResponseSize: + return func(ar *AnnotatedRecord) T { + return T(ar.RespSize) + } + case RequestSize: + return func(ar *AnnotatedRecord) T { return T(ar.ReqSize) } + case TotalDuration: + return func(ar *AnnotatedRecord) T { return T(ar.GetTotalDurationMills()) } + case BlackBoxDuration: + return func(ar *AnnotatedRecord) T { return T(ar.GetBlackBoxDurationMills()) } + case ReadFromSocketBufferDuration: + return func(ar *AnnotatedRecord) T { return T(ar.GetReadFromSocketBufferDurationMills()) } + default: + return func(ar *AnnotatedRecord) T { return T(ar.GetTotalDurationMills()) } + } +} + +type LatencyMetric int + +const ( + Avg LatencyMetric = iota + Max + P50 + P90 + P99 +) + +type AnnotatedRecord struct { + common.ConnDesc + protocol.Record + StartTs uint64 + EndTs uint64 + ReqPlainTextSize int + RespPlainTextSize int + ReqSize int + RespSize int + TotalDuration float64 + BlackBoxDuration float64 + ReadFromSocketBufferDuration float64 + ReqSyscallEventDetails []SyscallEventDetail + RespSyscallEventDetails []SyscallEventDetail + ReqNicEventDetails []NicEventDetail + RespNicEventDetails []NicEventDetail +} + +func (a *AnnotatedRecord) GetTotalDurationMills() float64 { + return common.NanoToMills(int32(a.TotalDuration)) +} + +func (a *AnnotatedRecord) GetBlackBoxDurationMills() float64 { + return common.NanoToMills(int32(a.BlackBoxDuration)) +} + +func (a *AnnotatedRecord) GetReadFromSocketBufferDurationMills() float64 { + return common.NanoToMills(int32(a.ReadFromSocketBufferDuration)) +} + +type SyscallEventDetail PacketEventDetail +type NicEventDetail PacketEventDetail +type PacketEventDetail struct { + ByteSize int + Timestamp uint64 +} + +func (r *AnnotatedRecord) BlackboxName() string { + if r.ConnDesc.Side == common.ServerSide { + return "process internal duration" + } else { + return "network duration" + } +} + +func (r *AnnotatedRecord) SyscallDisplayName(isReq bool) string { + if isReq { + if r.ConnDesc.Side == common.ServerSide { + return "read" + } else { + return "write" + } + } else { + if r.ConnDesc.Side == common.ServerSide { + return "write" + } else { + return "read" + } + } +} + +type AnnotatedRecordToStringOptions struct { + Nano bool + protocol.RecordToStringOptions + MetricTypeSet + IncludeSyscallStat bool + IncludeConnDesc bool +} + +func (r *AnnotatedRecord) String(options AnnotatedRecordToStringOptions) string { + nano := options.Nano + var result string + result += r.Record.String(options.RecordToStringOptions) + result += "\n" + if options.IncludeConnDesc { + result += fmt.Sprintf("[conn] [local addr]=%s:%d [remote addr]=%s:%d [side]=%s [ssl]=%v\n", + r.LocalAddr.String(), r.LocalPort, r.RemoteAddr.String(), r.RemotePort, r.Side.String(), r.IsSsl) + } + if _, ok := options.MetricTypeSet[TotalDuration]; ok { + result += fmt.Sprintf("[total duration] = %.3f(%s)(start=%s, end=%s)\n", common.ConvertDurationToMillisecondsIfNeeded(float64(r.TotalDuration), nano), timeUnitName(nano), + common.FormatTimestampWithPrecision(r.StartTs, nano), + common.FormatTimestampWithPrecision(r.EndTs, nano)) + } + if _, ok := options.MetricTypeSet[ReadFromSocketBufferDuration]; ok { + result += fmt.Sprintf("[read from sockbuf]=%.3f(%s)\n", common.ConvertDurationToMillisecondsIfNeeded(float64(r.ReadFromSocketBufferDuration), nano), + timeUnitName(nano)) + } + if _, ok := options.MetricTypeSet[BlackBoxDuration]; ok { + result += fmt.Sprintf("[%s]=%.3f(%s)\n", r.BlackboxName(), + common.ConvertDurationToMillisecondsIfNeeded(float64(r.BlackBoxDuration), nano), + timeUnitName(nano)) + } + + if options.IncludeSyscallStat { + result += fmt.Sprintf("[syscall] [%s count]=%d [%s bytes]=%d [%s count]=%d [%s bytes]=%d\n", + r.SyscallDisplayName(true), len(r.ReqSyscallEventDetails), + r.SyscallDisplayName(true), r.ReqSize, + r.SyscallDisplayName(false), len(r.RespSyscallEventDetails), + r.SyscallDisplayName(false), r.RespSize) + if r.ConnDesc.IsSsl { + result += fmt.Sprintf("[ssl][plaintext] [%s bytes]=%d [%s bytes]=%d\n", r.SyscallDisplayName(true), r.ReqPlainTextSize, + r.SyscallDisplayName(false), r.RespPlainTextSize) + } + result += "\n" + } else { + if _, ok := options.MetricTypeSet[RequestSize]; ok { + result += fmt.Sprintf("[syscall] [%s count]=%d [%s bytes]=%d", + r.SyscallDisplayName(true), len(r.ReqSyscallEventDetails), + r.SyscallDisplayName(true), r.ReqSize) + if r.ConnDesc.IsSsl { + result += fmt.Sprintf("[plaintext bytes]=%d", r.ReqPlainTextSize) + } + result += "\n" + } + if _, ok := options.MetricTypeSet[ResponseSize]; ok { + result += fmt.Sprintf("[syscall] [%s count]=%d [%s bytes]=%d", + r.SyscallDisplayName(false), len(r.RespSyscallEventDetails), + r.SyscallDisplayName(false), r.RespSize) + if r.ConnDesc.IsSsl { + result += fmt.Sprintf("[plaintext bytes]=%d", r.RespPlainTextSize) + } + result += "\n" + } + } + return result +} + +func timeUnitName(nano bool) string { + if nano { + return "ns" + } else { + return "ms" + } +} diff --git a/agent/analysis/stat.go b/agent/analysis/stat.go index 3ad6024b..1e358c83 100644 --- a/agent/analysis/stat.go +++ b/agent/analysis/stat.go @@ -1,11 +1,10 @@ package analysis import ( - "fmt" + analysisCommon "kyanos/agent/analysis/common" "kyanos/agent/conn" "kyanos/agent/protocol" "kyanos/bpf" - "kyanos/common" . "kyanos/common" "github.com/jefurry/logrus" @@ -21,118 +20,22 @@ func InitStatRecorder() *StatRecorder { return sr } -type AnnotatedRecord struct { - ConnDesc - protocol.Record - startTs uint64 - endTs uint64 - reqPlainTextSize int - respPlainTextSize int - reqSize int - respSize int - totalDuration float64 - blackBoxDuration float64 - readFromSocketBufferDuration float64 - reqSyscallEventDetails []SyscallEventDetail - respSyscallEventDetails []SyscallEventDetail - reqNicEventDetails []NicEventDetail - respNicEventDetails []NicEventDetail -} - -func (a *AnnotatedRecord) GetTotalDurationMills() float64 { - return common.NanoToMills(int32(a.totalDuration)) -} - -func (a *AnnotatedRecord) GetBlackBoxDurationMills() float64 { - return common.NanoToMills(int32(a.blackBoxDuration)) -} - -func (a *AnnotatedRecord) GetReadFromSocketBufferDurationMills() float64 { - return common.NanoToMills(int32(a.readFromSocketBufferDuration)) -} - -func CreateAnnotedRecord() *AnnotatedRecord { - return &AnnotatedRecord{ - startTs: 0, - endTs: 0, - reqSize: -1, - respSize: -1, - totalDuration: -1, - blackBoxDuration: -1, - readFromSocketBufferDuration: -1, - reqSyscallEventDetails: make([]SyscallEventDetail, 0), - respSyscallEventDetails: make([]SyscallEventDetail, 0), - reqNicEventDetails: make([]NicEventDetail, 0), - respNicEventDetails: make([]NicEventDetail, 0), +func CreateAnnotedRecord() *analysisCommon.AnnotatedRecord { + return &analysisCommon.AnnotatedRecord{ + StartTs: 0, + EndTs: 0, + ReqSize: -1, + RespSize: -1, + TotalDuration: -1, + BlackBoxDuration: -1, + ReadFromSocketBufferDuration: -1, + ReqSyscallEventDetails: make([]analysisCommon.SyscallEventDetail, 0), + RespSyscallEventDetails: make([]analysisCommon.SyscallEventDetail, 0), + ReqNicEventDetails: make([]analysisCommon.NicEventDetail, 0), + RespNicEventDetails: make([]analysisCommon.NicEventDetail, 0), } } -type AnnotatedRecordToStringOptions struct { - Nano bool - protocol.RecordToStringOptions - MetricTypeSet - IncludeSyscallStat bool - IncludeConnDesc bool -} - -func (r *AnnotatedRecord) String(options AnnotatedRecordToStringOptions) string { - nano := options.Nano - var result string - result += r.Record.String(options.RecordToStringOptions) - result += "\n" - if options.IncludeConnDesc { - result += fmt.Sprintf("[conn] [local addr]=%s:%d [remote addr]=%s:%d [side]=%s [ssl]=%v\n", - r.LocalAddr.String(), r.LocalPort, r.RemoteAddr.String(), r.RemotePort, r.Side.String(), r.IsSsl) - } - if _, ok := options.MetricTypeSet[TotalDuration]; ok { - result += fmt.Sprintf("[total duration] = %.3f(%s)(start=%s, end=%s)\n", common.ConvertDurationToMillisecondsIfNeeded(float64(r.totalDuration), nano), timeUnitName(nano), - common.FormatTimestampWithPrecision(r.startTs, nano), - common.FormatTimestampWithPrecision(r.endTs, nano)) - } - if _, ok := options.MetricTypeSet[ReadFromSocketBufferDuration]; ok { - result += fmt.Sprintf("[read from sockbuf]=%.3f(%s)\n", common.ConvertDurationToMillisecondsIfNeeded(float64(r.readFromSocketBufferDuration), nano), - timeUnitName(nano)) - } - if _, ok := options.MetricTypeSet[BlackBoxDuration]; ok { - result += fmt.Sprintf("[%s]=%.3f(%s)\n", r.blackboxName(), - common.ConvertDurationToMillisecondsIfNeeded(float64(r.blackBoxDuration), nano), - timeUnitName(nano)) - } - - if options.IncludeSyscallStat { - result += fmt.Sprintf("[syscall] [%s count]=%d [%s bytes]=%d [%s count]=%d [%s bytes]=%d\n", - r.syscallDisplayName(true), len(r.reqSyscallEventDetails), - r.syscallDisplayName(true), r.reqSize, - r.syscallDisplayName(false), len(r.respSyscallEventDetails), - r.syscallDisplayName(false), r.respSize) - if r.ConnDesc.IsSsl { - result += fmt.Sprintf("[ssl][plaintext] [%s bytes]=%d [%s bytes]=%d\n", r.syscallDisplayName(true), r.reqPlainTextSize, - r.syscallDisplayName(false), r.respPlainTextSize) - } - result += "\n" - } else { - if _, ok := options.MetricTypeSet[RequestSize]; ok { - result += fmt.Sprintf("[syscall] [%s count]=%d [%s bytes]=%d", - r.syscallDisplayName(true), len(r.reqSyscallEventDetails), - r.syscallDisplayName(true), r.reqSize) - if r.ConnDesc.IsSsl { - result += fmt.Sprintf("[plaintext bytes]=%d", r.reqPlainTextSize) - } - result += "\n" - } - if _, ok := options.MetricTypeSet[ResponseSize]; ok { - result += fmt.Sprintf("[syscall] [%s count]=%d [%s bytes]=%d", - r.syscallDisplayName(false), len(r.respSyscallEventDetails), - r.syscallDisplayName(false), r.respSize) - if r.ConnDesc.IsSsl { - result += fmt.Sprintf("[plaintext bytes]=%d", r.respPlainTextSize) - } - result += "\n" - } - } - return result -} - func timeUnitName(nano bool) string { if nano { return "ns" @@ -141,37 +44,6 @@ func timeUnitName(nano bool) string { } } -func (r *AnnotatedRecord) blackboxName() string { - if r.ConnDesc.Side == ServerSide { - return "process internal duration" - } else { - return "network duration" - } -} - -func (r *AnnotatedRecord) syscallDisplayName(isReq bool) string { - if isReq { - if r.ConnDesc.Side == ServerSide { - return "read" - } else { - return "write" - } - } else { - if r.ConnDesc.Side == ServerSide { - return "write" - } else { - return "read" - } - } -} - -type SyscallEventDetail PacketEventDetail -type NicEventDetail PacketEventDetail -type PacketEventDetail struct { - byteSize int - timestamp uint64 -} - type events struct { sslWriteSyscallEvents []conn.SslEvent sslReadSyscallEvents []conn.SslEvent @@ -276,7 +148,7 @@ func prepareEvents(r protocol.Record, connection *conn.Connection4) *events { return &events } -func (s *StatRecorder) ReceiveRecord(r protocol.Record, connection *conn.Connection4, recordsChannel chan<- *AnnotatedRecord) error { +func (s *StatRecorder) ReceiveRecord(r protocol.Record, connection *conn.Connection4, recordsChannel chan<- *analysisCommon.AnnotatedRecord) error { streamEvents := connection.StreamEvents annotatedRecord := CreateAnnotedRecord() annotatedRecord.Record = r @@ -305,76 +177,76 @@ func (s *StatRecorder) ReceiveRecord(r protocol.Record, connection *conn.Connect hasTcpInEvents := len(events.tcpInEvents) > 0 if connection.IsServerSide() { if hasNicInEvents { - annotatedRecord.startTs = events.nicIngressEvents[0].GetTimestamp() + annotatedRecord.StartTs = events.nicIngressEvents[0].GetTimestamp() } if hasDevOutEvents { - annotatedRecord.endTs = events.devOutEvents[len(events.devOutEvents)-1].GetTimestamp() + annotatedRecord.EndTs = events.devOutEvents[len(events.devOutEvents)-1].GetTimestamp() } if connection.IsSsl() { - annotatedRecord.reqPlainTextSize = events.ingressMessage.ByteSize() - annotatedRecord.respPlainTextSize = events.egressMessage.ByteSize() + annotatedRecord.ReqPlainTextSize = events.ingressMessage.ByteSize() + annotatedRecord.RespPlainTextSize = events.egressMessage.ByteSize() } - annotatedRecord.reqSize = events.ingressKernLen - annotatedRecord.respSize = events.egressKernLen + annotatedRecord.ReqSize = events.ingressKernLen + annotatedRecord.RespSize = events.egressKernLen if hasNicInEvents && hasDevOutEvents { - annotatedRecord.totalDuration = float64(annotatedRecord.endTs) - float64(annotatedRecord.startTs) + annotatedRecord.TotalDuration = float64(annotatedRecord.EndTs) - float64(annotatedRecord.StartTs) } if hasReadSyscallEvents && hasWriteSyscallEvents { - annotatedRecord.blackBoxDuration = float64(events.writeSyscallEvents[len(events.writeSyscallEvents)-1].GetTimestamp()) - float64(events.readSyscallEvents[0].GetTimestamp()) + annotatedRecord.BlackBoxDuration = float64(events.writeSyscallEvents[len(events.writeSyscallEvents)-1].GetTimestamp()) - float64(events.readSyscallEvents[0].GetTimestamp()) } else { - annotatedRecord.blackBoxDuration = float64(events.egressMessage.TimestampNs()) - float64(events.ingressMessage.TimestampNs()) + annotatedRecord.BlackBoxDuration = float64(events.egressMessage.TimestampNs()) - float64(events.ingressMessage.TimestampNs()) } if hasUserCopyEvents && hasTcpInEvents { - annotatedRecord.readFromSocketBufferDuration = float64(events.userCopyEvents[len(events.userCopyEvents)-1].GetTimestamp()) - float64(events.tcpInEvents[0].GetTimestamp()) + annotatedRecord.ReadFromSocketBufferDuration = float64(events.userCopyEvents[len(events.userCopyEvents)-1].GetTimestamp()) - float64(events.tcpInEvents[0].GetTimestamp()) } - annotatedRecord.reqSyscallEventDetails = KernEventsToEventDetails[SyscallEventDetail](events.readSyscallEvents) - annotatedRecord.respSyscallEventDetails = KernEventsToEventDetails[SyscallEventDetail](events.writeSyscallEvents) - annotatedRecord.reqNicEventDetails = KernEventsToEventDetails[NicEventDetail](events.nicIngressEvents) - annotatedRecord.respNicEventDetails = KernEventsToEventDetails[NicEventDetail](events.devOutEvents) + annotatedRecord.ReqSyscallEventDetails = KernEventsToEventDetails[analysisCommon.SyscallEventDetail](events.readSyscallEvents) + annotatedRecord.RespSyscallEventDetails = KernEventsToEventDetails[analysisCommon.SyscallEventDetail](events.writeSyscallEvents) + annotatedRecord.ReqNicEventDetails = KernEventsToEventDetails[analysisCommon.NicEventDetail](events.nicIngressEvents) + annotatedRecord.RespNicEventDetails = KernEventsToEventDetails[analysisCommon.NicEventDetail](events.devOutEvents) } else { if hasWriteSyscallEvents { - annotatedRecord.startTs = events.writeSyscallEvents[0].GetTimestamp() + annotatedRecord.StartTs = events.writeSyscallEvents[0].GetTimestamp() } else { - annotatedRecord.startTs = events.egressMessage.TimestampNs() + annotatedRecord.StartTs = events.egressMessage.TimestampNs() } if hasReadSyscallEvents { - annotatedRecord.endTs = events.readSyscallEvents[len(events.readSyscallEvents)-1].GetTimestamp() + annotatedRecord.EndTs = events.readSyscallEvents[len(events.readSyscallEvents)-1].GetTimestamp() } else { - annotatedRecord.endTs = events.ingressMessage.TimestampNs() + annotatedRecord.EndTs = events.ingressMessage.TimestampNs() } if connection.IsSsl() { - annotatedRecord.reqPlainTextSize = events.egressMessage.ByteSize() - annotatedRecord.respPlainTextSize = events.ingressMessage.ByteSize() + annotatedRecord.ReqPlainTextSize = events.egressMessage.ByteSize() + annotatedRecord.RespPlainTextSize = events.ingressMessage.ByteSize() } - annotatedRecord.reqSize = events.egressKernLen - annotatedRecord.respSize = events.ingressKernLen + annotatedRecord.ReqSize = events.egressKernLen + annotatedRecord.RespSize = events.ingressKernLen if hasReadSyscallEvents && hasWriteSyscallEvents { - annotatedRecord.totalDuration = float64(annotatedRecord.endTs) - float64(annotatedRecord.startTs) + annotatedRecord.TotalDuration = float64(annotatedRecord.EndTs) - float64(annotatedRecord.StartTs) } else { - annotatedRecord.totalDuration = float64(events.ingressMessage.TimestampNs()) - float64(events.egressMessage.TimestampNs()) + annotatedRecord.TotalDuration = float64(events.ingressMessage.TimestampNs()) - float64(events.egressMessage.TimestampNs()) } if hasNicInEvents && hasDevOutEvents { - annotatedRecord.blackBoxDuration = float64(events.nicIngressEvents[len(events.nicIngressEvents)-1].GetTimestamp()) - float64(events.devOutEvents[0].GetTimestamp()) + annotatedRecord.BlackBoxDuration = float64(events.nicIngressEvents[len(events.nicIngressEvents)-1].GetTimestamp()) - float64(events.devOutEvents[0].GetTimestamp()) } if hasUserCopyEvents && hasTcpInEvents { - annotatedRecord.readFromSocketBufferDuration = float64(events.userCopyEvents[len(events.userCopyEvents)-1].GetTimestamp()) - float64(events.tcpInEvents[0].GetTimestamp()) + annotatedRecord.ReadFromSocketBufferDuration = float64(events.userCopyEvents[len(events.userCopyEvents)-1].GetTimestamp()) - float64(events.tcpInEvents[0].GetTimestamp()) } - annotatedRecord.reqSyscallEventDetails = KernEventsToEventDetails[SyscallEventDetail](events.writeSyscallEvents) - annotatedRecord.respSyscallEventDetails = KernEventsToEventDetails[SyscallEventDetail](events.readSyscallEvents) - annotatedRecord.reqNicEventDetails = KernEventsToEventDetails[NicEventDetail](events.devOutEvents) - annotatedRecord.respNicEventDetails = KernEventsToEventDetails[NicEventDetail](events.nicIngressEvents) + annotatedRecord.ReqSyscallEventDetails = KernEventsToEventDetails[analysisCommon.SyscallEventDetail](events.writeSyscallEvents) + annotatedRecord.RespSyscallEventDetails = KernEventsToEventDetails[analysisCommon.SyscallEventDetail](events.readSyscallEvents) + annotatedRecord.ReqNicEventDetails = KernEventsToEventDetails[analysisCommon.NicEventDetail](events.devOutEvents) + annotatedRecord.RespNicEventDetails = KernEventsToEventDetails[analysisCommon.NicEventDetail](events.nicIngressEvents) } streamEvents.DiscardEventsBySeq(events.egressKernSeq+uint64(events.egressKernLen), true) streamEvents.DiscardEventsBySeq(events.ingressKernSeq+uint64(events.ingressKernLen), false) if recordsChannel == nil { - outputLog.Infoln(annotatedRecord.String(AnnotatedRecordToStringOptions{ + outputLog.Infoln(annotatedRecord.String(analysisCommon.AnnotatedRecordToStringOptions{ Nano: false, - MetricTypeSet: MetricTypeSet{ - ResponseSize: false, - RequestSize: false, - ReadFromSocketBufferDuration: true, - BlackBoxDuration: true, - TotalDuration: true, + MetricTypeSet: analysisCommon.MetricTypeSet{ + analysisCommon.ResponseSize: false, + analysisCommon.RequestSize: false, + analysisCommon.ReadFromSocketBufferDuration: true, + analysisCommon.BlackBoxDuration: true, + analysisCommon.TotalDuration: true, }, IncludeSyscallStat: true, IncludeConnDesc: true, RecordToStringOptions: protocol.RecordToStringOptions{ @@ -389,15 +261,15 @@ func (s *StatRecorder) ReceiveRecord(r protocol.Record, connection *conn.Connect return nil } -func KernEventsToEventDetails[k PacketEventDetail | SyscallEventDetail | NicEventDetail](kernEvents []conn.KernEvent) []k { +func KernEventsToEventDetails[K analysisCommon.PacketEventDetail | analysisCommon.SyscallEventDetail | analysisCommon.NicEventDetail](kernEvents []conn.KernEvent) []K { if len(kernEvents) == 0 { - return []k{} + return []K{} } - result := make([]k, 0) + result := make([]K, 0) for _, each := range kernEvents { - result = append(result, k{ - byteSize: each.GetLen(), - timestamp: each.GetTimestamp(), + result = append(result, K{ + ByteSize: each.GetLen(), + Timestamp: each.GetTimestamp(), }) } return result diff --git a/agent/analysis/types.go b/agent/analysis/types.go index 9ef860bc..541f8be0 100644 --- a/agent/analysis/types.go +++ b/agent/analysis/types.go @@ -1,89 +1,23 @@ package analysis import ( + anc "kyanos/agent/analysis/common" "kyanos/common" - - "golang.org/x/exp/constraints" ) -type MetricType int - -type MetricValueType interface { - constraints.Integer | constraints.Float -} - -type MetricTypeSet map[MetricType]bool - -func NewMetricTypeSet(metricTypes []MetricType) MetricTypeSet { - result := make(map[MetricType]bool) - for _, t := range metricTypes { - result[t] = true - } - return result -} - -func (m MetricTypeSet) AllEnabledMetrciType() []MetricType { - var result []MetricType - for metricType, enabled := range m { - if enabled { - result = append(result, metricType) - } - } - return result -} - -func (m MetricTypeSet) GetFirstEnabledMetricType() MetricType { - for metricType, enabled := range m { - if enabled { - return metricType - } - } - return NoneType -} - -type MetricExtract[T MetricValueType] func(*AnnotatedRecord) T - -const ( - ResponseSize MetricType = iota - RequestSize - TotalDuration - BlackBoxDuration - ReadFromSocketBufferDuration - NoneType -) - -func GetMetricExtractFunc[T MetricValueType](t MetricType) MetricExtract[T] { - switch t { - case ResponseSize: - return func(ar *AnnotatedRecord) T { - return T(ar.respSize) - } - case RequestSize: - return func(ar *AnnotatedRecord) T { return T(ar.reqSize) } - case TotalDuration: - return func(ar *AnnotatedRecord) T { return T(ar.GetTotalDurationMills()) } - case BlackBoxDuration: - return func(ar *AnnotatedRecord) T { return T(ar.GetBlackBoxDurationMills()) } - case ReadFromSocketBufferDuration: - return func(ar *AnnotatedRecord) T { return T(ar.GetReadFromSocketBufferDurationMills()) } - default: - return func(ar *AnnotatedRecord) T { return T(ar.GetTotalDurationMills()) } - } -} - type ConnStat struct { Count int FailedCount int - SamplesMap map[MetricType][]*AnnotatedRecord - PercentileCalculators map[MetricType]*PercentileCalculator + SamplesMap map[anc.MetricType][]*anc.AnnotatedRecord + PercentileCalculators map[anc.MetricType]*PercentileCalculator // AvgMap map[MetricType]float32 - MaxMap map[MetricType]float32 - SumMap map[MetricType]float64 + MaxMap map[anc.MetricType]float32 + SumMap map[anc.MetricType]float64 Side common.SideEnum ClassId ClassId HumanReadbleClassId string - ClassfierType ClassfierType + ClassfierType anc.ClassfierType } func (c *ConnStat) ClassIdAsHumanReadable(classId ClassId) string { @@ -105,25 +39,25 @@ func (c *ConnStat) ClassIdAsHumanReadable(classId ClassId) string { } } -func (c *ConnStat) GetValueByMetricType(l LatencyMetric, m MetricType) float64 { - if l == Avg { +func (c *ConnStat) GetValueByMetricType(l anc.LatencyMetric, m anc.MetricType) float64 { + if l == anc.Avg { sum, ok := c.SumMap[m] if !ok { return 0 } return sum / float64(c.Count) - } else if l == Max { + } else if l == anc.Max { max, ok := c.MaxMap[m] if !ok { return 0 } return float64(max) - } else if l == P50 || l == P90 || l == P99 { + } else if l == anc.P50 || l == anc.P90 || l == anc.P99 { var percent float32 - if l == P50 { + if l == anc.P50 { percent = 0.5 - } else if l == P90 { + } else if l == anc.P90 { percent = 0.90 } else { percent = 0.99 @@ -137,13 +71,3 @@ func (c *ConnStat) GetValueByMetricType(l LatencyMetric, m MetricType) float64 { panic("Not implemneted!") } } - -type LatencyMetric int - -const ( - Avg LatencyMetric = iota - Max - P50 - P90 - P99 -) diff --git a/agent/common/objects.go b/agent/common/objects.go new file mode 100644 index 00000000..91f4bf4f --- /dev/null +++ b/agent/common/objects.go @@ -0,0 +1,5 @@ +package common + +import "github.com/cilium/ebpf" + +var CollectionOpts *ebpf.CollectionOptions diff --git a/agent/common/options.go b/agent/common/options.go new file mode 100644 index 00000000..0fa5088c --- /dev/null +++ b/agent/common/options.go @@ -0,0 +1,119 @@ +package common + +import ( + "container/list" + "context" + "fmt" + anc "kyanos/agent/analysis/common" + "kyanos/agent/compatible" + "kyanos/agent/conn" + "kyanos/agent/metadata" + "kyanos/agent/protocol" + "kyanos/bpf" + "kyanos/common" + "os" + "runtime" + "strings" +) + +type LoadBpfProgramFunction func() *list.List +type InitCompletedHook func() +type ConnManagerInitHook func(*conn.ConnManager) + +const perfEventDataBufferSize = 30 * 1024 * 1024 +const perfEventControlBufferSize = 1 * 1024 * 1024 + +type AgentOptions struct { + Stopper chan os.Signal + CustomSyscallEventHook bpf.SyscallEventHook + CustomConnEventHook bpf.ConnEventHook + CustomKernEventHook bpf.KernEventHook + CustomSslEventHook bpf.SslEventHook + InitCompletedHook InitCompletedHook + ConnManagerInitHook ConnManagerInitHook + LoadBpfProgramFunction LoadBpfProgramFunction + ProcessorsNum int + MessageFilter protocol.ProtocolFilter + LatencyFilter protocol.LatencyFilter + TraceSide common.SideEnum + IfName string + BTFFilePath string + BPFVerifyLogSize int + protocol.SizeFilter + AnalysisEnable bool + anc.AnalysisOptions + PerfEventBufferSizeForData int + PerfEventBufferSizeForEvent int + DisableOpensslUprobe bool + + DockerEndpoint string + ContainerdEndpoint string + CriRuntimeEndpoint string + ContainerId string + ContainerName string + PodName string + PodNameSpace string + + Cc *metadata.ContainerCache + Objs any + Ctx context.Context + Kv *compatible.KernelVersion +} + +func (o AgentOptions) FilterByContainer() bool { + return o.ContainerId != "" || o.ContainerName != "" || o.PodName != "" +} + +func (o AgentOptions) FilterByK8s() bool { + return o.PodName != "" +} + +func getPodNameFilter(raw string) (name, ns string) { + if !strings.Contains(raw, ".") { + return raw, "default" + } + index := strings.LastIndex(raw, ".") + return raw[:index], raw[index+1:] +} + +func getEndpoint(raw string) string { + if strings.HasPrefix(raw, "http") { + return raw + } + if strings.HasPrefix(raw, "unix://") { + return raw + } + return fmt.Sprintf("unix://%s", raw) +} + +func ValidateAndRepairOptions(options AgentOptions) AgentOptions { + var newOptions = options + if newOptions.Stopper == nil { + newOptions.Stopper = make(chan os.Signal) + } + if newOptions.ProcessorsNum == 0 { + newOptions.ProcessorsNum = runtime.NumCPU() + } + if newOptions.MessageFilter == nil { + newOptions.MessageFilter = protocol.BaseFilter{} + } + if newOptions.BPFVerifyLogSize <= 0 { + newOptions.BPFVerifyLogSize = 10 * 1024 + } + if newOptions.PerfEventBufferSizeForData <= 0 { + newOptions.PerfEventBufferSizeForData = perfEventDataBufferSize + } + if newOptions.PerfEventBufferSizeForEvent <= 0 { + newOptions.PerfEventBufferSizeForEvent = perfEventControlBufferSize + } + if newOptions.PodName != "" { + newOptions.PodName, newOptions.PodNameSpace = getPodNameFilter(newOptions.PodName) + } + if newOptions.DockerEndpoint != "" { + newOptions.DockerEndpoint = getEndpoint(newOptions.DockerEndpoint) + } + if newOptions.CriRuntimeEndpoint != "" { + newOptions.CriRuntimeEndpoint = getEndpoint(newOptions.CriRuntimeEndpoint) + } + return newOptions +} diff --git a/agent/common/stopper.go b/agent/common/stopper.go index 3aca98e6..bf9da9f5 100644 --- a/agent/common/stopper.go +++ b/agent/common/stopper.go @@ -1,36 +1,36 @@ package common -import ( - "kyanos/common" - "time" -) +// import ( +// "kyanos/common" +// "time" +// ) -var faststoppers *[]chan int -var slowstoppers *[]chan int +// var faststoppers *[]chan int +// var slowstoppers *[]chan int -func AddToFastStopper(c chan int) { - *faststoppers = append(*faststoppers, c) -} +// func AddToFastStopper(c chan int) { +// *faststoppers = append(*faststoppers, c) +// } -func AddToSlowStopper(c chan int) { - *slowstoppers = append(*slowstoppers, c) -} +// func AddToSlowStopper(c chan int) { +// *slowstoppers = append(*slowstoppers, c) +// } -func SendStopSignal() { - common.AgentLog.Debugf("%d fast stoppers needs to be signal\n", len(*faststoppers)) - for _, s := range *faststoppers { - s <- 1 - } - time.Sleep(500 * time.Millisecond) - common.AgentLog.Debugf("%d slow stoppers needs to be signal\n", len(*slowstoppers)) - for _, s := range *slowstoppers { - s <- 1 - } -} +// func SendStopSignal() { +// common.AgentLog.Debugf("%d fast stoppers needs to be signal\n", len(*faststoppers)) +// for _, s := range *faststoppers { +// s <- 1 +// } +// time.Sleep(500 * time.Millisecond) +// common.AgentLog.Debugf("%d slow stoppers needs to be signal\n", len(*slowstoppers)) +// for _, s := range *slowstoppers { +// s <- 1 +// } +// } -func init() { - _stoppers1 := make([]chan int, 0) - faststoppers = &_stoppers1 - _stoppers2 := make([]chan int, 0) - slowstoppers = &_stoppers2 -} +// func init() { +// _stoppers1 := make([]chan int, 0) +// faststoppers = &_stoppers1 +// _stoppers2 := make([]chan int, 0) +// slowstoppers = &_stoppers2 +// } diff --git a/agent/compatible/type.go b/agent/compatible/type.go index feb968cf..73a8f177 100644 --- a/agent/compatible/type.go +++ b/agent/compatible/type.go @@ -21,6 +21,7 @@ const ( SupportRawTracepoint SupportRingBuffer SupportBTF + SupportFilterByContainer ) type InstrumentFunction struct { @@ -114,10 +115,11 @@ func init() { bpf.AgentStepTUSER_COPY: {InstrumentFunction{"kprobe/__skb_datagram_iter", "SkbCopyDatagramIter"}}, }, Capabilities: map[Capability]bool{ - SupportConstants: true, - SupportRawTracepoint: true, - SupportRingBuffer: false, - SupportBTF: true, + SupportConstants: true, + SupportRawTracepoint: true, + SupportRingBuffer: false, + SupportBTF: true, + SupportFilterByContainer: true, }, } baseVersion.addBackupInstrumentFunction(bpf.AgentStepTQDISC_OUT, InstrumentFunction{"kprobe/__dev_queue_xmit", "DevQueueXmit"}) @@ -151,7 +153,8 @@ func init() { v310.removeCapability(SupportConstants). removeCapability(SupportRawTracepoint). removeCapability(SupportXDP). - removeCapability(SupportBTF) + removeCapability(SupportBTF). + removeCapability(SupportFilterByContainer) KernelVersionsMap.Put(v310.Version, v310) } diff --git a/agent/conn/conntrack.go b/agent/conn/conntrack.go index 493f8b51..6f9e814d 100644 --- a/agent/conn/conntrack.go +++ b/agent/conn/conntrack.go @@ -225,13 +225,13 @@ func (c *Connection4) OnClose(needClearBpfMap bool) { OnCloseRecordFunc(c) c.Status = Closed if needClearBpfMap { - connInfoMap := bpf.GetMap("ConnInfoMap") + connInfoMap := bpf.GetMapFromObjs(bpf.Objs, "ConnInfoMap") err := connInfoMap.Delete(c.TgidFd) key, revKey := c.extractSockKeys() - sockKeyConnIdMap := bpf.GetMap("SockKeyConnIdMap") + sockKeyConnIdMap := bpf.GetMapFromObjs(bpf.Objs, "SockKeyConnIdMap") err = sockKeyConnIdMap.Delete(key) err = sockKeyConnIdMap.Delete(revKey) - sockXmitMap := bpf.GetMap("SockXmitMap") + sockXmitMap := bpf.GetMapFromObjs(bpf.Objs, "SockXmitMap") err = sockXmitMap.Delete(key) err = sockXmitMap.Delete(revKey) if err == nil { @@ -242,11 +242,11 @@ func (c *Connection4) OnClose(needClearBpfMap bool) { func (c *Connection4) UpdateConnectionTraceable(traceable bool) { key, revKey := c.extractSockKeys() - sockKeyConnIdMap := bpf.GetMap("SockKeyConnIdMap") + sockKeyConnIdMap := bpf.GetMapFromObjs(bpf.Objs, "SockKeyConnIdMap") c.doUpdateConnIdMapProtocolToUnknwon(key, sockKeyConnIdMap, traceable) c.doUpdateConnIdMapProtocolToUnknwon(revKey, sockKeyConnIdMap, traceable) - connInfoMap := bpf.GetMap("ConnInfoMap") + connInfoMap := bpf.GetMapFromObjs(bpf.Objs, "ConnInfoMap") connInfo := bpf.AgentConnInfoT{} err := connInfoMap.Lookup(c.TgidFd, &connInfo) if err == nil { @@ -310,8 +310,8 @@ func (c *Connection4) addDataToBufferAndTryParse(data []byte, ke *bpf.AgentKernE if c.Role == bpf.AgentEndpointRoleTKRoleUnknown { respSteamMessageType = protocol.Unknown } - c.parseStreamBuffer(c.reqStreamBuffer, reqSteamMessageType, &c.ReqQueue, ke.Step) - c.parseStreamBuffer(c.respStreamBuffer, respSteamMessageType, &c.RespQueue, ke.Step) + c.parseStreamBuffer(c.reqStreamBuffer, reqSteamMessageType, &c.ReqQueue, ke) + c.parseStreamBuffer(c.respStreamBuffer, respSteamMessageType, &c.RespQueue, ke) } func (c *Connection4) OnSslDataEvent(data []byte, event *bpf.SslData, recordChannel chan RecordWithConn) { if len(data) > 0 { @@ -356,7 +356,7 @@ func (c *Connection4) OnSyscallEvent(data []byte, event *bpf.SyscallEventData, r } } -func (c *Connection4) parseStreamBuffer(streamBuffer *buffer.StreamBuffer, messageType protocol.MessageType, resultQueue *[]protocol.ParsedMessage, step bpf.AgentStepT) { +func (c *Connection4) parseStreamBuffer(streamBuffer *buffer.StreamBuffer, messageType protocol.MessageType, resultQueue *[]protocol.ParsedMessage, ke *bpf.AgentKernEvt) { parser := c.GetProtocolParser(c.Protocol) if parser == nil { streamBuffer.Clear() @@ -381,7 +381,7 @@ func (c *Connection4) parseStreamBuffer(streamBuffer *buffer.StreamBuffer, messa case protocol.Success: if c.Role == bpf.AgentEndpointRoleTKRoleUnknown && len(parseResult.ParsedMessages) > 0 { parsedMessage := parseResult.ParsedMessages[0] - if (bpf.IsIngressStep(step) && parsedMessage.IsReq()) || (bpf.IsEgressStep(step) && !parsedMessage.IsReq()) { + if (bpf.IsIngressStep(ke.Step) && parsedMessage.IsReq()) || (bpf.IsEgressStep(ke.Step) && !parsedMessage.IsReq()) { c.Role = bpf.AgentEndpointRoleTKRoleServer } else { c.Role = bpf.AgentEndpointRoleTKRoleClient @@ -401,14 +401,22 @@ func (c *Connection4) parseStreamBuffer(streamBuffer *buffer.StreamBuffer, messa if pos != -1 { streamBuffer.RemovePrefix(pos) stop = false - } else { - removed := c.checkProgress(streamBuffer) - if removed { - common.ConntrackLog.Debugf("Invalid, %s Removed streambuffer head due to stuck from %s queue", c.ToString(), messageType.String()) + } else if c.progressIsStucked(streamBuffer) { + if streamBuffer.Head().Len() > int(ke.Len) { + common.ConntrackLog.Debugf("Invalid, %s Removed streambuffer some head data(%d bytes) due to stuck from %s queue", c.ToString(), streamBuffer.Head().Len()-int(ke.Len), messageType.String()) + streamBuffer.RemovePrefix(streamBuffer.Head().Len() - int(ke.Len)) stop = false } else { - stop = true + removed := c.checkProgress(streamBuffer) + if removed { + common.ConntrackLog.Debugf("Invalid, %s Removed streambuffer head due to stuck from %s queue", c.ToString(), messageType.String()) + stop = false + } else { + stop = true + } } + } else { + stop = true } case protocol.NeedsMoreData: removed := c.checkProgress(streamBuffer) @@ -448,13 +456,26 @@ func (c *Connection4) getLastProgressTime(sb *buffer.StreamBuffer) int64 { return c.lastRespMadeProgressTime } } -func (c *Connection4) checkProgress(sb *buffer.StreamBuffer) bool { +func (c *Connection4) progressIsStucked(sb *buffer.StreamBuffer) bool { if c.getLastProgressTime(sb) == 0 { c.updateProgressTime(sb) return false } headTime, ok := sb.FindTimestampBySeq(uint64(sb.Position0())) if !ok || time.Now().UnixMilli()-int64(common.NanoToMills(headTime)) > 5000 { + return true + } + return false +} +func (c *Connection4) checkProgress(sb *buffer.StreamBuffer) bool { + if c.getLastProgressTime(sb) == 0 { + c.updateProgressTime(sb) + return false + } + headTime, ok := sb.FindTimestampBySeq(uint64(sb.Position0())) + now := time.Now().UnixMilli() + headTimeMills := int64(common.NanoToMills(headTime)) + if !ok || now-headTimeMills > 5000 { sb.RemoveHead() return true } else { diff --git a/agent/conn/kern_event_handler.go b/agent/conn/kern_event_handler.go index e04fc1d0..4e6b2fcf 100644 --- a/agent/conn/kern_event_handler.go +++ b/agent/conn/kern_event_handler.go @@ -73,16 +73,32 @@ func (s *KernEventStream) AddKernEvent(event *bpf.AgentKernEvt) { index, found := slices.BinarySearchFunc(kernEvtSlice, KernEvent{seq: event.Seq}, func(i KernEvent, j KernEvent) int { return cmp.Compare(i.seq, j.seq) }) + var kernEvent *KernEvent if found { + kernEvent = &kernEvtSlice[index] + } else { + kernEvent = &KernEvent{ + seq: event.Seq, + len: int(event.Len), + timestamp: event.Ts, + step: event.Step, + } + } + + if event.Step == bpf.AgentStepTDEV_OUT || event.Step == bpf.AgentStepTDEV_IN { + if kernEvent.attributes == nil { + kernEvent.attributes = make(map[string]any) + } + ifname, err := common.GetInterfaceNameByIndex(int(event.Ifindex), int(event.ConnIdS.TgidFd>>32)) + if err != nil { + ifname = "unknown" + } + kernEvent.UpdateIfTimestampAttr(ifname, event.Ts) + } else if found { return // panic("found duplicate kern event on same seq") } - kernEvtSlice = slices.Insert(kernEvtSlice, index, KernEvent{ - seq: event.Seq, - len: int(event.Len), - timestamp: event.Ts, - step: event.Step, - }) + kernEvtSlice = slices.Insert(kernEvtSlice, index, *kernEvent) if len(kernEvtSlice) > s.maxLen { common.ConntrackLog.Debugf("kern event stream size: %d exceed maxLen", len(kernEvtSlice)) } @@ -175,10 +191,11 @@ func (s *KernEventStream) DiscardEventsBySeq(seq uint64, egress bool) { } type KernEvent struct { - seq uint64 - len int - timestamp uint64 - step bpf.AgentStepT + seq uint64 + len int + timestamp uint64 + step bpf.AgentStepT + attributes map[string]any } func (kernevent *KernEvent) GetSeq() uint64 { @@ -197,6 +214,14 @@ func (kernevent *KernEvent) GetStep() bpf.AgentStepT { return kernevent.step } +func (kernevent *KernEvent) GetAttributes() map[string]any { + return kernevent.attributes +} + +func (kernevent *KernEvent) UpdateIfTimestampAttr(ifname string, time uint64) { + kernevent.attributes[fmt.Sprintf("time-%s", ifname)] = time +} + type SslEvent struct { Seq uint64 KernSeq uint64 diff --git a/agent/conn/processor.go b/agent/conn/processor.go index cc3d094b..1ebc4f40 100644 --- a/agent/conn/processor.go +++ b/agent/conn/processor.go @@ -41,6 +41,37 @@ func (pm *ProcessorManager) GetProcessor(i int) *Processor { return pm.processors[i] } +func (pm *ProcessorManager) GetSyscallEventsChannels() []chan *bpf.SyscallEventData { + var channels []chan *bpf.SyscallEventData = make([]chan *bpf.SyscallEventData, 0) + for _, each := range pm.processors { + channels = append(channels, each.syscallEvents) + } + return channels +} + +func (pm *ProcessorManager) GetSslEventsChannels() []chan *bpf.SslData { + var channels []chan *bpf.SslData = make([]chan *bpf.SslData, 0) + for _, each := range pm.processors { + channels = append(channels, each.sslEvents) + } + return channels +} + +func (pm *ProcessorManager) GetConnEventsChannels() []chan *bpf.AgentConnEvtT { + var channels []chan *bpf.AgentConnEvtT = make([]chan *bpf.AgentConnEvtT, 0) + for _, each := range pm.processors { + channels = append(channels, each.connEvents) + } + return channels +} +func (pm *ProcessorManager) GetKernEventsChannels() []chan *bpf.AgentKernEvt { + var channels []chan *bpf.AgentKernEvt = make([]chan *bpf.AgentKernEvt, 0) + for _, each := range pm.processors { + channels = append(channels, each.kernEvents) + } + return channels +} + func (pm *ProcessorManager) StopAll() error { pm.cancel() pm.wg.Wait() @@ -257,32 +288,48 @@ func (p *Processor) run() { tgidFd := event.ConnIdS.TgidFd conn := p.connManager.FindConnection4Or(tgidFd, event.Ts+common.LaunchEpochTime) event.Ts += common.LaunchEpochTime - if conn != nil { - common.BPFEventLog.Debugf("[data][func=%s][ts=%d][%s]%s | %d:%d flags:%s\n", common.Int8ToStr(event.FuncName[:]), event.Ts, bpf.StepCNNames[event.Step], - conn.ToString(), event.Seq, event.Len, - common.DisplayTcpFlags(event.Flags)) - } else { - common.BPFEventLog.Debugf("[data no conn][tgid=%d fd=%d][func=%s][ts=%d][%s] | %d:%d flags:%s\n", tgidFd>>32, uint32(tgidFd), common.Int8ToStr(event.FuncName[:]), event.Ts, bpf.StepCNNames[event.Step], - event.Seq, event.Len, - common.DisplayTcpFlags(event.Flags)) - } + // if conn != nil { + // common.BPFEventLog.Debugf("[data][func=%s][ts=%d][%s]%s | %d:%d flags:%s\n", common.Int8ToStr(event.FuncName[:]), event.Ts, bpf.StepCNNames[event.Step], + // conn.ToString(), event.Seq, event.Len, + // common.DisplayTcpFlags(event.Flags)) + // } else { + // common.BPFEventLog.Debugf("[data no conn][tgid=%d fd=%d][func=%s][ts=%d][%s] | %d:%d flags:%s\n", tgidFd>>32, uint32(tgidFd), common.Int8ToStr(event.FuncName[:]), event.Ts, bpf.StepCNNames[event.Step], + // event.Seq, event.Len, + // common.DisplayTcpFlags(event.Flags)) + // } if event.Len > 0 && conn != nil && conn.Protocol != bpf.AgentTrafficProtocolTKProtocolUnknown { if conn.Protocol == bpf.AgentTrafficProtocolTKProtocolUnset { conn.OnKernEvent(event) // log.Debug("[skip] skip due to protocol unset") - common.BPFEventLog.Debugf("[data][protocol-unset][func=%s][%s]%s | %d:%d flags:%s\n", common.Int8ToStr(event.FuncName[:]), bpf.StepCNNames[event.Step], conn.ToString(), event.Seq, event.Len, common.DisplayTcpFlags(event.Flags)) + common.BPFEventLog.Debugf("[protocol-unset]%s", FormatKernEvt(event, conn)) } else if conn.Protocol != bpf.AgentTrafficProtocolTKProtocolUnknown { - flag := conn.OnKernEvent(event) - if !flag { - common.BPFEventLog.Debug("[skip] skip due to cur req/resp is nil ?(maybe bug)") - } + common.BPFEventLog.Debugf("%s", FormatKernEvt(event, conn)) + conn.OnKernEvent(event) } } else if event.Len > 0 && conn != nil { - common.BPFEventLog.Debug("[skip] skip due to protocol is unknwon") - common.BPFEventLog.Debugf("[data][func=%s][%s]%s | %d:%d\n", common.Int8ToStr(event.FuncName[:]), bpf.StepCNNames[event.Step], conn.ToString(), event.Seq, event.Len) + common.BPFEventLog.Debugf("[protocol-unknown]%s\n", FormatKernEvt(event, conn)) } else if event.Len == 0 && conn != nil { conn.OnKernEvent(event) + } else if conn == nil { + common.BPFEventLog.Debugf("[no-conn]%s\n", FormatKernEvt(event, conn)) } } } } + +func FormatKernEvt(evt *bpf.AgentKernEvt, conn *Connection4) string { + var interfaceStr string + if evt.Ifindex != 0 { + name, err := common.GetInterfaceNameByIndex(int(evt.Ifindex), int(evt.ConnIdS.TgidFd>>32)) + if err != nil { + interfaceStr = "[if=unknown]" + } else { + interfaceStr = fmt.Sprintf("[if=%s]", name) + } + } + if conn != nil { + return fmt.Sprintf("[kern][ts=%d]%s[%s]%s | %d|%d flags:%s\n", evt.Ts, interfaceStr, bpf.StepCNNames[evt.Step], conn.ToString(), evt.Seq, evt.Len, common.DisplayTcpFlags(evt.Flags)) + } else { + return fmt.Sprintf("[kern][ts=%d]%s[%s] | %d|%d flags:%s\n", evt.Ts, interfaceStr, bpf.StepCNNames[evt.Step], evt.Seq, evt.Len, common.DisplayTcpFlags(evt.Flags)) + } +} diff --git a/agent/container.go b/agent/container.go new file mode 100644 index 00000000..b21c8c20 --- /dev/null +++ b/agent/container.go @@ -0,0 +1,139 @@ +package agent + +import ( + "context" + ac "kyanos/agent/common" + "kyanos/agent/metadata" + "kyanos/agent/metadata/types" + "kyanos/bpf" + "kyanos/common" + "log" + + "github.com/cilium/ebpf" +) + +type containerFilterResult struct { + mntnsIds []uint32 + netnsIds []uint32 + pidnsIds []uint32 +} + +func applyContainerFilter(ctx context.Context, options *ac.AgentOptions) (*metadata.ContainerCache, *containerFilterResult, error) { + cc, err, k8sErr := metadata.NewContainerCache(ctx, options.DockerEndpoint, options.ContainerdEndpoint, options.CriRuntimeEndpoint) + if err != nil { + if options.FilterByContainer() { + common.DefaultLog.Fatalf("find container failed: %s", err) + } else { + common.DefaultLog.Warnf("find container failed: %s", err) + return nil, nil, nil + } + } + if k8sErr != nil { + if options.FilterByK8s() { + common.DefaultLog.Fatalf("find pod failed: %s", k8sErr) + } else { + common.DefaultLog.Infof("find pod failed: %s", k8sErr) + } + } + if !options.FilterByContainer() { + return cc, nil, nil + } + + var containers []types.Container + + switch { + case options.ContainerId != "": + container := cc.GetById(options.ContainerId) + if container.EmptyNS() { + log.Fatalf("can not find any running container by id %s", options.ContainerId) + } + containers = append(containers, container) + case options.ContainerName != "": + cs := cc.GetByName(options.ContainerName) + cs = removeNonFilterAbleContainers(cs) + if len(cs) > 1 { + log.Fatalf("found more than one containers by name %s", options.ContainerName) + } + if len(cs) == 0 { + log.Fatalf("can not find any running container by name %s", options.ContainerName) + } + container := cs[0] + containers = append(containers, container) + case options.PodName != "": + cs := cc.GetByPodName(options.PodName, options.PodNameSpace) + cs = removeNonFilterAbleContainers(cs) + if len(cs) == 0 { + log.Fatalf("can not find any running pod by name %s in namespace %s", options.PodName, options.PodNameSpace) + } + containers = append(containers, cs...) + } + result := containerFilterResult{ + pidnsIds: make([]uint32, 0), + mntnsIds: make([]uint32, 0), + netnsIds: make([]uint32, 0), + } + for _, container := range containers { + if container.IsSandbox() { + common.DefaultLog.Infof("skip sandbox container: %#v", container) + continue + } + common.DefaultLog.Infof("filter by container %#v", container) + if container.PidNamespace > 0 && container.PidNamespace != metadata.HostPidNs { + result.pidnsIds = append(result.pidnsIds, uint32(container.PidNamespace)) + } + if container.MountNamespace > 0 && container.MountNamespace != metadata.HostMntNs { + result.mntnsIds = append(result.mntnsIds, uint32(container.MountNamespace)) + } + if container.NetworkNamespace > 0 && container.NetworkNamespace != metadata.HostNetNs { + result.netnsIds = append(result.netnsIds, uint32(container.NetworkNamespace)) + } + } + return cc, &result, nil +} + +func writeFilterNsIdsToMap(r *containerFilterResult, objs any) { + pidnsMap := bpf.GetMapFromObjs(objs, "FilterPidnsMap") + mntnsMap := bpf.GetMapFromObjs(objs, "FilterMntnsMap") + netnsMap := bpf.GetMapFromObjs(objs, "FilterNetnsMap") + value := uint8(0) + for _, id := range r.pidnsIds { + pidnsMap.Update(id, value, ebpf.UpdateAny) + } + for _, id := range r.mntnsIds { + mntnsMap.Update(id, value, ebpf.UpdateAny) + } + for _, id := range r.netnsIds { + netnsMap.Update(id, value, ebpf.UpdateAny) + } +} + +func removeNonFilterAbleContainers(containers []types.Container) []types.Container { + var final []types.Container + for _, c := range containers { + if c.IsSandbox() || c.EmptyNS() { + continue + } + if c.PidNamespace == metadata.HostPidNs && + c.MountNamespace == metadata.HostMntNs && + c.NetworkNamespace == metadata.HostNetNs { + continue + } + final = append(final, c) + } + return final +} + +func initProcExitEventChannel(ctx context.Context) chan *bpf.AgentProcessExitEvent { + ch := make(chan *bpf.AgentProcessExitEvent, 10) + go func() { + for { + select { + case <-ctx.Done(): + return + case evt := <-ch: + common.DeleteIfIdxToNameEntry(int(evt.Pid)) + } + } + }() + return ch +} diff --git a/agent/metadata/container.go b/agent/metadata/container.go new file mode 100644 index 00000000..69976a17 --- /dev/null +++ b/agent/metadata/container.go @@ -0,0 +1,56 @@ +package metadata + +import ( + "context" + "kyanos/agent/metadata/container" + "kyanos/agent/metadata/k8s" + "kyanos/agent/metadata/types" +) + +type ContainerCache struct { + d container.MetaData + k8s *k8s.MetaData +} + +func NewContainerCache(ctx context.Context, + dockerEndpoint, containerdEndpoint, criRuntimeEndpoint string) (*ContainerCache, error, error) { + d := container.NewMultipleEngineMetaData(dockerEndpoint, containerdEndpoint) + + if err := d.Start(ctx); err != nil { + return nil, err, nil + } + + k8sd, k8sErr := k8s.NewMetaData(criRuntimeEndpoint) + return &ContainerCache{ + d: d, + k8s: k8sd, + }, nil, k8sErr +} + +func (c *ContainerCache) GetById(containerId string) types.Container { + return c.d.GetById(containerId) +} + +func (c *ContainerCache) GetByMntNs(mntNs int64) types.Container { + return c.d.GetByMntNs(mntNs) +} + +func (c *ContainerCache) GetByNetNs(ns int64) types.Container { + return c.d.GetByNetNs(ns) +} + +func (c *ContainerCache) GetByPid(pid int) types.Container { + return c.d.GetByPid(pid) +} + +func (c *ContainerCache) GetByName(containerName string) []types.Container { + return c.d.GetByName(containerName) +} + +func (c *ContainerCache) GetPodByContainer(cr types.Container) types.Pod { + return c.k8s.GetPodByContainer(cr) +} + +func (c *ContainerCache) GetByPodName(name, namespace string) []types.Container { + return c.d.GetByPod(name, namespace) +} diff --git a/agent/metadata/container/container.go b/agent/metadata/container/container.go new file mode 100644 index 00000000..d5470533 --- /dev/null +++ b/agent/metadata/container/container.go @@ -0,0 +1,16 @@ +package container + +import ( + "context" + "kyanos/agent/metadata/types" +) + +type MetaData interface { + Start(ctx context.Context) error + GetById(containerId string) types.Container + GetByMntNs(mntNs int64) types.Container + GetByNetNs(netNs int64) types.Container + GetByPid(pid int) types.Container + GetByName(name string) []types.Container + GetByPod(name, namespace string) []types.Container +} diff --git a/agent/metadata/container/containerd/containerd.go b/agent/metadata/container/containerd/containerd.go new file mode 100644 index 00000000..ccfad20d --- /dev/null +++ b/agent/metadata/container/containerd/containerd.go @@ -0,0 +1,416 @@ +package containerd + +import ( + "context" + "errors" + "fmt" + "kyanos/agent/metadata/types" + "kyanos/common" + "regexp" + "strings" + "sync" + "time" + + "github.com/containerd/containerd" + apievents "github.com/containerd/containerd/api/events" + "github.com/containerd/containerd/events" + "github.com/containerd/errdefs" + "github.com/containerd/typeurl/v2" +) + +const ( + DefaultSocket = "/run/containerd/containerd.sock" + defaultNamespace = "default" + shortContainerIdLength = 12 +) + +var containerNameLabels = []string{ + "nerdctl/name", + "io.kubernetes.container.name", +} + +type MetaData struct { + client *containerd.Client + + containerById map[string]types.Container + mux sync.RWMutex + + hostPidNs int64 + hostMntNs int64 + hostNetNs int64 +} + +func NewMetaData(host string, namespace string) (*MetaData, error) { + if namespace == "" { + namespace = defaultNamespace + } + if host == "" { + host = DefaultSocket + } + + common.DefaultLog.Infof("init containerd metadata with host=%s, namespace=%s", host, namespace) + opts := []containerd.ClientOpt{ + containerd.WithDefaultNamespace(namespace), + containerd.WithTimeout(time.Second * 2), + } + c, err := containerd.New(host, opts...) + if err != nil { + return nil, err + } + + ctx, cancel := context.WithTimeout(context.TODO(), time.Second*5) + defer cancel() + if _, err := c.Server(ctx); err != nil { + return nil, err + } + + m := MetaData{ + client: c, + containerById: make(map[string]types.Container), + mux: sync.RWMutex{}, + } + return &m, nil +} + +func NewMultipleNamespacesMetaData(host, namespace string) ([]*MetaData, error) { + var instances []*MetaData + + cd, err := NewMetaData(host, namespace) + if err != nil { + return nil, err + } + instances = append(instances, cd) + if namespace != "" { + return instances, nil + } + + nsList, err := cd.ListNamespace(context.TODO()) + if err != nil { + return instances, err + } + + for _, ns := range nsList { + if ns == defaultNamespace { + continue + } + cd, err := NewMetaData(host, ns) + if err != nil { + return instances, err + } + instances = append(instances, cd) + } + + return instances, nil +} + +func (d *MetaData) ListNamespace(ctx context.Context) ([]string, error) { + return d.client.NamespaceService().List(ctx) +} + +func (d *MetaData) Start(ctx context.Context) error { + if err := d.init(ctx); err != nil { + return err + } + + go func() { + d.watchContainerEventsWithRetry(ctx) + }() + return nil +} + +func (d *MetaData) GetById(containerId string) types.Container { + d.mux.RLock() + defer d.mux.RUnlock() + + id := getContainerId(containerId) + common.DefaultLog.Debugf("get by id, id: %s", id) + + if len(id) == shortContainerIdLength { + return d.getByShortId(id) + } + + return d.containerById[id] +} + +func (d *MetaData) GetByNetNs(netNs int64) types.Container { + if netNs == 0 || netNs == d.hostNetNs { + return types.Container{} + } + + d.mux.RLock() + defer d.mux.RUnlock() + + var containers []types.Container + for _, c := range d.containerById { + if c.NetworkNamespace > 0 && c.NetworkNamespace == d.hostNetNs { + continue + } + if c.NetworkNamespace > 0 && c.NetworkNamespace == netNs { + containers = append(containers, c) + } + } + if len(containers) == 1 { + return containers[0] + } + for _, c := range containers { + if !c.IsSandbox() { + return c + } + } + + return types.Container{} +} + +func (d *MetaData) GetByMntNs(mntNs int64) types.Container { + if mntNs == 0 || mntNs == d.hostMntNs { + return types.Container{} + } + + d.mux.RLock() + defer d.mux.RUnlock() + + var containers []types.Container + for _, c := range d.containerById { + if c.MountNamespace > 0 && c.MountNamespace == d.hostMntNs { + continue + } + if c.MountNamespace > 0 && c.MountNamespace == mntNs { + containers = append(containers, c) + } + } + if len(containers) == 1 { + return containers[0] + } + for _, c := range containers { + if !c.IsSandbox() { + return c + } + } + + return types.Container{} +} + +func (d *MetaData) GetByPid(pid int) types.Container { + if pid == 0 { + return types.Container{} + } + + d.mux.RLock() + defer d.mux.RUnlock() + + for _, c := range d.containerById { + if c.RootPid > 0 && c.RootPid == pid { + return c + } + } + + return types.Container{} +} + +func (d *MetaData) GetByName(name string) []types.Container { + d.mux.RLock() + defer d.mux.RUnlock() + + var cs []types.Container + for _, c := range d.containerById { + if c.TidyName() == name { + cs = append(cs, c) + } + } + + return cs +} + +func (d *MetaData) GetByPod(name, namespace string) []types.Container { + d.mux.RLock() + defer d.mux.RUnlock() + + var cs []types.Container + for _, c := range d.containerById { + p := c.Pod() + if p.Name == name && p.Namespace == namespace { + cs = append(cs, c) + } + } + + return cs +} + +func (d *MetaData) getByShortId(shortId string) types.Container { + for _, c := range d.containerById { + if strings.HasPrefix(c.Id, shortId) { + return c + } + } + + return types.Container{} +} + +func (d *MetaData) init(ctx context.Context) error { + d.hostPidNs = common.GetPidNamespaceFromPid(1) + d.hostMntNs = common.GetMountNamespaceFromPid(1) + d.hostNetNs = common.GetNetworkNamespaceFromPid(1) + + c := d.client + containers, err := c.Containers(ctx) + if err != nil { + return fmt.Errorf("list containers: %w", err) + } + for _, cr := range containers { + d.saveContainer(ctx, cr) + } + return nil +} + +func (d *MetaData) watchContainerEventsWithRetry(ctx context.Context) { + for { + select { + case <-ctx.Done(): + return + default: + } + + d.watchContainerEvents(ctx) + + time.Sleep(time.Second * 15) + } +} + +func (d *MetaData) watchContainerEvents(ctx context.Context) { + c := d.client + + var chMsg <-chan *events.Envelope + var chErr <-chan error + var msg *events.Envelope + + chMsg, chErr = c.Subscribe(ctx) + + for { + select { + case <-ctx.Done(): + return + case err := <-chErr: + if errors.Is(err, context.Canceled) { + return + } + common.DefaultLog.Errorf("containerd events failed: %s", err) + return + case msg = <-chMsg: + } + + event, err := typeurl.UnmarshalAny(msg.Event) + if err != nil { + common.DefaultLog.Errorf("parse containerd event failed: %s", err) + continue + } + + common.DefaultLog.Debugf("new event: %#v", event) + switch ev := event.(type) { + case *apievents.ContainerCreate: + d.handleContainerEvent(ctx, ev.ID) + case *apievents.TaskCreate: + d.handleContainerEvent(ctx, ev.ContainerID) + case *apievents.TaskStart: + d.handleContainerEvent(ctx, ev.ContainerID) + } + } +} + +func (d *MetaData) handleContainerEvent(ctx context.Context, containerId string) { + c := d.client + containers, err := c.Containers(ctx) + if err != nil { + common.DefaultLog.Error(err.Error()) + return + } + for _, container := range containers { + if container.ID() == containerId { + d.saveContainer(ctx, container) + } + } +} + +func (d *MetaData) saveContainer(ctx context.Context, container containerd.Container) { + cr, err := d.inspectContainer(ctx, container) + if err != nil { + common.DefaultLog.Errorf(err.Error()) + return + } + + d.setContainer(*cr) +} + +func (d *MetaData) setContainer(c types.Container) { + d.mux.Lock() + defer d.mux.Unlock() + + common.DefaultLog.Debugf("new container: %#v", c) + + d.containerById[c.Id] = c +} + +func (d *MetaData) inspectContainer(ctx context.Context, container containerd.Container) (*types.Container, error) { + info, err := container.Info(ctx) + if err != nil { + return nil, err + } + task, err := container.Task(ctx, nil) + if err != nil { + if errors.Is(err, errdefs.ErrNotFound) || + strings.Contains(err.Error(), "no running task found") { + common.DefaultLog.Debugf("get task failed: %s", err) + } else { + common.DefaultLog.Infof("get task failed: %s", err) + } + // return nil, err + } + + name := getContainerName(info.Labels) + cr := &types.Container{ + Id: container.ID(), + Name: name, + Image: info.Image, + Labels: info.Labels, + } + + if task != nil { + cr.RootPid = int(task.Pid()) + cr.PidNamespace = common.GetPidNamespaceFromPid(cr.RootPid) + cr.MountNamespace = common.GetMountNamespaceFromPid(cr.RootPid) + cr.NetworkNamespace = common.GetNetworkNamespaceFromPid(cr.RootPid) + } + + return cr, nil +} + +func (d *MetaData) Close() error { + return d.client.Close() +} + +// cgroupName: nerdctl-d3d7bc0de8fc3c1ccffc3b870f57ce5f82982b3b494df21f9722a68cc75cd4cd.scope +var regexContainerCgroupV2Name = regexp.MustCompilePOSIX(`[^\-]+-([a-z0-9]{64}).scope`) + +func getContainerId(id string) string { + parts := regexContainerCgroupV2Name.FindAllStringSubmatch(id, -1) + if len(parts) < 1 { + return id + } + part := parts[0] + if len(part) < 2 { + return id + } + return part[1] +} + +func getContainerName(labels map[string]string) string { + if len(labels) == 0 { + return "" + } + for _, key := range containerNameLabels { + v := labels[key] + if v != "" { + return v + } + } + return "" +} diff --git a/agent/metadata/container/docker/docker.go b/agent/metadata/container/docker/docker.go new file mode 100644 index 00000000..9f24fa6d --- /dev/null +++ b/agent/metadata/container/docker/docker.go @@ -0,0 +1,337 @@ +package docker + +import ( + "context" + "errors" + "fmt" + "kyanos/agent/metadata/types" + "kyanos/common" + "regexp" + "strings" + "sync" + "time" + + dockertypes "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/events" + "github.com/docker/docker/api/types/filters" + "github.com/docker/docker/client" +) + +const ( + DefaultSocket = "/var/run/docker.sock" + shortContainerIdLength = 12 +) + +type MetaData struct { + client *client.Client + + containerById map[string]types.Container + mux sync.RWMutex + + hostPidNs int64 + hostMntNs int64 + hostNetNs int64 +} + +func NewMetaData(host string) (*MetaData, error) { + common.DefaultLog.Infof("init docker metadata with host=%s", host) + opts := []client.Opt{ + client.FromEnv, + client.WithAPIVersionNegotiation(), + } + if host != "" { + opts = append(opts, client.WithHost(host)) + } + c, err := client.NewClientWithOpts(opts...) + if err != nil { + return nil, err + } + + ctx, cancel := context.WithTimeout(context.TODO(), time.Second*5) + defer cancel() + if _, err := c.Info(ctx); err != nil { + return nil, err + } + + m := MetaData{ + client: c, + containerById: make(map[string]types.Container), + mux: sync.RWMutex{}, + } + return &m, nil +} + +func (d *MetaData) Start(ctx context.Context) error { + if err := d.init(ctx); err != nil { + return err + } + + go func() { + d.watchContainerEventsWithRetry(ctx) + }() + return nil +} + +func (d *MetaData) GetById(containerId string) types.Container { + d.mux.RLock() + defer d.mux.RUnlock() + + id := getDockerContainerId(containerId) + + if len(id) == shortContainerIdLength { + return d.getByShortId(id) + } + + return d.containerById[id] +} + +func (d *MetaData) GetByNetNs(netNs int64) types.Container { + if netNs == 0 || netNs == d.hostNetNs { + return types.Container{} + } + + d.mux.RLock() + defer d.mux.RUnlock() + + var containers []types.Container + for _, c := range d.containerById { + if c.NetworkNamespace > 0 && c.NetworkNamespace == d.hostNetNs { + continue + } + if c.NetworkNamespace > 0 && c.NetworkNamespace == netNs { + containers = append(containers, c) + } + } + if len(containers) == 1 { + return containers[0] + } + for _, c := range containers { + if !c.IsSandbox() { + return c + } + } + + return types.Container{} +} + +func (d *MetaData) GetByMntNs(mntNs int64) types.Container { + if mntNs == 0 || mntNs == d.hostMntNs { + return types.Container{} + } + + d.mux.RLock() + defer d.mux.RUnlock() + + var containers []types.Container + for _, c := range d.containerById { + if c.MountNamespace > 0 && c.MountNamespace == d.hostMntNs { + continue + } + if c.MountNamespace > 0 && c.MountNamespace == mntNs { + containers = append(containers, c) + } + } + if len(containers) == 1 { + return containers[0] + } + for _, c := range containers { + if !c.IsSandbox() { + return c + } + } + + return types.Container{} +} + +func (d *MetaData) GetByPid(pid int) types.Container { + if pid == 0 { + return types.Container{} + } + + d.mux.RLock() + defer d.mux.RUnlock() + + for _, c := range d.containerById { + if c.RootPid > 0 && c.RootPid == pid { + return c + } + } + + return types.Container{} +} + +func (d *MetaData) GetByName(name string) []types.Container { + d.mux.RLock() + defer d.mux.RUnlock() + + var cs []types.Container + for _, c := range d.containerById { + if c.TidyName() == name { + cs = append(cs, c) + } + } + + return cs +} + +func (d *MetaData) GetByPod(name, namespace string) []types.Container { + d.mux.RLock() + defer d.mux.RUnlock() + + var cs []types.Container + for _, c := range d.containerById { + p := c.Pod() + if p.Name == name && p.Namespace == namespace { + cs = append(cs, c) + } + } + + return cs +} + +func (d *MetaData) getByShortId(shortId string) types.Container { + for _, c := range d.containerById { + if strings.HasPrefix(c.Id, shortId) { + return c + } + } + + return types.Container{} +} + +func (d *MetaData) init(ctx context.Context) error { + d.hostPidNs = common.GetPidNamespaceFromPid(1) + d.hostMntNs = common.GetMountNamespaceFromPid(1) + d.hostNetNs = common.GetNetworkNamespaceFromPid(1) + + c := d.client + containers, err := c.ContainerList(ctx, container.ListOptions{ + Filters: filters.NewArgs(filters.Arg("status", "running")), + }) + if err != nil { + return fmt.Errorf("list containers: %w", err) + } + for _, cr := range containers { + d.handleContainerEvent(ctx, cr.ID) + } + return nil +} + +func (d *MetaData) watchContainerEventsWithRetry(ctx context.Context) { + for { + select { + case <-ctx.Done(): + return + default: + } + + d.watchContainerEvents(ctx) + + time.Sleep(time.Second * 15) + } +} + +func (d *MetaData) watchContainerEvents(ctx context.Context) { + c := d.client + + var chMsg <-chan events.Message + var chErr <-chan error + var msg events.Message + + chMsg, chErr = c.Events(ctx, dockertypes.EventsOptions{ + // Filters: filters.NewArgs( + // filters.Arg("type", "container"), + // filters.Arg("event", "exec_create"), + // filters.Arg("event", "exec_start"), + // ), + }) + + for { + select { + case <-ctx.Done(): + return + case err := <-chErr: + if errors.Is(err, context.Canceled) { + return + } + common.DefaultLog.Errorf("docker events failed: %s", err) + return + case msg = <-chMsg: + } + + if msg.Type != events.ContainerEventType { + continue + } + if string(msg.Action) == string(ActionStart) || + strings.HasPrefix(string(msg.Action), string(ActionExecCreate)+": ") || + strings.HasPrefix(string(msg.Action), string(ActionExecStart)+": ") { + d.handleContainerEvent(ctx, msg.Actor.ID) + } + } +} + +func (d *MetaData) handleContainerEvent(ctx context.Context, containerId string) { + cr, err := d.inspectContainer(ctx, containerId) + if err != nil { + common.DefaultLog.Errorf("inspect container failed: %s", err) + return + } + + d.setContainer(*cr) +} + +func (d *MetaData) setContainer(c types.Container) { + d.mux.Lock() + defer d.mux.Unlock() + + common.DefaultLog.Debugf("new container: %#v", c) + + d.containerById[c.Id] = c +} + +func (d *MetaData) inspectContainer(ctx context.Context, containerId string) (*types.Container, error) { + c := d.client + + data, err := c.ContainerInspect(ctx, containerId) + if err != nil { + return nil, fmt.Errorf("inspect container %s: %w", containerId, err) + } + + cr := &types.Container{ + Id: containerId, + Name: data.Name, + ImageDigest: data.Image, + } + if conf := data.Config; conf != nil { + cr.Image = conf.Image + cr.Labels = conf.Labels + } + if state := data.State; state != nil && state.Pid != 0 { + cr.RootPid = state.Pid + cr.PidNamespace = common.GetPidNamespaceFromPid(cr.RootPid) + cr.MountNamespace = common.GetMountNamespaceFromPid(cr.RootPid) + cr.NetworkNamespace = common.GetNetworkNamespaceFromPid(cr.RootPid) + } + + return cr, nil +} + +func (d *MetaData) Close() error { + return d.client.Close() +} + +// cgroupName: docker-40fad6778feaab1bd6ed7bfa0d43a2d5338267204f30cd8203e4d06de871c577.scope +var regexDockerCgroupV2Name = regexp.MustCompilePOSIX(`[^\-]+-([a-z0-9]{64}).scope`) + +func getDockerContainerId(id string) string { + parts := regexDockerCgroupV2Name.FindAllStringSubmatch(id, -1) + if len(parts) < 1 { + return id + } + part := parts[0] + if len(part) < 2 { + return id + } + return part[1] +} diff --git a/agent/metadata/container/docker/events.go b/agent/metadata/container/docker/events.go new file mode 100644 index 00000000..c7446380 --- /dev/null +++ b/agent/metadata/container/docker/events.go @@ -0,0 +1,27 @@ +package docker + +type Action string + +const ( + ActionCreate Action = "create" + ActionStart Action = "start" + + // ActionExecCreate is the prefix used for exec_create events. These + // event-actions are commonly followed by a colon and space (": "), + // and the command that's defined for the exec, for example: + // + // exec_create: /bin/sh -c 'echo hello' + // + // This is far from ideal; it's a compromise to allow filtering and + // to preserve backward-compatibility. + ActionExecCreate Action = "exec_create" + // ActionExecStart is the prefix used for exec_create events. These + // event-actions are commonly followed by a colon and space (": "), + // and the command that's defined for the exec, for example: + // + // exec_start: /bin/sh -c 'echo hello' + // + // This is far from ideal; it's a compromise to allow filtering and + // to preserve backward-compatibility. + ActionExecStart Action = "exec_start" +) diff --git a/agent/metadata/container/multiple.go b/agent/metadata/container/multiple.go new file mode 100644 index 00000000..7b1a7143 --- /dev/null +++ b/agent/metadata/container/multiple.go @@ -0,0 +1,113 @@ +package container + +import ( + "context" + "kyanos/agent/metadata/container/containerd" + "kyanos/agent/metadata/container/docker" + "kyanos/agent/metadata/types" + "kyanos/common" +) + +type MultipleEngineMetaData struct { + engines []MetaData +} + +func NewMultipleEngineMetaData(dockerEndpoint, containerdEndpoint string) *MultipleEngineMetaData { + var m MultipleEngineMetaData + + dr, err := docker.NewMetaData(dockerEndpoint) + if err != nil { + common.DefaultLog.Infof(err.Error()) + common.DefaultLog.Warnf("skip Docker Engine integration due to %s", err.Error()) + } else { + m.engines = append(m.engines, dr) + } + + cd, err := containerd.NewMultipleNamespacesMetaData(containerdEndpoint, "") + if err != nil { + common.DefaultLog.Infof(err.Error()) + common.DefaultLog.Warnf("skip containerd integration due to %s", err.Error()) + } else { + for _, c := range cd { + c := c + m.engines = append(m.engines, c) + } + } + + return &m +} + +func (m *MultipleEngineMetaData) Start(ctx context.Context) error { + for _, e := range m.engines { + if err := e.Start(ctx); err != nil { + common.DefaultLog.Error(err.Error()) + } + } + + return nil +} + +func (m *MultipleEngineMetaData) GetById(containerId string) types.Container { + var c types.Container + for _, e := range m.engines { + c = e.GetById(containerId) + if c.Id != "" { + return c + } + } + return c +} +func (m *MultipleEngineMetaData) GetByMntNs(mntNs int64) types.Container { + var c types.Container + for _, e := range m.engines { + c = e.GetByMntNs(mntNs) + if c.Id != "" { + return c + } + } + return c +} +func (m *MultipleEngineMetaData) GetByNetNs(netNs int64) types.Container { + var c types.Container + for _, e := range m.engines { + c = e.GetByNetNs(netNs) + if c.Id != "" { + return c + } + } + return c +} +func (m *MultipleEngineMetaData) GetByPid(pid int) types.Container { + var c types.Container + for _, e := range m.engines { + c = e.GetByPid(pid) + if c.Id != "" { + return c + } + } + return c +} + +func (m *MultipleEngineMetaData) GetByName(name string) []types.Container { + var cs []types.Container + for _, e := range m.engines { + cs = e.GetByName(name) + if len(cs) > 0 { + return cs + } + } + + return cs +} + +func (m *MultipleEngineMetaData) GetByPod(name, namespace string) []types.Container { + var cs []types.Container + for _, e := range m.engines { + cs = e.GetByPod(name, namespace) + if len(cs) > 0 { + return cs + } + } + + return cs +} diff --git a/agent/metadata/k8s/cri.go b/agent/metadata/k8s/cri.go new file mode 100644 index 00000000..a2879695 --- /dev/null +++ b/agent/metadata/k8s/cri.go @@ -0,0 +1,148 @@ +package k8s + +import ( + "context" + "errors" + "fmt" + "kyanos/agent/metadata/types" + "kyanos/common" + "os" + "strings" + "time" + + cri "k8s.io/cri-api/pkg/apis" + "k8s.io/kubernetes/pkg/kubelet/cri/remote" +) + +var DefaultRuntimeEndpoints = []string{ + "unix:///var/run/dockershim.sock", + "unix:///var/run/cri-dockerd.sock", + "unix:///run/crio/crio.sock", + "unix:///run/containerd/containerd.sock", +} + +const defaultTimeout = 2 * time.Second + +type MetaData struct { + res cri.RuntimeService +} + +func NewMetaData(criRuntimeEndpoint string) (*MetaData, error) { + res, errs := getRuntimeService(criRuntimeEndpoint) + if len(errs) > 0 { + return nil, fmt.Errorf("skip kubernetes integration due to [%s]", formatErrors(errs)) + } + + return &MetaData{ + res: res, + }, nil +} + +func (m *MetaData) GetPodByContainer(c types.Container) types.Pod { + p := types.Pod{} + p.LoadFromContainer(c) + if m.res != nil { + tmp := m.GetPodByName(context.TODO(), p.Name, p.Namespace) + p.Labels = tmp.Labels + p.Annotations = tmp.Annotations + } + return p +} + +func (m *MetaData) GetPodByName(ctx context.Context, name, namespace string) (p types.Pod) { + if m.res == nil { + return + } + sandboxes, err := m.res.ListPodSandbox(nil) + if err != nil { + // TODO: use errors.Is + if strings.Contains(err.Error(), "Unimplemented") && + strings.Contains(err.Error(), "v1alpha2.RuntimeService") { + + common.DefaultLog.Infof("list pod sandbox failed: %s", err) + } else { + common.DefaultLog.Errorf("list pod sandbox failed: %s", err) + } + return + } + for _, sandbox := range sandboxes { + if sandbox.Metadata.Name != name || sandbox.Metadata.Namespace != namespace { + continue + } + p.Labels = tidyLabels(sandbox.Labels) + p.Annotations = sandbox.Annotations + break + } + return p +} + +func tidyLabels(raw map[string]string) map[string]string { + if len(raw) == 0 { + return raw + } + + newLabels := make(map[string]string) + for k, v := range raw { + if k == types.ContainerLabelKeyPodName || + k == types.ContainerLabelKeyPodNamespace || + k == types.ContainerLabelKeyPodUid { + continue + } + newLabels[k] = v + } + return newLabels +} + +func getRuntimeService(criRuntimeEndpoint string) (res cri.RuntimeService, errs []error) { + t := defaultTimeout + endpoints := DefaultRuntimeEndpoints + if criRuntimeEndpoint != "" { + endpoints = []string{criRuntimeEndpoint} + } + for _, endPoint := range endpoints { + var err error + common.AgentLog.Infof("Connect using endpoint %q with %q timeout", endPoint, t) + res, err = remote.NewRemoteRuntimeService(endPoint, t) + path := strings.TrimPrefix(endPoint, "unix://") + if err != nil { + common.AgentLog.Infof(err.Error()) + err = common.UnwrapErr(err) + if os.IsNotExist(err) || strings.Contains(err.Error(), "no such file or directory") { + err = errors.New("no such file or directory") + } + errs = append(errs, fmt.Errorf("connect using endpoint %s: %w", path, err)) + continue + } + if _, err1 := res.Version(string(remote.CRIVersionV1)); err1 != nil { + common.AgentLog.Infof("check version %s failed: %s", remote.CRIVersionV1, err1) + if _, err2 := res.Version(string("v1alpha2")); err2 != nil { + common.AgentLog.Infof("check version %s failed: %s", "v1alpha2", err2) + errs = append(errs, fmt.Errorf("using endpoint %s failed: %w", path, err1)) + res = nil + continue + } + } + common.AgentLog.Infof("Connected successfully using endpoint: %s", endPoint) + errs = nil + break + } + + return res, errs +} + +func formatErrors(errs []error) string { + var messages []string + for _, err := range errs { + if err == nil { + continue + } + msg := err.Error() + if strings.Contains(msg, "while dialing: ") { + messages = append(messages, strings.Trim(strings.Split(msg, "while dialing: ")[1], `"'`)) + } else { + messages = append(messages, msg) + } + } + + return strings.Join(messages, ", ") +} diff --git a/agent/metadata/process.go b/agent/metadata/process.go new file mode 100644 index 00000000..7a6093cb --- /dev/null +++ b/agent/metadata/process.go @@ -0,0 +1,17 @@ +package metadata + +import "kyanos/common" + +const defaultProcDir = "/proc" + +var ( + HostMntNs int64 + HostPidNs int64 + HostNetNs int64 +) + +func init() { + HostPidNs = common.GetPidNamespaceFromPid(1) + HostMntNs = common.GetMountNamespaceFromPid(1) + HostNetNs = common.GetNetworkNamespaceFromPid(1) +} diff --git a/agent/metadata/types/container.go b/agent/metadata/types/container.go new file mode 100644 index 00000000..fbdaca37 --- /dev/null +++ b/agent/metadata/types/container.go @@ -0,0 +1,70 @@ +package types + +import ( + "encoding/json" + "strings" +) + +type Container struct { + Id string + Name string + Labels map[string]string + + RootPid int + PidNamespace int64 + MountNamespace int64 + NetworkNamespace int64 + + Image string + ImageDigest string + + p Pod +} + +func (c *Container) IsNull() bool { + if c == nil { + return true + } + return c.Id == "" +} + +func (c Container) TidyName() string { + return strings.TrimLeft(c.Name, "/") +} + +func (c Container) FormatLabels() string { + if len(c.Labels) == 0 { + return "{}" + } + b, _ := json.Marshal(c.Labels) + return string(b) +} + +func (c Container) IsSandbox() bool { + if len(c.Labels) == 0 { + return false + } + return c.Labels["io.cri-containerd.kind"] == "sandbox" || + c.Labels["io.kubernetes.docker.type"] == "sandbox" || + c.Labels["io.kubernetes.docker.type"] == "podsandbox" +} + +func (c *Container) Pod() Pod { + if c.p.Name != "" { + return c.p + } + p := Pod{} + p.LoadFromContainer(*c) + c.p = p + return p +} + +func (c Container) EmptyNS() bool { + return c.PidNamespace == 0 && c.MountNamespace == 0 && c.NetworkNamespace == 0 +} + +func ParseContainerLabels(s string) map[string]string { + labels := make(map[string]string) + json.Unmarshal([]byte(s), &labels) + return labels +} diff --git a/agent/metadata/types/kubernetes.go b/agent/metadata/types/kubernetes.go new file mode 100644 index 00000000..c1876d09 --- /dev/null +++ b/agent/metadata/types/kubernetes.go @@ -0,0 +1,57 @@ +package types + +import ( + "encoding/json" +) + +const ( + ContainerLabelKeyPodName = "io.kubernetes.pod.name" + ContainerLabelKeyPodNamespace = "io.kubernetes.pod.namespace" + ContainerLabelKeyPodUid = "io.kubernetes.pod.uid" +) + +type Pod struct { + Name string + Namespace string + Uid string + Labels map[string]string + Annotations map[string]string +} + +func (p *Pod) LoadFromContainer(c Container) { + labels := c.Labels + if len(labels) == 0 { + return + } + p.Name = labels[ContainerLabelKeyPodName] + p.Namespace = labels[ContainerLabelKeyPodNamespace] + p.Uid = labels[ContainerLabelKeyPodUid] +} + +func (p Pod) FormatLabels() string { + if len(p.Labels) == 0 { + return "{}" + } + b, _ := json.Marshal(p.Labels) + return string(b) +} + +func ParsePodLabels(s string) map[string]string { + labels := make(map[string]string) + json.Unmarshal([]byte(s), &labels) + return labels +} + +func (p Pod) FormatAnnotations() string { + if len(p.Annotations) == 0 { + return "{}" + } + b, _ := json.Marshal(p.Annotations) + return string(b) +} + +func ParsePodAnnotations(s string) map[string]string { + annotations := make(map[string]string) + json.Unmarshal([]byte(s), &annotations) + return annotations +} diff --git a/agent/protocol/mysql/mysql.go b/agent/protocol/mysql/mysql.go index cd917521..a162488d 100644 --- a/agent/protocol/mysql/mysql.go +++ b/agent/protocol/mysql/mysql.go @@ -243,7 +243,7 @@ func (m *MysqlParser) ParseStream(streamBuffer *buffer.StreamBuffer, messageType if messageType == Request { packet.isReq = true if len(buf) < kPacketHeaderLength+1 { - return ParseResult{ParseState: Invalid} + return ParseResult{ParseState: NeedsMoreData} } commandByte := buf[kPacketHeaderLength] diff --git a/agent/render/render.go b/agent/render/render.go index 2cf93398..35c48127 100644 --- a/agent/render/render.go +++ b/agent/render/render.go @@ -4,6 +4,7 @@ import ( "cmp" "fmt" "kyanos/agent/analysis" + anc "kyanos/agent/analysis/common" "kyanos/agent/protocol" "kyanos/common" "slices" @@ -20,10 +21,10 @@ type RenderOptions struct { type Render struct { resultChannel <-chan []*analysis.ConnStat stopper <-chan int - *analysis.AnalysisOptions + *anc.AnalysisOptions } -func CreateRender(resultChannel <-chan []*analysis.ConnStat, stopper chan int, options *analysis.AnalysisOptions) *Render { +func CreateRender(resultChannel <-chan []*analysis.ConnStat, stopper chan int, options *anc.AnalysisOptions) *Render { return &Render{ resultChannel: resultChannel, stopper: stopper, @@ -91,7 +92,7 @@ func (r *Render) simpleRender(constats []*analysis.ConnStat) string { record := records[len(records)-i-1] s += fmt.Sprintf("----------------------------------------Top %s Sample %d---------------------------------------------\n", metricSampleName(metricType, r.Side), i+1) if r.FullRecordBody { - s += record.String(analysis.AnnotatedRecordToStringOptions{ + s += record.String(anc.AnnotatedRecordToStringOptions{ MetricTypeSet: r.AnalysisOptions.EnabledMetricTypeSet, RecordToStringOptions: protocol.RecordToStringOptions{ RecordMaxDumpBytes: 1024, @@ -101,7 +102,7 @@ func (r *Render) simpleRender(constats []*analysis.ConnStat) string { IncludeSyscallStat: false, }) } else { - s += record.String(analysis.AnnotatedRecordToStringOptions{ + s += record.String(anc.AnnotatedRecordToStringOptions{ MetricTypeSet: r.AnalysisOptions.EnabledMetricTypeSet, RecordToStringOptions: protocol.RecordToStringOptions{ RecordMaxDumpBytes: 1024, @@ -119,10 +120,10 @@ func (r *Render) simpleRender(constats []*analysis.ConnStat) string { return s } -func metricName(metricType analysis.MetricType, side common.SideEnum) string { +func metricName(metricType anc.MetricType, side common.SideEnum) string { metricName := MetricTypeNames[metricType] - if metricType == analysis.BlackBoxDuration { + if metricType == anc.BlackBoxDuration { if side == common.ClientSide { metricName = "Network Duration" } else { @@ -132,10 +133,10 @@ func metricName(metricType analysis.MetricType, side common.SideEnum) string { return metricName } -func metricSampleName(metricType analysis.MetricType, side common.SideEnum) string { +func metricSampleName(metricType anc.MetricType, side common.SideEnum) string { metricName := MetricTypeNames[metricType] - if metricType == analysis.BlackBoxDuration { + if metricType == anc.BlackBoxDuration { if side == common.ClientSide { metricName = "Max Network Duration" } else { diff --git a/agent/render/type.go b/agent/render/type.go index 8600b6b7..7f40f6f5 100644 --- a/agent/render/type.go +++ b/agent/render/type.go @@ -1,7 +1,7 @@ package render import ( - . "kyanos/agent/analysis" + . "kyanos/agent/analysis/common" ) var MetricTypeNames = map[MetricType]string{ diff --git a/agent/uprobe/manager.go b/agent/uprobe/manager.go index 420bebc2..e16bdbee 100644 --- a/agent/uprobe/manager.go +++ b/agent/uprobe/manager.go @@ -3,6 +3,7 @@ package uprobe import ( "debug/elf" "fmt" + ac "kyanos/agent/common" "kyanos/bpf" "kyanos/common" "os" @@ -49,7 +50,11 @@ func AttachSslUprobe(pid int) ([]link.Link, error) { if err != nil || versionKey == "" { return []link.Link{}, err } - bpfFunc := sslVersionBpfMap[versionKey] + bpfFunc, ok := sslVersionBpfMap[versionKey] + if !ok { + common.UprobeLog.Warnf("versionKey %s found but bpfFunc not found", versionKey) + return []link.Link{}, nil + } matcher, libSslPath, err := findLibSslPath(pid) if err != nil || libSslPath == "" { @@ -74,7 +79,8 @@ func AttachSslUprobe(pid int) ([]link.Link, error) { collectionOptions := &ebpf.CollectionOptions{ Programs: ebpf.ProgramOptions{ // LogLevel: ebpf.LogLevelInstruction, - LogSize: 10 * 1024, + LogSize: 10 * 1024, + KernelTypes: ac.CollectionOpts.Programs.KernelTypes, }, MapReplacements: map[string]*ebpf.Map{ "active_ssl_read_args_map": bpf.GetMapFromObjs(bpf.Objs, "ActiveSslReadArgsMap"), @@ -87,6 +93,10 @@ func AttachSslUprobe(pid int) ([]link.Link, error) { "ssl_user_space_call_map": bpf.GetMapFromObjs(bpf.Objs, "SslUserSpaceCallMap"), "syscall_data_map": bpf.GetMapFromObjs(bpf.Objs, "SyscallDataMap"), "syscall_rb": bpf.GetMapFromObjs(bpf.Objs, "SyscallRb"), + "filter_mntns_map": bpf.GetMapFromObjs(bpf.Objs, "FilterMntnsMap"), + "filter_netns_map": bpf.GetMapFromObjs(bpf.Objs, "FilterNetnsMap"), + "filter_pid_map": bpf.GetMapFromObjs(bpf.Objs, "FilterPidMap"), + "filter_pidns_map": bpf.GetMapFromObjs(bpf.Objs, "FilterPidnsMap"), }, } err = spec.LoadAndAssign(objs, collectionOptions) diff --git a/agent/uprobe/types.go b/agent/uprobe/types.go index 02abdb9b..43b626db 100644 --- a/agent/uprobe/types.go +++ b/agent/uprobe/types.go @@ -176,6 +176,8 @@ func initOpensslOffset() { "boringssl na": nil, } + sslVersionBpfMap["openssl 1.1.1"] = sslVersionBpfMap[Linuxdefaulefilename111] + // in openssl source files, there are 4 offset groups for all 1.1.1* version. // group a : 1.1.1a sslVersionBpfMap["openssl 1.1.1a"] = func() (*ebpf.CollectionSpec, any, error) { diff --git a/bpf/agent_x86_bpfel.go b/bpf/agent_x86_bpfel.go index 37fade8b..2e6cf2a2 100644 --- a/bpf/agent_x86_bpfel.go +++ b/bpf/agent_x86_bpfel.go @@ -79,10 +79,14 @@ const ( type AgentControlValueIndexT uint32 const ( - AgentControlValueIndexTKTargetTGIDIndex AgentControlValueIndexT = 0 - AgentControlValueIndexTKStirlingTGIDIndex AgentControlValueIndexT = 1 - AgentControlValueIndexTKEnabledXdpIndex AgentControlValueIndexT = 2 - AgentControlValueIndexTKNumControlValues AgentControlValueIndexT = 3 + AgentControlValueIndexTKTargetTGIDIndex AgentControlValueIndexT = 0 + AgentControlValueIndexTKStirlingTGIDIndex AgentControlValueIndexT = 1 + AgentControlValueIndexTKEnabledXdpIndex AgentControlValueIndexT = 2 + AgentControlValueIndexTKEnableFilterByPid AgentControlValueIndexT = 3 + AgentControlValueIndexTKEnableFilterByLocalPort AgentControlValueIndexT = 4 + AgentControlValueIndexTKEnableFilterByRemotePort AgentControlValueIndexT = 5 + AgentControlValueIndexTKEnableFilterByRemoteHost AgentControlValueIndexT = 6 + AgentControlValueIndexTKNumControlValues AgentControlValueIndexT = 7 ) type AgentEndpointRoleT uint32 @@ -100,9 +104,11 @@ type AgentKernEvt struct { Len uint32 Flags uint8 _ [3]byte + Ifindex uint32 + _ [4]byte ConnIdS AgentConnIdS_t - IsSample int32 Step AgentStepT + _ [4]byte } type AgentKernEvtData struct { @@ -122,6 +128,8 @@ type AgentKernEvtSslData struct { type AgentProcessExecEvent struct{ Pid int32 } +type AgentProcessExitEvent struct{ Pid int32 } + type AgentSockKey struct { Sip [2]uint64 Dip [2]uint64 @@ -224,6 +232,8 @@ type AgentProgramSpecs struct { IpQueueXmit *ebpf.ProgramSpec `ebpf:"ip_queue_xmit"` IpQueueXmit2 *ebpf.ProgramSpec `ebpf:"ip_queue_xmit2"` IpRcvCore *ebpf.ProgramSpec `ebpf:"ip_rcv_core"` + KprobeNfNatManipPkt *ebpf.ProgramSpec `ebpf:"kprobe__nf_nat_manip_pkt"` + KprobeNfNatPacket *ebpf.ProgramSpec `ebpf:"kprobe__nf_nat_packet"` SecuritySocketRecvmsgEnter *ebpf.ProgramSpec `ebpf:"security_socket_recvmsg_enter"` SecuritySocketSendmsgEnter *ebpf.ProgramSpec `ebpf:"security_socket_sendmsg_enter"` SkbCopyDatagramIovec *ebpf.ProgramSpec `ebpf:"skb_copy_datagram_iovec"` @@ -236,6 +246,7 @@ type AgentProgramSpecs struct { TcpV4Rcv *ebpf.ProgramSpec `ebpf:"tcp_v4_rcv"` TracepointNetifReceiveSkb *ebpf.ProgramSpec `ebpf:"tracepoint__netif_receive_skb"` TracepointSchedSchedProcessExec *ebpf.ProgramSpec `ebpf:"tracepoint__sched__sched_process_exec"` + TracepointSchedSchedProcessExit *ebpf.ProgramSpec `ebpf:"tracepoint__sched__sched_process_exit"` TracepointSyscallsSysEnterAccept4 *ebpf.ProgramSpec `ebpf:"tracepoint__syscalls__sys_enter_accept4"` TracepointSyscallsSysEnterClose *ebpf.ProgramSpec `ebpf:"tracepoint__syscalls__sys_enter_close"` TracepointSyscallsSysEnterConnect *ebpf.ProgramSpec `ebpf:"tracepoint__syscalls__sys_enter_connect"` @@ -278,7 +289,14 @@ type AgentMapSpecs struct { EnabledLocalPortMap *ebpf.MapSpec `ebpf:"enabled_local_port_map"` EnabledRemoteIpv4Map *ebpf.MapSpec `ebpf:"enabled_remote_ipv4_map"` EnabledRemotePortMap *ebpf.MapSpec `ebpf:"enabled_remote_port_map"` + FilterMntnsMap *ebpf.MapSpec `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.MapSpec `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.MapSpec `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.MapSpec `ebpf:"filter_pidns_map"` + KernEvtT_map *ebpf.MapSpec `ebpf:"kern_evt_t_map"` + NatFlowMap *ebpf.MapSpec `ebpf:"nat_flow_map"` ProcExecEvents *ebpf.MapSpec `ebpf:"proc_exec_events"` + ProcExitEvents *ebpf.MapSpec `ebpf:"proc_exit_events"` Rb *ebpf.MapSpec `ebpf:"rb"` ReadArgsMap *ebpf.MapSpec `ebpf:"read_args_map"` SockKeyConnIdMap *ebpf.MapSpec `ebpf:"sock_key_conn_id_map"` @@ -323,7 +341,14 @@ type AgentMaps struct { EnabledLocalPortMap *ebpf.Map `ebpf:"enabled_local_port_map"` EnabledRemoteIpv4Map *ebpf.Map `ebpf:"enabled_remote_ipv4_map"` EnabledRemotePortMap *ebpf.Map `ebpf:"enabled_remote_port_map"` + FilterMntnsMap *ebpf.Map `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.Map `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.Map `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.Map `ebpf:"filter_pidns_map"` + KernEvtT_map *ebpf.Map `ebpf:"kern_evt_t_map"` + NatFlowMap *ebpf.Map `ebpf:"nat_flow_map"` ProcExecEvents *ebpf.Map `ebpf:"proc_exec_events"` + ProcExitEvents *ebpf.Map `ebpf:"proc_exit_events"` Rb *ebpf.Map `ebpf:"rb"` ReadArgsMap *ebpf.Map `ebpf:"read_args_map"` SockKeyConnIdMap *ebpf.Map `ebpf:"sock_key_conn_id_map"` @@ -351,7 +376,14 @@ func (m *AgentMaps) Close() error { m.EnabledLocalPortMap, m.EnabledRemoteIpv4Map, m.EnabledRemotePortMap, + m.FilterMntnsMap, + m.FilterNetnsMap, + m.FilterPidMap, + m.FilterPidnsMap, + m.KernEvtT_map, + m.NatFlowMap, m.ProcExecEvents, + m.ProcExitEvents, m.Rb, m.ReadArgsMap, m.SockKeyConnIdMap, @@ -374,6 +406,8 @@ type AgentPrograms struct { IpQueueXmit *ebpf.Program `ebpf:"ip_queue_xmit"` IpQueueXmit2 *ebpf.Program `ebpf:"ip_queue_xmit2"` IpRcvCore *ebpf.Program `ebpf:"ip_rcv_core"` + KprobeNfNatManipPkt *ebpf.Program `ebpf:"kprobe__nf_nat_manip_pkt"` + KprobeNfNatPacket *ebpf.Program `ebpf:"kprobe__nf_nat_packet"` SecuritySocketRecvmsgEnter *ebpf.Program `ebpf:"security_socket_recvmsg_enter"` SecuritySocketSendmsgEnter *ebpf.Program `ebpf:"security_socket_sendmsg_enter"` SkbCopyDatagramIovec *ebpf.Program `ebpf:"skb_copy_datagram_iovec"` @@ -386,6 +420,7 @@ type AgentPrograms struct { TcpV4Rcv *ebpf.Program `ebpf:"tcp_v4_rcv"` TracepointNetifReceiveSkb *ebpf.Program `ebpf:"tracepoint__netif_receive_skb"` TracepointSchedSchedProcessExec *ebpf.Program `ebpf:"tracepoint__sched__sched_process_exec"` + TracepointSchedSchedProcessExit *ebpf.Program `ebpf:"tracepoint__sched__sched_process_exit"` TracepointSyscallsSysEnterAccept4 *ebpf.Program `ebpf:"tracepoint__syscalls__sys_enter_accept4"` TracepointSyscallsSysEnterClose *ebpf.Program `ebpf:"tracepoint__syscalls__sys_enter_close"` TracepointSyscallsSysEnterConnect *ebpf.Program `ebpf:"tracepoint__syscalls__sys_enter_connect"` @@ -418,6 +453,8 @@ func (p *AgentPrograms) Close() error { p.IpQueueXmit, p.IpQueueXmit2, p.IpRcvCore, + p.KprobeNfNatManipPkt, + p.KprobeNfNatPacket, p.SecuritySocketRecvmsgEnter, p.SecuritySocketSendmsgEnter, p.SkbCopyDatagramIovec, @@ -430,6 +467,7 @@ func (p *AgentPrograms) Close() error { p.TcpV4Rcv, p.TracepointNetifReceiveSkb, p.TracepointSchedSchedProcessExec, + p.TracepointSchedSchedProcessExit, p.TracepointSyscallsSysEnterAccept4, p.TracepointSyscallsSysEnterClose, p.TracepointSyscallsSysEnterConnect, diff --git a/bpf/agentold_x86_bpfel.go b/bpf/agentlagacykernel310_x86_bpfel.go similarity index 61% rename from bpf/agentold_x86_bpfel.go rename to bpf/agentlagacykernel310_x86_bpfel.go index 5c220f0d..44b4010f 100644 --- a/bpf/agentold_x86_bpfel.go +++ b/bpf/agentlagacykernel310_x86_bpfel.go @@ -12,20 +12,20 @@ import ( "github.com/cilium/ebpf" ) -type AgentOldConnEvtT struct { - ConnInfo AgentOldConnInfoT - ConnType AgentOldConnTypeT +type AgentLagacyKernel310ConnEvtT struct { + ConnInfo AgentLagacyKernel310ConnInfoT + ConnType AgentLagacyKernel310ConnTypeT _ [4]byte Ts uint64 } -type AgentOldConnIdS_t struct { +type AgentLagacyKernel310ConnIdS_t struct { TgidFd uint64 NoTrace bool _ [7]byte } -type AgentOldConnInfoT struct { +type AgentLagacyKernel310ConnInfoT struct { ConnId struct { Upid struct { Pid uint32 @@ -58,8 +58,8 @@ type AgentOldConnInfoT struct { Sin6ScopeId uint32 } } - Protocol AgentOldTrafficProtocolT - Role AgentOldEndpointRoleT + Protocol AgentLagacyKernel310TrafficProtocolT + Role AgentLagacyKernel310EndpointRoleT PrevCount uint64 PrevBuf [4]int8 PrependLengthHeader bool @@ -68,51 +68,57 @@ type AgentOldConnInfoT struct { _ [1]byte } -type AgentOldConnTypeT uint32 +type AgentLagacyKernel310ConnTypeT uint32 const ( - AgentOldConnTypeTKConnect AgentOldConnTypeT = 0 - AgentOldConnTypeTKClose AgentOldConnTypeT = 1 - AgentOldConnTypeTKProtocolInfer AgentOldConnTypeT = 2 + AgentLagacyKernel310ConnTypeTKConnect AgentLagacyKernel310ConnTypeT = 0 + AgentLagacyKernel310ConnTypeTKClose AgentLagacyKernel310ConnTypeT = 1 + AgentLagacyKernel310ConnTypeTKProtocolInfer AgentLagacyKernel310ConnTypeT = 2 ) -type AgentOldControlValueIndexT uint32 +type AgentLagacyKernel310ControlValueIndexT uint32 const ( - AgentOldControlValueIndexTKTargetTGIDIndex AgentOldControlValueIndexT = 0 - AgentOldControlValueIndexTKStirlingTGIDIndex AgentOldControlValueIndexT = 1 - AgentOldControlValueIndexTKEnabledXdpIndex AgentOldControlValueIndexT = 2 - AgentOldControlValueIndexTKNumControlValues AgentOldControlValueIndexT = 3 + AgentLagacyKernel310ControlValueIndexTKTargetTGIDIndex AgentLagacyKernel310ControlValueIndexT = 0 + AgentLagacyKernel310ControlValueIndexTKStirlingTGIDIndex AgentLagacyKernel310ControlValueIndexT = 1 + AgentLagacyKernel310ControlValueIndexTKEnabledXdpIndex AgentLagacyKernel310ControlValueIndexT = 2 + AgentLagacyKernel310ControlValueIndexTKEnableFilterByPid AgentLagacyKernel310ControlValueIndexT = 3 + AgentLagacyKernel310ControlValueIndexTKEnableFilterByLocalPort AgentLagacyKernel310ControlValueIndexT = 4 + AgentLagacyKernel310ControlValueIndexTKEnableFilterByRemotePort AgentLagacyKernel310ControlValueIndexT = 5 + AgentLagacyKernel310ControlValueIndexTKEnableFilterByRemoteHost AgentLagacyKernel310ControlValueIndexT = 6 + AgentLagacyKernel310ControlValueIndexTKNumControlValues AgentLagacyKernel310ControlValueIndexT = 7 ) -type AgentOldEndpointRoleT uint32 +type AgentLagacyKernel310EndpointRoleT uint32 const ( - AgentOldEndpointRoleTKRoleClient AgentOldEndpointRoleT = 1 - AgentOldEndpointRoleTKRoleServer AgentOldEndpointRoleT = 2 - AgentOldEndpointRoleTKRoleUnknown AgentOldEndpointRoleT = 4 + AgentLagacyKernel310EndpointRoleTKRoleClient AgentLagacyKernel310EndpointRoleT = 1 + AgentLagacyKernel310EndpointRoleTKRoleServer AgentLagacyKernel310EndpointRoleT = 2 + AgentLagacyKernel310EndpointRoleTKRoleUnknown AgentLagacyKernel310EndpointRoleT = 4 ) -type AgentOldKernEvt struct { +type AgentLagacyKernel310KernEvt struct { FuncName [16]int8 Ts uint64 Seq uint64 Len uint32 Flags uint8 _ [3]byte - ConnIdS AgentOldConnIdS_t - IsSample int32 - Step AgentOldStepT + Ifindex uint32 + _ [4]byte + ConnIdS AgentLagacyKernel310ConnIdS_t + Step AgentLagacyKernel310StepT + _ [4]byte } -type AgentOldKernEvtData struct { - Ke AgentOldKernEvt +type AgentLagacyKernel310KernEvtData struct { + Ke AgentLagacyKernel310KernEvt BufSize uint32 Msg [30720]int8 _ [4]byte } -type AgentOldSockKey struct { +type AgentLagacyKernel310SockKey struct { Sip [2]uint64 Dip [2]uint64 Sport uint16 @@ -120,76 +126,76 @@ type AgentOldSockKey struct { _ [4]byte } -type AgentOldStepT uint32 +type AgentLagacyKernel310StepT uint32 const ( - AgentOldStepTStart AgentOldStepT = 0 - AgentOldStepTSSL_OUT AgentOldStepT = 1 - AgentOldStepTSYSCALL_OUT AgentOldStepT = 2 - AgentOldStepTTCP_OUT AgentOldStepT = 3 - AgentOldStepTIP_OUT AgentOldStepT = 4 - AgentOldStepTQDISC_OUT AgentOldStepT = 5 - AgentOldStepTDEV_OUT AgentOldStepT = 6 - AgentOldStepTNIC_OUT AgentOldStepT = 7 - AgentOldStepTNIC_IN AgentOldStepT = 8 - AgentOldStepTDEV_IN AgentOldStepT = 9 - AgentOldStepTIP_IN AgentOldStepT = 10 - AgentOldStepTTCP_IN AgentOldStepT = 11 - AgentOldStepTUSER_COPY AgentOldStepT = 12 - AgentOldStepTSYSCALL_IN AgentOldStepT = 13 - AgentOldStepTSSL_IN AgentOldStepT = 14 - AgentOldStepTEnd AgentOldStepT = 15 + AgentLagacyKernel310StepTStart AgentLagacyKernel310StepT = 0 + AgentLagacyKernel310StepTSSL_OUT AgentLagacyKernel310StepT = 1 + AgentLagacyKernel310StepTSYSCALL_OUT AgentLagacyKernel310StepT = 2 + AgentLagacyKernel310StepTTCP_OUT AgentLagacyKernel310StepT = 3 + AgentLagacyKernel310StepTIP_OUT AgentLagacyKernel310StepT = 4 + AgentLagacyKernel310StepTQDISC_OUT AgentLagacyKernel310StepT = 5 + AgentLagacyKernel310StepTDEV_OUT AgentLagacyKernel310StepT = 6 + AgentLagacyKernel310StepTNIC_OUT AgentLagacyKernel310StepT = 7 + AgentLagacyKernel310StepTNIC_IN AgentLagacyKernel310StepT = 8 + AgentLagacyKernel310StepTDEV_IN AgentLagacyKernel310StepT = 9 + AgentLagacyKernel310StepTIP_IN AgentLagacyKernel310StepT = 10 + AgentLagacyKernel310StepTTCP_IN AgentLagacyKernel310StepT = 11 + AgentLagacyKernel310StepTUSER_COPY AgentLagacyKernel310StepT = 12 + AgentLagacyKernel310StepTSYSCALL_IN AgentLagacyKernel310StepT = 13 + AgentLagacyKernel310StepTSSL_IN AgentLagacyKernel310StepT = 14 + AgentLagacyKernel310StepTEnd AgentLagacyKernel310StepT = 15 ) -type AgentOldTrafficDirectionT uint32 +type AgentLagacyKernel310TrafficDirectionT uint32 const ( - AgentOldTrafficDirectionTKEgress AgentOldTrafficDirectionT = 0 - AgentOldTrafficDirectionTKIngress AgentOldTrafficDirectionT = 1 + AgentLagacyKernel310TrafficDirectionTKEgress AgentLagacyKernel310TrafficDirectionT = 0 + AgentLagacyKernel310TrafficDirectionTKIngress AgentLagacyKernel310TrafficDirectionT = 1 ) -type AgentOldTrafficProtocolT uint32 +type AgentLagacyKernel310TrafficProtocolT uint32 const ( - AgentOldTrafficProtocolTKProtocolUnset AgentOldTrafficProtocolT = 0 - AgentOldTrafficProtocolTKProtocolUnknown AgentOldTrafficProtocolT = 1 - AgentOldTrafficProtocolTKProtocolHTTP AgentOldTrafficProtocolT = 2 - AgentOldTrafficProtocolTKProtocolHTTP2 AgentOldTrafficProtocolT = 3 - AgentOldTrafficProtocolTKProtocolMySQL AgentOldTrafficProtocolT = 4 - AgentOldTrafficProtocolTKProtocolCQL AgentOldTrafficProtocolT = 5 - AgentOldTrafficProtocolTKProtocolPGSQL AgentOldTrafficProtocolT = 6 - AgentOldTrafficProtocolTKProtocolDNS AgentOldTrafficProtocolT = 7 - AgentOldTrafficProtocolTKProtocolRedis AgentOldTrafficProtocolT = 8 - AgentOldTrafficProtocolTKProtocolNATS AgentOldTrafficProtocolT = 9 - AgentOldTrafficProtocolTKProtocolMongo AgentOldTrafficProtocolT = 10 - AgentOldTrafficProtocolTKProtocolKafka AgentOldTrafficProtocolT = 11 - AgentOldTrafficProtocolTKProtocolMux AgentOldTrafficProtocolT = 12 - AgentOldTrafficProtocolTKProtocolAMQP AgentOldTrafficProtocolT = 13 - AgentOldTrafficProtocolTKNumProtocols AgentOldTrafficProtocolT = 14 + AgentLagacyKernel310TrafficProtocolTKProtocolUnset AgentLagacyKernel310TrafficProtocolT = 0 + AgentLagacyKernel310TrafficProtocolTKProtocolUnknown AgentLagacyKernel310TrafficProtocolT = 1 + AgentLagacyKernel310TrafficProtocolTKProtocolHTTP AgentLagacyKernel310TrafficProtocolT = 2 + AgentLagacyKernel310TrafficProtocolTKProtocolHTTP2 AgentLagacyKernel310TrafficProtocolT = 3 + AgentLagacyKernel310TrafficProtocolTKProtocolMySQL AgentLagacyKernel310TrafficProtocolT = 4 + AgentLagacyKernel310TrafficProtocolTKProtocolCQL AgentLagacyKernel310TrafficProtocolT = 5 + AgentLagacyKernel310TrafficProtocolTKProtocolPGSQL AgentLagacyKernel310TrafficProtocolT = 6 + AgentLagacyKernel310TrafficProtocolTKProtocolDNS AgentLagacyKernel310TrafficProtocolT = 7 + AgentLagacyKernel310TrafficProtocolTKProtocolRedis AgentLagacyKernel310TrafficProtocolT = 8 + AgentLagacyKernel310TrafficProtocolTKProtocolNATS AgentLagacyKernel310TrafficProtocolT = 9 + AgentLagacyKernel310TrafficProtocolTKProtocolMongo AgentLagacyKernel310TrafficProtocolT = 10 + AgentLagacyKernel310TrafficProtocolTKProtocolKafka AgentLagacyKernel310TrafficProtocolT = 11 + AgentLagacyKernel310TrafficProtocolTKProtocolMux AgentLagacyKernel310TrafficProtocolT = 12 + AgentLagacyKernel310TrafficProtocolTKProtocolAMQP AgentLagacyKernel310TrafficProtocolT = 13 + AgentLagacyKernel310TrafficProtocolTKNumProtocols AgentLagacyKernel310TrafficProtocolT = 14 ) -// LoadAgentOld returns the embedded CollectionSpec for AgentOld. -func LoadAgentOld() (*ebpf.CollectionSpec, error) { - reader := bytes.NewReader(_AgentOldBytes) +// LoadAgentLagacyKernel310 returns the embedded CollectionSpec for AgentLagacyKernel310. +func LoadAgentLagacyKernel310() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_AgentLagacyKernel310Bytes) spec, err := ebpf.LoadCollectionSpecFromReader(reader) if err != nil { - return nil, fmt.Errorf("can't load AgentOld: %w", err) + return nil, fmt.Errorf("can't load AgentLagacyKernel310: %w", err) } return spec, err } -// LoadAgentOldObjects loads AgentOld and converts it into a struct. +// LoadAgentLagacyKernel310Objects loads AgentLagacyKernel310 and converts it into a struct. // // The following types are suitable as obj argument: // -// *AgentOldObjects -// *AgentOldPrograms -// *AgentOldMaps +// *AgentLagacyKernel310Objects +// *AgentLagacyKernel310Programs +// *AgentLagacyKernel310Maps // // See ebpf.CollectionSpec.LoadAndAssign documentation for details. -func LoadAgentOldObjects(obj interface{}, opts *ebpf.CollectionOptions) error { - spec, err := LoadAgentOld() +func LoadAgentLagacyKernel310Objects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadAgentLagacyKernel310() if err != nil { return err } @@ -197,23 +203,25 @@ func LoadAgentOldObjects(obj interface{}, opts *ebpf.CollectionOptions) error { return spec.LoadAndAssign(obj, opts) } -// AgentOldSpecs contains maps and programs before they are loaded into the kernel. +// AgentLagacyKernel310Specs contains maps and programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type AgentOldSpecs struct { - AgentOldProgramSpecs - AgentOldMapSpecs +type AgentLagacyKernel310Specs struct { + AgentLagacyKernel310ProgramSpecs + AgentLagacyKernel310MapSpecs } -// AgentOldSpecs contains programs before they are loaded into the kernel. +// AgentLagacyKernel310Specs contains programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type AgentOldProgramSpecs struct { +type AgentLagacyKernel310ProgramSpecs struct { DevHardStartXmit *ebpf.ProgramSpec `ebpf:"dev_hard_start_xmit"` DevQueueXmit *ebpf.ProgramSpec `ebpf:"dev_queue_xmit"` IpQueueXmit *ebpf.ProgramSpec `ebpf:"ip_queue_xmit"` IpQueueXmit2 *ebpf.ProgramSpec `ebpf:"ip_queue_xmit2"` IpRcvCore *ebpf.ProgramSpec `ebpf:"ip_rcv_core"` + KprobeNfNatManipPkt *ebpf.ProgramSpec `ebpf:"kprobe__nf_nat_manip_pkt"` + KprobeNfNatPacket *ebpf.ProgramSpec `ebpf:"kprobe__nf_nat_packet"` SecuritySocketRecvmsgEnter *ebpf.ProgramSpec `ebpf:"security_socket_recvmsg_enter"` SecuritySocketSendmsgEnter *ebpf.ProgramSpec `ebpf:"security_socket_sendmsg_enter"` SkbCopyDatagramIovec *ebpf.ProgramSpec `ebpf:"skb_copy_datagram_iovec"` @@ -226,6 +234,7 @@ type AgentOldProgramSpecs struct { TcpV4Rcv *ebpf.ProgramSpec `ebpf:"tcp_v4_rcv"` TracepointNetifReceiveSkb *ebpf.ProgramSpec `ebpf:"tracepoint__netif_receive_skb"` TracepointSchedSchedProcessExec *ebpf.ProgramSpec `ebpf:"tracepoint__sched__sched_process_exec"` + TracepointSchedSchedProcessExit *ebpf.ProgramSpec `ebpf:"tracepoint__sched__sched_process_exit"` TracepointSyscallsSysEnterAccept4 *ebpf.ProgramSpec `ebpf:"tracepoint__syscalls__sys_enter_accept4"` TracepointSyscallsSysEnterClose *ebpf.ProgramSpec `ebpf:"tracepoint__syscalls__sys_enter_close"` TracepointSyscallsSysEnterConnect *ebpf.ProgramSpec `ebpf:"tracepoint__syscalls__sys_enter_connect"` @@ -251,10 +260,10 @@ type AgentOldProgramSpecs struct { XdpProxy *ebpf.ProgramSpec `ebpf:"xdp_proxy"` } -// AgentOldMapSpecs contains maps before they are loaded into the kernel. +// AgentLagacyKernel310MapSpecs contains maps before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type AgentOldMapSpecs struct { +type AgentLagacyKernel310MapSpecs struct { AcceptArgsMap *ebpf.MapSpec `ebpf:"accept_args_map"` ActiveSslReadArgsMap *ebpf.MapSpec `ebpf:"active_ssl_read_args_map"` ActiveSslWriteArgsMap *ebpf.MapSpec `ebpf:"active_ssl_write_args_map"` @@ -268,7 +277,14 @@ type AgentOldMapSpecs struct { EnabledLocalPortMap *ebpf.MapSpec `ebpf:"enabled_local_port_map"` EnabledRemoteIpv4Map *ebpf.MapSpec `ebpf:"enabled_remote_ipv4_map"` EnabledRemotePortMap *ebpf.MapSpec `ebpf:"enabled_remote_port_map"` + FilterMntnsMap *ebpf.MapSpec `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.MapSpec `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.MapSpec `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.MapSpec `ebpf:"filter_pidns_map"` + KernEvtT_map *ebpf.MapSpec `ebpf:"kern_evt_t_map"` + NatFlowMap *ebpf.MapSpec `ebpf:"nat_flow_map"` ProcExecEvents *ebpf.MapSpec `ebpf:"proc_exec_events"` + ProcExitEvents *ebpf.MapSpec `ebpf:"proc_exit_events"` Rb *ebpf.MapSpec `ebpf:"rb"` ReadArgsMap *ebpf.MapSpec `ebpf:"read_args_map"` SockKeyConnIdMap *ebpf.MapSpec `ebpf:"sock_key_conn_id_map"` @@ -281,25 +297,25 @@ type AgentOldMapSpecs struct { WriteArgsMap *ebpf.MapSpec `ebpf:"write_args_map"` } -// AgentOldObjects contains all objects after they have been loaded into the kernel. +// AgentLagacyKernel310Objects contains all objects after they have been loaded into the kernel. // -// It can be passed to LoadAgentOldObjects or ebpf.CollectionSpec.LoadAndAssign. -type AgentOldObjects struct { - AgentOldPrograms - AgentOldMaps +// It can be passed to LoadAgentLagacyKernel310Objects or ebpf.CollectionSpec.LoadAndAssign. +type AgentLagacyKernel310Objects struct { + AgentLagacyKernel310Programs + AgentLagacyKernel310Maps } -func (o *AgentOldObjects) Close() error { - return _AgentOldClose( - &o.AgentOldPrograms, - &o.AgentOldMaps, +func (o *AgentLagacyKernel310Objects) Close() error { + return _AgentLagacyKernel310Close( + &o.AgentLagacyKernel310Programs, + &o.AgentLagacyKernel310Maps, ) } -// AgentOldMaps contains all maps after they have been loaded into the kernel. +// AgentLagacyKernel310Maps contains all maps after they have been loaded into the kernel. // -// It can be passed to LoadAgentOldObjects or ebpf.CollectionSpec.LoadAndAssign. -type AgentOldMaps struct { +// It can be passed to LoadAgentLagacyKernel310Objects or ebpf.CollectionSpec.LoadAndAssign. +type AgentLagacyKernel310Maps struct { AcceptArgsMap *ebpf.Map `ebpf:"accept_args_map"` ActiveSslReadArgsMap *ebpf.Map `ebpf:"active_ssl_read_args_map"` ActiveSslWriteArgsMap *ebpf.Map `ebpf:"active_ssl_write_args_map"` @@ -313,7 +329,14 @@ type AgentOldMaps struct { EnabledLocalPortMap *ebpf.Map `ebpf:"enabled_local_port_map"` EnabledRemoteIpv4Map *ebpf.Map `ebpf:"enabled_remote_ipv4_map"` EnabledRemotePortMap *ebpf.Map `ebpf:"enabled_remote_port_map"` + FilterMntnsMap *ebpf.Map `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.Map `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.Map `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.Map `ebpf:"filter_pidns_map"` + KernEvtT_map *ebpf.Map `ebpf:"kern_evt_t_map"` + NatFlowMap *ebpf.Map `ebpf:"nat_flow_map"` ProcExecEvents *ebpf.Map `ebpf:"proc_exec_events"` + ProcExitEvents *ebpf.Map `ebpf:"proc_exit_events"` Rb *ebpf.Map `ebpf:"rb"` ReadArgsMap *ebpf.Map `ebpf:"read_args_map"` SockKeyConnIdMap *ebpf.Map `ebpf:"sock_key_conn_id_map"` @@ -326,8 +349,8 @@ type AgentOldMaps struct { WriteArgsMap *ebpf.Map `ebpf:"write_args_map"` } -func (m *AgentOldMaps) Close() error { - return _AgentOldClose( +func (m *AgentLagacyKernel310Maps) Close() error { + return _AgentLagacyKernel310Close( m.AcceptArgsMap, m.ActiveSslReadArgsMap, m.ActiveSslWriteArgsMap, @@ -341,7 +364,14 @@ func (m *AgentOldMaps) Close() error { m.EnabledLocalPortMap, m.EnabledRemoteIpv4Map, m.EnabledRemotePortMap, + m.FilterMntnsMap, + m.FilterNetnsMap, + m.FilterPidMap, + m.FilterPidnsMap, + m.KernEvtT_map, + m.NatFlowMap, m.ProcExecEvents, + m.ProcExitEvents, m.Rb, m.ReadArgsMap, m.SockKeyConnIdMap, @@ -355,15 +385,17 @@ func (m *AgentOldMaps) Close() error { ) } -// AgentOldPrograms contains all programs after they have been loaded into the kernel. +// AgentLagacyKernel310Programs contains all programs after they have been loaded into the kernel. // -// It can be passed to LoadAgentOldObjects or ebpf.CollectionSpec.LoadAndAssign. -type AgentOldPrograms struct { +// It can be passed to LoadAgentLagacyKernel310Objects or ebpf.CollectionSpec.LoadAndAssign. +type AgentLagacyKernel310Programs struct { DevHardStartXmit *ebpf.Program `ebpf:"dev_hard_start_xmit"` DevQueueXmit *ebpf.Program `ebpf:"dev_queue_xmit"` IpQueueXmit *ebpf.Program `ebpf:"ip_queue_xmit"` IpQueueXmit2 *ebpf.Program `ebpf:"ip_queue_xmit2"` IpRcvCore *ebpf.Program `ebpf:"ip_rcv_core"` + KprobeNfNatManipPkt *ebpf.Program `ebpf:"kprobe__nf_nat_manip_pkt"` + KprobeNfNatPacket *ebpf.Program `ebpf:"kprobe__nf_nat_packet"` SecuritySocketRecvmsgEnter *ebpf.Program `ebpf:"security_socket_recvmsg_enter"` SecuritySocketSendmsgEnter *ebpf.Program `ebpf:"security_socket_sendmsg_enter"` SkbCopyDatagramIovec *ebpf.Program `ebpf:"skb_copy_datagram_iovec"` @@ -376,6 +408,7 @@ type AgentOldPrograms struct { TcpV4Rcv *ebpf.Program `ebpf:"tcp_v4_rcv"` TracepointNetifReceiveSkb *ebpf.Program `ebpf:"tracepoint__netif_receive_skb"` TracepointSchedSchedProcessExec *ebpf.Program `ebpf:"tracepoint__sched__sched_process_exec"` + TracepointSchedSchedProcessExit *ebpf.Program `ebpf:"tracepoint__sched__sched_process_exit"` TracepointSyscallsSysEnterAccept4 *ebpf.Program `ebpf:"tracepoint__syscalls__sys_enter_accept4"` TracepointSyscallsSysEnterClose *ebpf.Program `ebpf:"tracepoint__syscalls__sys_enter_close"` TracepointSyscallsSysEnterConnect *ebpf.Program `ebpf:"tracepoint__syscalls__sys_enter_connect"` @@ -401,13 +434,15 @@ type AgentOldPrograms struct { XdpProxy *ebpf.Program `ebpf:"xdp_proxy"` } -func (p *AgentOldPrograms) Close() error { - return _AgentOldClose( +func (p *AgentLagacyKernel310Programs) Close() error { + return _AgentLagacyKernel310Close( p.DevHardStartXmit, p.DevQueueXmit, p.IpQueueXmit, p.IpQueueXmit2, p.IpRcvCore, + p.KprobeNfNatManipPkt, + p.KprobeNfNatPacket, p.SecuritySocketRecvmsgEnter, p.SecuritySocketSendmsgEnter, p.SkbCopyDatagramIovec, @@ -420,6 +455,7 @@ func (p *AgentOldPrograms) Close() error { p.TcpV4Rcv, p.TracepointNetifReceiveSkb, p.TracepointSchedSchedProcessExec, + p.TracepointSchedSchedProcessExit, p.TracepointSyscallsSysEnterAccept4, p.TracepointSyscallsSysEnterClose, p.TracepointSyscallsSysEnterConnect, @@ -446,7 +482,7 @@ func (p *AgentOldPrograms) Close() error { ) } -func _AgentOldClose(closers ...io.Closer) error { +func _AgentLagacyKernel310Close(closers ...io.Closer) error { for _, closer := range closers { if err := closer.Close(); err != nil { return err @@ -457,5 +493,5 @@ func _AgentOldClose(closers ...io.Closer) error { // Do not access this directly. // -//go:embed agentold_x86_bpfel.o -var _AgentOldBytes []byte +//go:embed agentlagacykernel310_x86_bpfel.o +var _AgentLagacyKernel310Bytes []byte diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.1.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.1.1.el7.x86_64.btf index de74fb1f..37875a9e 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.1.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.1.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.1.2.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.1.2.el7.x86_64.btf index de74fb1f..37875a9e 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.1.2.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.1.2.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.12.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.12.1.el7.x86_64.btf index de74fb1f..37875a9e 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.12.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.12.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.18.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.18.1.el7.x86_64.btf index de74fb1f..37875a9e 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.18.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.18.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.4.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.4.1.el7.x86_64.btf index de74fb1f..37875a9e 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.4.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.4.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.4.2.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.4.2.el7.x86_64.btf index de74fb1f..37875a9e 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.4.2.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.4.2.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.4.3.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.4.3.el7.x86_64.btf index de74fb1f..37875a9e 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.4.3.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.4.3.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.7.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.7.1.el7.x86_64.btf index de74fb1f..37875a9e 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.7.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.7.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.9.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.9.1.el7.x86_64.btf index de74fb1f..37875a9e 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.9.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.9.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.el7.x86_64.btf index de74fb1f..37875a9e 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1062.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.10.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.10.1.el7.x86_64.btf index de74fb1f..37875a9e 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.10.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.10.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.13.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.13.1.el7.x86_64.btf index de74fb1f..37875a9e 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.13.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.13.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.18.2.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.18.2.el7.x86_64.btf index de74fb1f..37875a9e 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.18.2.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.18.2.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.19.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.19.1.el7.x86_64.btf index de74fb1f..37875a9e 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.19.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.19.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.8.2.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.8.2.el7.x86_64.btf index de74fb1f..37875a9e 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.8.2.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.8.2.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.el7.x86_64.btf index de74fb1f..37875a9e 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1127.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.102.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.102.1.el7.x86_64.btf index 8c1d573c..3c275905 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.102.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.102.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.105.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.105.1.el7.x86_64.btf index 8c1d573c..3c275905 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.105.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.105.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.108.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.108.1.el7.x86_64.btf index 8c1d573c..3c275905 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.108.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.108.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.11.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.11.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.11.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.11.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.114.2.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.114.2.el7.x86_64.btf index 8c1d573c..3c275905 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.114.2.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.114.2.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.118.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.118.1.el7.x86_64.btf index 8c1d573c..3c275905 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.118.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.118.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.119.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.119.1.el7.x86_64.btf index 8c1d573c..3c275905 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.119.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.119.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.15.2.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.15.2.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.15.2.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.15.2.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.2.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.2.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.2.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.2.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.2.2.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.2.2.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.2.2.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.2.2.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.21.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.21.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.21.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.21.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.24.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.24.1.el7.x86_64.btf index 8c1d573c..3c275905 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.24.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.24.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.25.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.25.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.25.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.25.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.31.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.31.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.31.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.31.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.36.2.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.36.2.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.36.2.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.36.2.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.41.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.41.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.41.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.41.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.42.2.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.42.2.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.42.2.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.42.2.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.45.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.45.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.45.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.45.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.49.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.49.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.49.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.49.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.53.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.53.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.53.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.53.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.59.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.59.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.59.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.59.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.6.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.6.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.6.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.6.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.62.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.62.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.62.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.62.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.66.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.66.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.66.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.66.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.71.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.71.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.71.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.71.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.76.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.76.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.76.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.76.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.80.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.80.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.80.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.80.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.81.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.81.1.el7.x86_64.btf index 8c1d573c..3c275905 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.81.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.81.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.83.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.83.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.83.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.83.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.88.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.88.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.88.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.88.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.90.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.90.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.90.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.90.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.92.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.92.1.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.92.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.92.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.95.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.95.1.el7.x86_64.btf index 8c1d573c..3c275905 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.95.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.95.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.99.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.99.1.el7.x86_64.btf index 8c1d573c..3c275905 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.99.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.99.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.el7.x86_64.btf index 1c98a488..ceafe0d4 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-1160.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.1.3.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.1.3.el7.x86_64.btf index 347e72fb..5db5888c 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.1.3.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.1.3.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.10.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.10.1.el7.x86_64.btf index 347e72fb..5db5888c 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.10.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.10.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.12.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.12.1.el7.x86_64.btf index 347e72fb..5db5888c 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.12.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.12.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.12.2.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.12.2.el7.x86_64.btf index 347e72fb..5db5888c 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.12.2.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.12.2.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.21.2.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.21.2.el7.x86_64.btf index 347e72fb..5db5888c 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.21.2.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.21.2.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.21.3.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.21.3.el7.x86_64.btf index 347e72fb..5db5888c 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.21.3.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.21.3.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.27.2.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.27.2.el7.x86_64.btf index 347e72fb..5db5888c 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.27.2.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.27.2.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.5.1.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.5.1.el7.x86_64.btf index 347e72fb..5db5888c 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.5.1.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.5.1.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.el7.x86_64.btf index 347e72fb..5db5888c 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/3.10.0-957.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/3.10.0-957.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/4.19.104-300.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/4.19.104-300.el7.x86_64.btf index a1816aa7..2a08cc60 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/4.19.104-300.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/4.19.104-300.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/4.19.110-300.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/4.19.110-300.el7.x86_64.btf index a1816aa7..2a08cc60 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/4.19.110-300.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/4.19.110-300.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/4.19.113-300.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/4.19.113-300.el7.x86_64.btf index a1816aa7..2a08cc60 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/4.19.113-300.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/4.19.113-300.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/4.19.84-300.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/4.19.84-300.el7.x86_64.btf index a1816aa7..2a08cc60 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/4.19.84-300.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/4.19.84-300.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/4.19.94-300.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/4.19.94-300.el7.x86_64.btf index a1816aa7..2a08cc60 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/4.19.94-300.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/4.19.94-300.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/7/x86_64/5.4.28-200.el7.x86_64.btf b/bpf/custom-archive/centos/7/x86_64/5.4.28-200.el7.x86_64.btf index 72e3f4f6..5570363a 100644 Binary files a/bpf/custom-archive/centos/7/x86_64/5.4.28-200.el7.x86_64.btf and b/bpf/custom-archive/centos/7/x86_64/5.4.28-200.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/8/x86_64/4.18.0-147.0.3.el8_1.x86_64.btf b/bpf/custom-archive/centos/8/x86_64/4.18.0-147.0.3.el8_1.x86_64.btf index 06b597ec..095a36c3 100644 Binary files a/bpf/custom-archive/centos/8/x86_64/4.18.0-147.0.3.el8_1.x86_64.btf and b/bpf/custom-archive/centos/8/x86_64/4.18.0-147.0.3.el8_1.x86_64.btf differ diff --git a/bpf/custom-archive/centos/8/x86_64/4.18.0-147.3.1.el8_1.x86_64.btf b/bpf/custom-archive/centos/8/x86_64/4.18.0-147.3.1.el8_1.x86_64.btf index 06b597ec..095a36c3 100644 Binary files a/bpf/custom-archive/centos/8/x86_64/4.18.0-147.3.1.el8_1.x86_64.btf and b/bpf/custom-archive/centos/8/x86_64/4.18.0-147.3.1.el8_1.x86_64.btf differ diff --git a/bpf/custom-archive/centos/8/x86_64/4.18.0-147.5.1.el8_1.x86_64.btf b/bpf/custom-archive/centos/8/x86_64/4.18.0-147.5.1.el8_1.x86_64.btf index 06b597ec..095a36c3 100644 Binary files a/bpf/custom-archive/centos/8/x86_64/4.18.0-147.5.1.el8_1.x86_64.btf and b/bpf/custom-archive/centos/8/x86_64/4.18.0-147.5.1.el8_1.x86_64.btf differ diff --git a/bpf/custom-archive/centos/8/x86_64/4.18.0-147.8.1.el8_1.x86_64.btf b/bpf/custom-archive/centos/8/x86_64/4.18.0-147.8.1.el8_1.x86_64.btf index 06b597ec..095a36c3 100644 Binary files a/bpf/custom-archive/centos/8/x86_64/4.18.0-147.8.1.el8_1.x86_64.btf and b/bpf/custom-archive/centos/8/x86_64/4.18.0-147.8.1.el8_1.x86_64.btf differ diff --git a/bpf/custom-archive/centos/8/x86_64/4.18.0-147.el8.x86_64.btf b/bpf/custom-archive/centos/8/x86_64/4.18.0-147.el8.x86_64.btf index 06b597ec..095a36c3 100644 Binary files a/bpf/custom-archive/centos/8/x86_64/4.18.0-147.el8.x86_64.btf and b/bpf/custom-archive/centos/8/x86_64/4.18.0-147.el8.x86_64.btf differ diff --git a/bpf/custom-archive/centos/8/x86_64/4.18.0-80.7.1.el8_0.x86_64.btf b/bpf/custom-archive/centos/8/x86_64/4.18.0-80.7.1.el8_0.x86_64.btf index c132e684..72073cff 100644 Binary files a/bpf/custom-archive/centos/8/x86_64/4.18.0-80.7.1.el8_0.x86_64.btf and b/bpf/custom-archive/centos/8/x86_64/4.18.0-80.7.1.el8_0.x86_64.btf differ diff --git a/bpf/custom-archive/centos/8/x86_64/4.18.0-80.el8.x86_64.btf b/bpf/custom-archive/centos/8/x86_64/4.18.0-80.el8.x86_64.btf index c132e684..2eb352ac 100644 Binary files a/bpf/custom-archive/centos/8/x86_64/4.18.0-80.el8.x86_64.btf and b/bpf/custom-archive/centos/8/x86_64/4.18.0-80.el8.x86_64.btf differ diff --git a/bpf/custom-archive/centos/8/x86_64/4.19.104-300.el7.x86_64.btf b/bpf/custom-archive/centos/8/x86_64/4.19.104-300.el7.x86_64.btf index a1816aa7..2a08cc60 100644 Binary files a/bpf/custom-archive/centos/8/x86_64/4.19.104-300.el7.x86_64.btf and b/bpf/custom-archive/centos/8/x86_64/4.19.104-300.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/8/x86_64/4.19.110-300.el7.x86_64.btf b/bpf/custom-archive/centos/8/x86_64/4.19.110-300.el7.x86_64.btf index a1816aa7..2a08cc60 100644 Binary files a/bpf/custom-archive/centos/8/x86_64/4.19.110-300.el7.x86_64.btf and b/bpf/custom-archive/centos/8/x86_64/4.19.110-300.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/8/x86_64/4.19.113-300.el7.x86_64.btf b/bpf/custom-archive/centos/8/x86_64/4.19.113-300.el7.x86_64.btf index a1816aa7..2a08cc60 100644 Binary files a/bpf/custom-archive/centos/8/x86_64/4.19.113-300.el7.x86_64.btf and b/bpf/custom-archive/centos/8/x86_64/4.19.113-300.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/8/x86_64/4.19.84-300.el7.x86_64.btf b/bpf/custom-archive/centos/8/x86_64/4.19.84-300.el7.x86_64.btf index a1816aa7..2a08cc60 100644 Binary files a/bpf/custom-archive/centos/8/x86_64/4.19.84-300.el7.x86_64.btf and b/bpf/custom-archive/centos/8/x86_64/4.19.84-300.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/8/x86_64/4.19.94-300.el7.x86_64.btf b/bpf/custom-archive/centos/8/x86_64/4.19.94-300.el7.x86_64.btf index a1816aa7..2a08cc60 100644 Binary files a/bpf/custom-archive/centos/8/x86_64/4.19.94-300.el7.x86_64.btf and b/bpf/custom-archive/centos/8/x86_64/4.19.94-300.el7.x86_64.btf differ diff --git a/bpf/custom-archive/centos/8/x86_64/5.4.28-200.el7.x86_64.btf b/bpf/custom-archive/centos/8/x86_64/5.4.28-200.el7.x86_64.btf index 72e3f4f6..5570363a 100644 Binary files a/bpf/custom-archive/centos/8/x86_64/5.4.28-200.el7.x86_64.btf and b/bpf/custom-archive/centos/8/x86_64/5.4.28-200.el7.x86_64.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-101-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-101-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-101-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-101-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-106-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-106-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-106-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-106-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-108-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-108-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-108-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-108-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-109-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-109-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-109-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-109-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-111-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-111-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-111-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-111-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-112-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-112-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-112-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-112-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-115-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-115-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-115-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-115-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-117-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-117-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-117-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-117-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-118-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-118-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-118-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-118-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-121-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-121-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-121-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-121-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-122-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-122-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-122-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-122-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-123-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-123-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-123-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-123-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-124-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-124-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-124-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-124-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-128-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-128-generic.btf index 674a7f82..6fae9bc3 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-128-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-128-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-129-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-129-generic.btf index 674a7f82..6fae9bc3 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-129-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-129-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-130-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-130-generic.btf index 674a7f82..6fae9bc3 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-130-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-130-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-132-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-132-generic.btf index 674a7f82..6fae9bc3 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-132-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-132-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-134-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-134-generic.btf index 674a7f82..6fae9bc3 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-134-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-134-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-135-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-135-generic.btf index 674a7f82..6fae9bc3 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-135-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-135-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-136-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-136-generic.btf index 674a7f82..6fae9bc3 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-136-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-136-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-137-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-137-generic.btf index 674a7f82..6fae9bc3 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-137-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-137-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-139-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-139-generic.btf index 674a7f82..6fae9bc3 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-139-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-139-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-140-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-140-generic.btf index 674a7f82..6fae9bc3 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-140-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-140-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-141-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-141-generic.btf index 674a7f82..6fae9bc3 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-141-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-141-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-142-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-142-generic.btf index 674a7f82..6fae9bc3 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-142-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-142-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-143-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-143-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-143-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-143-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-144-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-144-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-144-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-144-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-147-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-147-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-147-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-147-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-151-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-151-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-151-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-151-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-153-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-153-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-153-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-153-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-154-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-154-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-154-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-154-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-156-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-156-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-156-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-156-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-158-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-158-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-158-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-158-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-159-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-159-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-159-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-159-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-161-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-161-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-161-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-161-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-162-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-162-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-162-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-162-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-163-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-163-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-163-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-163-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-166-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-166-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-166-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-166-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-167-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-167-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-167-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-167-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-169-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-169-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-169-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-169-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-171-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-171-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-171-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-171-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-173-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-173-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-173-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-173-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-175-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-175-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-175-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-175-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-176-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-176-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-176-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-176-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-177-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-177-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-177-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-177-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-180-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-180-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-180-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-180-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-184-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-184-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-184-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-184-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-187-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-187-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-187-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-187-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-188-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-188-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-188-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-188-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-189-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-189-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-189-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-189-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-191-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-191-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-191-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-191-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-192-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-192-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-192-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-192-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-193-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-193-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-193-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-193-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-194-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-194-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-194-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-194-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-196-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-196-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-196-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-196-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-197-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-197-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-197-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-197-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-20-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-20-generic.btf index 67e133e1..a8ade2bc 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-20-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-20-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-200-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-200-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-200-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-200-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-201-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-201-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-201-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-201-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-202-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-202-generic.btf index 1cee29fd..d02909b6 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-202-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-202-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-204-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-204-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-204-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-204-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-206-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-206-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-206-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-206-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-208-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-208-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-208-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-208-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-209-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-209-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-209-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-209-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-210-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-210-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-210-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-210-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-211-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-211-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-211-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-211-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-212-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-212-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-212-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-212-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-213-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-213-generic.btf index 674a7f82..530edf14 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-213-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-213-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-22-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-22-generic.btf index 67e133e1..a8ade2bc 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-22-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-22-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-23-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-23-generic.btf index 67e133e1..a8ade2bc 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-23-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-23-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-24-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-24-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-24-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-24-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-29-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-29-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-29-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-29-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-30-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-30-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-30-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-30-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-32-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-32-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-32-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-32-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-33-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-33-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-33-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-33-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-34-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-34-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-34-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-34-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-36-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-36-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-36-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-36-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-38-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-38-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-38-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-38-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-39-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-39-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-39-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-39-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-42-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-42-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-42-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-42-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-43-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-43-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-43-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-43-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-44-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-44-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-44-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-44-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-45-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-45-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-45-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-45-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-46-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-46-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-46-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-46-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-47-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-47-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-47-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-47-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-48-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-48-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-48-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-48-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-50-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-50-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-50-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-50-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-51-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-51-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-51-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-51-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-52-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-52-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-52-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-52-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-54-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-54-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-54-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-54-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-55-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-55-generic.btf index 0da5cc6e..877c4485 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-55-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-55-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-58-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-58-generic.btf index 0da5cc6e..d89bf430 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-58-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-58-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-60-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-60-generic.btf index c3883903..c8278718 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-60-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-60-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-62-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-62-generic.btf index c3883903..c8278718 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-62-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-62-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-64-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-64-generic.btf index c3883903..c8278718 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-64-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-64-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-65-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-65-generic.btf index c3883903..c8278718 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-65-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-65-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-66-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-66-generic.btf index c3883903..c8278718 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-66-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-66-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-69-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-69-generic.btf index c3883903..c8278718 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-69-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-69-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-70-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-70-generic.btf index c3883903..c8278718 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-70-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-70-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-72-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-72-generic.btf index c3883903..c8278718 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-72-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-72-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-74-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-74-generic.btf index c3883903..c8278718 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-74-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-74-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-76-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-76-generic.btf index c3883903..c8278718 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-76-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-76-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-88-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-88-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-88-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-88-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-91-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-91-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-91-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-91-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-96-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-96-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-96-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-96-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-99-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-99-generic.btf index 5d9a2704..e51badb9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-99-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.15.0-99-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-13-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-13-generic.btf index 1172774a..da2f8e88 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-13-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-13-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-14-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-14-generic.btf index 1172774a..da2f8e88 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-14-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-14-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-15-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-15-generic.btf index 1172774a..da2f8e88 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-15-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-15-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-16-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-16-generic.btf index 1172774a..da2f8e88 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-16-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-16-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-17-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-17-generic.btf index 1172774a..da2f8e88 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-17-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-17-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-18-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-18-generic.btf index 1172774a..da2f8e88 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-18-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-18-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-20-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-20-generic.btf index 1172774a..da2f8e88 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-20-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-20-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-21-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-21-generic.btf index 1172774a..da2f8e88 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-21-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-21-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-22-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-22-generic.btf index 1172774a..da2f8e88 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-22-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-22-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-24-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-24-generic.btf index 1172774a..da2f8e88 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-24-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-24-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-25-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-25-generic.btf index 1172774a..da2f8e88 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-25-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/4.18.0-25-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-15-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-15-generic.btf index a4c9ab4a..561c16a8 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-15-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-15-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-16-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-16-generic.btf index a4c9ab4a..561c16a8 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-16-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-16-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-17-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-17-generic.btf index a4c9ab4a..561c16a8 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-17-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-17-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-19-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-19-generic.btf index a4c9ab4a..561c16a8 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-19-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-19-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-20-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-20-generic.btf index a4c9ab4a..561c16a8 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-20-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-20-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-23-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-23-generic.btf index a4c9ab4a..561c16a8 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-23-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-23-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-25-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-25-generic.btf index a4c9ab4a..561c16a8 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-25-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-25-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-27-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-27-generic.btf index a4c9ab4a..561c16a8 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-27-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-27-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-29-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-29-generic.btf index a4c9ab4a..561c16a8 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-29-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-29-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-31-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-31-generic.btf index a4c9ab4a..561c16a8 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-31-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-31-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-32-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-32-generic.btf index a4c9ab4a..561c16a8 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-32-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-32-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-35-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-35-generic.btf index a4c9ab4a..561c16a8 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-35-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-35-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-36-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-36-generic.btf index a4c9ab4a..561c16a8 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-36-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-36-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-37-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-37-generic.btf index a4c9ab4a..561c16a8 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-37-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-37-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-43-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-43-generic.btf index a4c9ab4a..f5424605 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-43-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-43-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-44-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-44-generic.btf index a4c9ab4a..f5424605 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-44-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-44-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-47-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-47-generic.btf index a4c9ab4a..f5424605 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-47-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-47-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-48-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-48-generic.btf index a4c9ab4a..f5424605 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-48-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-48-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-52-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-52-generic.btf index a4c9ab4a..f5424605 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-52-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-52-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-53-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-53-generic.btf index a4c9ab4a..f5424605 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-53-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-53-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-58-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-58-generic.btf index a4c9ab4a..f5424605 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-58-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-58-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-60-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-60-generic.btf index a4c9ab4a..f5424605 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-60-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-60-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-61-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-61-generic.btf index a4c9ab4a..f5424605 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-61-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-61-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-62-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-62-generic.btf index a4c9ab4a..f5424605 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-62-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-62-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-63-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-63-generic.btf index a4c9ab4a..f5424605 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-63-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-63-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-65-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-65-generic.btf index a4c9ab4a..f5424605 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-65-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.0.0-65-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-19-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-19-generic.btf index db98c564..ddbdbb51 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-19-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-19-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-22-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-22-generic.btf index db98c564..ddbdbb51 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-22-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-22-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-23-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-23-generic.btf index db98c564..ddbdbb51 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-23-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-23-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-24-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-24-generic.btf index db98c564..aeafdae9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-24-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-24-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-26-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-26-generic.btf index db98c564..aeafdae9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-26-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-26-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-28-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-28-generic.btf index db98c564..aeafdae9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-28-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-28-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-40-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-40-generic.btf index db98c564..aeafdae9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-40-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-40-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-42-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-42-generic.btf index db98c564..aeafdae9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-42-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-42-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-45-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-45-generic.btf index db98c564..aeafdae9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-45-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-45-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-46-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-46-generic.btf index db98c564..aeafdae9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-46-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-46-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-51-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-51-generic.btf index db98c564..aeafdae9 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-51-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-51-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-53-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-53-generic.btf index 567f295c..abcc945a 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-53-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-53-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-59-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-59-generic.btf index 567f295c..abcc945a 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-59-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-59-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-61-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-61-generic.btf index 567f295c..abcc945a 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-61-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-61-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-62-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-62-generic.btf index 567f295c..abcc945a 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-62-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-62-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-64-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-64-generic.btf index 567f295c..abcc945a 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-64-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-64-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-66-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-66-generic.btf index 567f295c..abcc945a 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-66-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-66-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-67-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-67-generic.btf index 567f295c..abcc945a 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-67-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-67-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-68-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-68-generic.btf index 567f295c..abcc945a 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-68-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-68-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-69-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-69-generic.btf index 567f295c..abcc945a 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-69-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-69-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-70-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-70-generic.btf index 567f295c..abcc945a 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-70-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-70-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-72-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-72-generic.btf index 567f295c..abcc945a 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-72-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-72-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-73-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-73-generic.btf index 567f295c..abcc945a 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-73-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-73-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-74-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-74-generic.btf index 567f295c..abcc945a 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-74-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-74-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-75-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-75-generic.btf index 567f295c..abcc945a 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-75-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-75-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-76-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-76-generic.btf index 567f295c..abcc945a 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-76-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.3.0-76-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-26-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-26-generic.btf index 83a3ba84..39d6e07c 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-26-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-26-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-28-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-28-generic.btf index 83a3ba84..39d6e07c 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-28-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-28-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-37-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-37-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-37-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-37-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-39-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-39-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-39-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-39-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-40-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-40-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-40-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-40-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-42-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-42-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-42-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-42-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-45-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-45-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-45-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-45-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-47-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-47-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-47-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-47-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-48-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-48-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-48-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-48-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-51-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-51-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-51-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-51-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-52-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-52-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-52-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-52-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-53-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-53-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-53-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-53-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-54-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-54-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-54-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-54-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-58-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-58-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-58-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-58-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-59-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-59-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-59-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-59-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-60-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-60-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-60-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-60-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-62-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-62-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-62-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-62-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-64-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-64-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-64-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-64-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-65-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-65-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-65-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-65-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-66-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-66-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-66-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-66-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-67-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-67-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-67-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-67-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-70-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-70-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-70-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-70-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-71-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-71-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-71-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-71-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-72-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-72-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-72-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-72-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-73-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-73-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-73-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-73-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-74-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-74-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-74-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-74-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-77-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-77-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-77-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-77-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-80-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-80-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-80-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-80-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-81-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-81-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-81-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-81-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-84-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-84-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-84-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-84-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-86-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-86-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-86-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-86-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-87-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-87-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-87-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-87-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-89-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-89-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-89-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-89-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-90-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-90-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-90-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-90-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-91-generic.btf b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-91-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-91-generic.btf and b/bpf/custom-archive/ubuntu/18.04/x86_64/5.4.0-91-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-26-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-26-generic.btf index 83a3ba84..39d6e07c 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-26-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-26-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-28-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-28-generic.btf index 83a3ba84..39d6e07c 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-28-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-28-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-29-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-29-generic.btf index 83a3ba84..39d6e07c 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-29-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-29-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-31-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-31-generic.btf index 83a3ba84..39d6e07c 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-31-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-31-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-33-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-33-generic.btf index 83a3ba84..39d6e07c 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-33-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-33-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-37-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-37-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-37-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-37-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-39-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-39-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-39-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-39-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-40-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-40-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-40-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-40-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-42-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-42-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-42-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-42-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-45-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-45-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-45-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-45-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-47-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-47-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-47-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-47-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-48-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-48-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-48-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-48-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-51-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-51-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-51-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-51-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-52-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-52-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-52-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-52-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-53-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-53-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-53-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-53-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-54-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-54-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-54-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-54-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-58-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-58-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-58-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-58-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-59-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-59-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-59-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-59-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-60-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-60-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-60-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-60-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-62-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-62-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-62-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-62-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-64-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-64-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-64-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-64-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-65-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-65-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-65-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-65-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-66-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-66-generic.btf index de743af9..e613e571 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-66-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-66-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-67-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-67-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-67-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-67-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-70-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-70-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-70-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-70-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-71-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-71-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-71-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-71-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-72-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-72-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-72-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-72-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-73-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-73-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-73-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-73-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-74-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-74-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-74-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-74-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-77-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-77-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-77-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-77-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-80-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-80-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-80-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-80-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-81-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-81-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-81-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-81-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-84-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-84-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-84-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-84-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-86-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-86-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-86-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-86-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-88-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-88-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-88-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-88-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-89-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-89-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-89-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-89-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-90-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-90-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-90-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-90-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-91-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-91-generic.btf index dd7eeca3..45eea659 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-91-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.4.0-91-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-23-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-23-generic.btf index 09fe25cd..f1962f9b 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-23-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-23-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-25-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-25-generic.btf index 09fe25cd..f1962f9b 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-25-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-25-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-28-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-28-generic.btf index 09fe25cd..f1962f9b 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-28-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-28-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-29-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-29-generic.btf index 09fe25cd..f1962f9b 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-29-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-29-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-33-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-33-generic.btf index 09fe25cd..f1962f9b 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-33-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-33-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-34-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-34-generic.btf index 09fe25cd..a97ac08e 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-34-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-34-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-36-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-36-generic.btf index 09fe25cd..a97ac08e 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-36-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-36-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-38-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-38-generic.btf index 09fe25cd..a97ac08e 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-38-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-38-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-40-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-40-generic.btf index 09fe25cd..a97ac08e 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-40-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-40-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-41-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-41-generic.btf index 09fe25cd..a97ac08e 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-41-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-41-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-43-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-43-generic.btf index 09fe25cd..a97ac08e 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-43-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-43-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-44-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-44-generic.btf index 09fe25cd..a97ac08e 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-44-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-44-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-45-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-45-generic.btf index 09fe25cd..a97ac08e 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-45-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-45-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-48-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-48-generic.btf index 09fe25cd..a97ac08e 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-48-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-48-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-49-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-49-generic.btf index 667b5ac1..e2706142 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-49-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-49-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-50-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-50-generic.btf index 667b5ac1..e2706142 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-50-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-50-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-53-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-53-generic.btf index 667b5ac1..e2706142 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-53-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-53-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-55-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-55-generic.btf index 667b5ac1..e2706142 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-55-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-55-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-59-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-59-generic.btf index 667b5ac1..e2706142 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-59-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-59-generic.btf differ diff --git a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-63-generic.btf b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-63-generic.btf index 667b5ac1..e2706142 100644 Binary files a/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-63-generic.btf and b/bpf/custom-archive/ubuntu/20.04/x86_64/5.8.0-63-generic.btf differ diff --git a/bpf/data_common.h b/bpf/data_common.h index 9eac0aa2..fd4f7b38 100644 --- a/bpf/data_common.h +++ b/bpf/data_common.h @@ -10,6 +10,35 @@ struct nested_syscall_fd_t { uint32_t syscall_len; }; +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 10); + __type(key, u32); + __type(value, u8); +} filter_mntns_map SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 10); + __type(key, u32); + __type(value, u8); +} filter_pidns_map SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 10); + __type(key, u32); + __type(value, u8); +} filter_netns_map SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 10); + __type(key, u32); + __type(value, u8); +} filter_pid_map SEC(".maps"); + + struct { __uint(type, BPF_MAP_TYPE_HASH); __uint(key_size, sizeof(uint64_t)); @@ -34,7 +63,6 @@ struct { __uint(map_flags, 0); } ssl_user_space_call_map SEC(".maps"); -#ifdef KERNEL_VERSION_BELOW_58 struct { __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY); __uint(key_size, sizeof(u32)); @@ -55,24 +83,6 @@ struct { __uint(key_size, sizeof(u32)); __uint(value_size, sizeof(u32)); } conn_evt_rb SEC(".maps"); -#else -struct { - __uint(type, BPF_MAP_TYPE_RINGBUF); - __uint(max_entries, 1<<24); -} rb SEC(".maps"); -struct { - __uint(type, BPF_MAP_TYPE_RINGBUF); - __uint(max_entries, 1<<24); -} syscall_rb SEC(".maps"); -struct { - __uint(type, BPF_MAP_TYPE_RINGBUF); - __uint(max_entries, 1<<24); -} ssl_rb SEC(".maps"); -struct { - __uint(type, BPF_MAP_TYPE_RINGBUF); - __uint(max_entries, 1 << 24); -} conn_evt_rb SEC(".maps"); -#endif MY_BPF_HASH(conn_info_map, uint64_t, struct conn_info_t); MY_BPF_ARRAY_PERCPU(syscall_data_map, struct kern_evt_data) @@ -83,12 +93,8 @@ const int32_t kInvalidFD = -1; static bool __always_inline report_conn_evt(void* ctx, struct conn_info_t *conn_info, enum conn_type_t type, uint64_t ts) { -#ifdef KERNEL_VERSION_BELOW_58 struct conn_evt_t _evt = {0}; struct conn_evt_t* evt = &_evt; -#else - struct conn_evt_t* evt = bpf_ringbuf_reserve(&conn_evt_rb, sizeof(struct conn_evt_t), 0); -#endif if (!evt) { return 0; } @@ -100,11 +106,7 @@ static bool __always_inline report_conn_evt(void* ctx, struct conn_info_t *conn_ } else { evt->ts = bpf_ktime_get_ns(); } -#ifdef KERNEL_VERSION_BELOW_58 bpf_perf_event_output(ctx, &conn_evt_rb, BPF_F_CURRENT_CPU, evt, sizeof(struct conn_evt_t)); -#else - bpf_ringbuf_submit(evt, 0); -#endif return 1; } @@ -143,11 +145,7 @@ static void __always_inline report_syscall_buf_without_data(void* ctx, uint64_t evt->buf_size = 0; size_t __len = sizeof(struct kern_evt) + sizeof(uint32_t); -#ifdef KERNEL_VERSION_BELOW_58 bpf_perf_event_output(ctx, &syscall_rb, BPF_F_CURRENT_CPU, evt, __len); -#else - bpf_ringbuf_output(&syscall_rb, evt, __len, 0); -#endif } static void __always_inline report_syscall_buf(void* ctx, uint64_t seq, struct conn_id_s_t *conn_id_s, size_t len, enum step_t step, uint64_t ts, const char* buf, enum source_function_t source_fn) { size_t _len = len < MAX_MSG_SIZE ? len : MAX_MSG_SIZE; @@ -184,11 +182,7 @@ static void __always_inline report_syscall_buf(void* ctx, uint64_t seq, struct c } evt->buf_size = amount_copied; size_t __len = sizeof(struct kern_evt) + sizeof(uint32_t) + amount_copied; -#ifdef KERNEL_VERSION_BELOW_58 bpf_perf_event_output(ctx, &syscall_rb, BPF_F_CURRENT_CPU, evt, __len); -#else - bpf_ringbuf_output(&syscall_rb, evt, __len, 0); -#endif } static void __always_inline report_syscall_evt(void* ctx, uint64_t seq, struct conn_id_s_t *conn_id_s, uint32_t len, enum step_t step, struct data_args *args) { report_syscall_buf(ctx, seq, conn_id_s, len, step, args->ts, args->buf, args->source_fn); @@ -231,11 +225,7 @@ static void __always_inline report_ssl_buf(void* ctx, uint64_t seq, struct conn_ } evt->buf_size = amount_copied; size_t __len = sizeof(struct kern_evt) + sizeof(uint32_t) + sizeof(uint64_t)+ sizeof(uint32_t) + amount_copied; -#ifdef KERNEL_VERSION_BELOW_58 bpf_perf_event_output(ctx, &ssl_rb, BPF_F_CURRENT_CPU, evt, __len); -#else - bpf_ringbuf_output(&ssl_rb, evt, __len, 0); -#endif } static void __always_inline report_ssl_evt(void* ctx, uint64_t seq, struct conn_id_s_t *conn_id_s, uint32_t len, enum step_t step, struct data_args *args, uint32_t syscall_seq, uint32_t syscall_len) { report_ssl_buf(ctx, seq, conn_id_s, len, step, args->ts, args->buf, args->source_fn, syscall_seq, syscall_len); diff --git a/bpf/events.go b/bpf/events.go new file mode 100644 index 00000000..c113e31b --- /dev/null +++ b/bpf/events.go @@ -0,0 +1,369 @@ +package bpf + +import ( + "bytes" + "context" + "encoding/binary" + "errors" + "fmt" + "kyanos/common" + "os" + "unsafe" + + "github.com/cilium/ebpf/perf" +) + +func PullProcessExitEvents(ctx context.Context, channels []chan *AgentProcessExitEvent) error { + pageSize := os.Getpagesize() + perCPUBuffer := pageSize * 4 + eventSize := int(unsafe.Sizeof(AgentProcessExitEvent{})) + if eventSize >= perCPUBuffer { + perCPUBuffer = perCPUBuffer * (1 + (eventSize / perCPUBuffer)) + } + reader, err := perf.NewReader(GetMapFromObjs(Objs, "ProcExitEvents"), perCPUBuffer) + if err == nil { + go func(*perf.Reader) { + defer reader.Close() + for { + select { + case <-ctx.Done(): + return + default: + } + record, err := reader.Read() + if err != nil { + if errors.Is(err, perf.ErrClosed) { + common.BPFLog.Debug("[dataReader] Received signal, exiting..") + return + } + common.BPFLog.Debugf("[dataReader] reading from reader: %s\n", err) + continue + } + + if evt, err := parseExitEvent(record.RawSample); err != nil { + common.AgentLog.Errorf("[dataReader] handleKernEvt err: %s\n", err) + continue + } else { + for _, ch := range channels { + ch <- evt + } + } + } + }(reader) + } + if err != nil { + common.BPFLog.Warningf("[bpf] set up perf reader failed: %s\n", err) + } + return err +} + +func parseExitEvent(rawSample []byte) (*AgentProcessExitEvent, error) { + event := AgentProcessExitEvent{} + if err := binary.Read(bytes.NewBuffer(rawSample), binary.LittleEndian, &event); err != nil { + return nil, fmt.Errorf("parse event: %w", err) + } + return &event, nil +} + +func PullProcessExecEvents(ctx context.Context, channels []chan *AgentProcessExecEvent) error { + pageSize := os.Getpagesize() + perCPUBuffer := pageSize * 4 + eventSize := int(unsafe.Sizeof(AgentProcessExecEvent{})) + if eventSize >= perCPUBuffer { + perCPUBuffer = perCPUBuffer * (1 + (eventSize / perCPUBuffer)) + } + reader, err := perf.NewReader(GetMapFromObjs(Objs, "ProcExecEvents"), perCPUBuffer) + if err == nil { + go func(*perf.Reader) { + defer reader.Close() + for { + select { + case <-ctx.Done(): + return + default: + } + record, err := reader.Read() + if err != nil { + if errors.Is(err, perf.ErrClosed) { + common.BPFLog.Debug("[dataReader] Received signal, exiting..") + return + } + common.BPFLog.Debugf("[dataReader] reading from reader: %s\n", err) + continue + } + + if evt, err := parseExecEvent(record.RawSample); err != nil { + common.AgentLog.Errorf("[dataReader] handleKernEvt err: %s\n", err) + continue + } else { + for _, ch := range channels { + ch <- evt + } + } + } + }(reader) + } + if err != nil { + common.BPFLog.Warningf("[bpf] set up perf reader failed: %s\n", err) + } + return err +} + +func parseExecEvent(rawSample []byte) (*AgentProcessExecEvent, error) { + event := AgentProcessExecEvent{} + if err := binary.Read(bytes.NewBuffer(rawSample), binary.LittleEndian, &event); err != nil { + return nil, fmt.Errorf("parse event: %w", err) + } + return &event, nil +} + +func PullSyscallDataEvents(ctx context.Context, channels []chan *SyscallEventData, perfCPUBufferPageNum int, hook SyscallEventHook) error { + pageSize := os.Getpagesize() + perCPUBuffer := pageSize * perfCPUBufferPageNum + eventSize := int(unsafe.Sizeof(AgentProcessExecEvent{})) + if eventSize >= perCPUBuffer { + perCPUBuffer = perCPUBuffer * (1 + (eventSize / perCPUBuffer)) + } + reader, err := perf.NewReader(GetMapFromObjs(Objs, "SyscallRb"), perCPUBuffer) + if err == nil { + go func(*perf.Reader) { + defer reader.Close() + for { + select { + case <-ctx.Done(): + return + default: + } + record, err := reader.Read() + if err != nil { + if errors.Is(err, perf.ErrClosed) { + common.BPFLog.Debug("[dataReader] Received signal, exiting..") + return + } + common.BPFLog.Debugf("[dataReader] reading from reader: %s\n", err) + continue + } + + if evt, err := parseSyscallDataEvent(record.RawSample); err != nil { + common.AgentLog.Errorf("[dataReader] handle syscall data err: %s\n", err) + continue + } else { + if hook != nil { + hook(evt) + } + tgidfd := evt.SyscallEvent.Ke.ConnIdS.TgidFd + ch := channels[int(tgidfd)%len(channels)] + ch <- evt + } + } + }(reader) + } + if err != nil { + common.BPFLog.Warningf("[bpf] set up perf reader failed: %s\n", err) + } + return err +} + +func parseSyscallDataEvent(rawSample []byte) (*SyscallEventData, error) { + event := new(SyscallEventData) + err := binary.Read(bytes.NewBuffer(rawSample), binary.LittleEndian, &event.SyscallEvent) + if err != nil { + return nil, err + } + msgSize := event.SyscallEvent.BufSize + buf := make([]byte, msgSize) + if msgSize > 0 { + headerSize := uint(unsafe.Sizeof(event.SyscallEvent)) - 4 + err = binary.Read(bytes.NewBuffer(rawSample[headerSize:]), binary.LittleEndian, &buf) + if err != nil { + return nil, err + } + } + event.Buf = buf + + // tgidFd := event.SyscallEvent.Ke.ConnIdS.TgidFd + return event, nil +} + +func PullSslDataEvents(ctx context.Context, channels []chan *SslData, perfCPUBufferPageNum int, hook SslEventHook) error { + pageSize := os.Getpagesize() + perCPUBuffer := pageSize * perfCPUBufferPageNum + eventSize := int(unsafe.Sizeof(SslData{})) + if eventSize >= perCPUBuffer { + perCPUBuffer = perCPUBuffer * (1 + (eventSize / perCPUBuffer)) + } + reader, err := perf.NewReader(GetMapFromObjs(Objs, "SslRb"), perCPUBuffer) + if err == nil { + go func(*perf.Reader) { + defer reader.Close() + for { + select { + case <-ctx.Done(): + return + default: + } + record, err := reader.Read() + if err != nil { + if errors.Is(err, perf.ErrClosed) { + common.BPFLog.Debug("[dataReader] Received signal, exiting..") + return + } + common.BPFLog.Debugf("[dataReader] reading from reader: %s\n", err) + continue + } + + if evt, err := parseSslDataEvent(record.RawSample); err != nil { + common.AgentLog.Errorf("[dataReader] ssl data event err: %s\n", err) + continue + } else { + if hook != nil { + hook(evt) + } + tgidfd := evt.SslEventHeader.Ke.ConnIdS.TgidFd + ch := channels[int(tgidfd)%len(channels)] + ch <- evt + } + } + }(reader) + } + if err != nil { + common.BPFLog.Warningf("[bpf] set up perf reader failed: %s\n", err) + } + return err +} + +func parseSslDataEvent(record []byte) (*SslData, error) { + event := new(SslData) + err := binary.Read(bytes.NewBuffer(record), binary.LittleEndian, &event.SslEventHeader) + if err != nil { + return nil, err + } + msgSize := event.SslEventHeader.BufSize + headerSize := uint(unsafe.Sizeof(event.SslEventHeader)) + buf := make([]byte, msgSize) + err = binary.Read(bytes.NewBuffer(record[headerSize:]), binary.LittleEndian, &buf) + if err != nil { + return nil, err + } + event.Buf = buf + + return event, nil +} + +func PullConnDataEvents(ctx context.Context, channels []chan *AgentConnEvtT, perfCPUBufferPageNum int, hook ConnEventHook) error { + pageSize := os.Getpagesize() + perCPUBuffer := pageSize * perfCPUBufferPageNum + eventSize := int(unsafe.Sizeof(AgentConnEvtT{})) + if eventSize >= perCPUBuffer { + perCPUBuffer = perCPUBuffer * (1 + (eventSize / perCPUBuffer)) + } + reader, err := perf.NewReader(GetMapFromObjs(Objs, "ConnEvtRb"), perCPUBuffer) + if err == nil { + go func(*perf.Reader) { + defer reader.Close() + for { + select { + case <-ctx.Done(): + return + default: + } + record, err := reader.Read() + if err != nil { + if errors.Is(err, perf.ErrClosed) { + common.BPFLog.Debug("[dataReader] Received signal, exiting..") + return + } + common.BPFLog.Debugf("[dataReader] reading from reader: %s\n", err) + continue + } + + if evt, err := parseConnEvent(record.RawSample); err != nil { + common.AgentLog.Errorf("[dataReader] conn event err: %s\n", err) + continue + } else { + if hook != nil { + hook(evt) + } + tgidFd := uint64(evt.ConnInfo.ConnId.Upid.Pid)<<32 | uint64(evt.ConnInfo.ConnId.Fd) + ch := channels[int(tgidFd)%len(channels)] + ch <- evt + } + } + }(reader) + } + if err != nil { + common.BPFLog.Warningf("[bpf] set up perf reader failed: %s\n", err) + } + return err +} + +func parseConnEvent(record []byte) (*AgentConnEvtT, error) { + var event AgentConnEvtT + err := binary.Read(bytes.NewBuffer(record), binary.LittleEndian, &event) + if err != nil { + return nil, err + } + + return &event, nil +} + +func PullKernEvents(ctx context.Context, channels []chan *AgentKernEvt, perfCPUBufferPageNum int, hook KernEventHook) error { + pageSize := os.Getpagesize() + perCPUBuffer := pageSize * perfCPUBufferPageNum + eventSize := int(unsafe.Sizeof(AgentKernEvt{})) + if eventSize >= perCPUBuffer { + perCPUBuffer = perCPUBuffer * (1 + (eventSize / perCPUBuffer)) + } + reader, err := perf.NewReader(GetMapFromObjs(Objs, "Rb"), perCPUBuffer) + if err == nil { + go func(*perf.Reader) { + defer reader.Close() + for { + select { + case <-ctx.Done(): + return + default: + } + record, err := reader.Read() + if err != nil { + if errors.Is(err, perf.ErrClosed) { + common.BPFLog.Debug("[dataReader] Received signal, exiting..") + return + } + common.BPFLog.Debugf("[dataReader] reading from reader: %s\n", err) + continue + } + + if evt, err := parseKernEvent(record.RawSample); err != nil { + common.AgentLog.Errorf("[dataReader] kern event err: %s\n", err) + continue + } else { + if hook != nil { + hook(evt) + } + tgidFd := evt.ConnIdS.TgidFd + ch := channels[int(tgidFd)%len(channels)] + ch <- evt + } + } + }(reader) + } + if err != nil { + common.BPFLog.Warningf("[bpf] set up perf reader failed: %s\n", err) + } + return err +} + +func parseKernEvent(record []byte) (*AgentKernEvt, error) { + var event AgentKernEvt + err := binary.Read(bytes.NewBuffer(record), binary.LittleEndian, &event) + if err != nil { + return nil, err + } + return &event, nil +} + +type SyscallEventHook func(evt *SyscallEventData) +type SslEventHook func(evt *SslData) +type ConnEventHook func(evt *AgentConnEvtT) +type KernEventHook func(evt *AgentKernEvt) diff --git a/bpf/gen.go b/bpf/gen.go index dd5a371a..2580b247 100644 --- a/bpf/gen.go +++ b/bpf/gen.go @@ -1,15 +1,15 @@ package bpf -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type process_exec_event -type kern_evt_ssl_data -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -cflags "-D KERNEL_VERSION_BELOW_58" -target amd64 Agent ./pktlatency.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -cflags "-D KERNEL_VERSION_BELOW_58" -target amd64 AgentOld ./pktlatency.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -cflags "-D KERNEL_VERSION_BELOW_58" -target amd64 Openssl102a ./openssl_1_0_2a.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -cflags "-D KERNEL_VERSION_BELOW_58" -target amd64 Openssl110a ./openssl_1_1_0a.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -cflags "-D KERNEL_VERSION_BELOW_58" -target amd64 Openssl111a ./openssl_1_1_1a.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -cflags "-D KERNEL_VERSION_BELOW_58" -target amd64 Openssl111b ./openssl_1_1_1b.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -cflags "-D KERNEL_VERSION_BELOW_58" -target amd64 Openssl111d ./openssl_1_1_1d.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -cflags "-D KERNEL_VERSION_BELOW_58" -target amd64 Openssl111j ./openssl_1_1_1j.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -cflags "-D KERNEL_VERSION_BELOW_58" -target amd64 Openssl300 ./openssl_3_0_0.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -cflags "-D KERNEL_VERSION_BELOW_58" -target amd64 Openssl310 ./openssl_3_1_0.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -cflags "-D KERNEL_VERSION_BELOW_58" -target amd64 Openssl320 ./openssl_3_2_0.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -cflags "-D KERNEL_VERSION_BELOW_58" -target amd64 Openssl323 ./openssl_3_2_3.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -cflags "-D KERNEL_VERSION_BELOW_58" -target amd64 Openssl330 ./openssl_3_3_0.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type process_exit_event -type process_exec_event -type kern_evt_ssl_data -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -target amd64 Agent ./pktlatency.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -cflags "-D LAGACY_KERNEL_310" -target amd64 AgentLagacyKernel310 ./pktlatency.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -target amd64 Openssl102a ./openssl_1_0_2a.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -target amd64 Openssl110a ./openssl_1_1_0a.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -target amd64 Openssl111a ./openssl_1_1_1a.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -target amd64 Openssl111b ./openssl_1_1_1b.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -target amd64 Openssl111d ./openssl_1_1_1d.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -target amd64 Openssl111j ./openssl_1_1_1j.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -target amd64 Openssl300 ./openssl_3_0_0.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -target amd64 Openssl310 ./openssl_3_1_0.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -target amd64 Openssl320 ./openssl_3_2_0.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -target amd64 Openssl323 ./openssl_3_2_3.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -type conn_id_s_t -type sock_key -type control_value_index_t -type kern_evt -type kern_evt_data -type conn_evt_t -type conn_type_t -type conn_info_t -type endpoint_role_t -type traffic_direction_t -type traffic_protocol_t -type step_t -target amd64 Openssl330 ./openssl_3_3_0.bpf.c -- -I./ -I$OUTPUT -I../libbpf/include/uapi -I../vmlinux/x86/ diff --git a/bpf/loader/container.go b/bpf/loader/container.go new file mode 100644 index 00000000..080a1047 --- /dev/null +++ b/bpf/loader/container.go @@ -0,0 +1,139 @@ +package loader + +import ( + "context" + ac "kyanos/agent/common" + "kyanos/agent/metadata" + "kyanos/agent/metadata/types" + "kyanos/bpf" + "kyanos/common" + "log" + + "github.com/cilium/ebpf" +) + +type containerFilterResult struct { + mntnsIds []uint32 + netnsIds []uint32 + pidnsIds []uint32 +} + +func applyContainerFilter(ctx context.Context, options *ac.AgentOptions) (*metadata.ContainerCache, *containerFilterResult, error) { + cc, err, k8sErr := metadata.NewContainerCache(ctx, options.DockerEndpoint, options.ContainerdEndpoint, options.CriRuntimeEndpoint) + if err != nil { + if options.FilterByContainer() { + common.DefaultLog.Fatalf("find container failed: %s", err) + } else { + common.DefaultLog.Warnf("find container failed: %s", err) + return nil, nil, nil + } + } + if k8sErr != nil { + if options.FilterByK8s() { + common.DefaultLog.Fatalf("find pod failed: %s", k8sErr) + } else { + common.DefaultLog.Infof("find pod failed: %s", k8sErr) + } + } + if !options.FilterByContainer() { + return cc, nil, nil + } + + var containers []types.Container + + switch { + case options.ContainerId != "": + container := cc.GetById(options.ContainerId) + if container.EmptyNS() { + log.Fatalf("can not find any running container by id %s", options.ContainerId) + } + containers = append(containers, container) + case options.ContainerName != "": + cs := cc.GetByName(options.ContainerName) + cs = removeNonFilterAbleContainers(cs) + if len(cs) > 1 { + log.Fatalf("found more than one containers by name %s", options.ContainerName) + } + if len(cs) == 0 { + log.Fatalf("can not find any running container by name %s", options.ContainerName) + } + container := cs[0] + containers = append(containers, container) + case options.PodName != "": + cs := cc.GetByPodName(options.PodName, options.PodNameSpace) + cs = removeNonFilterAbleContainers(cs) + if len(cs) == 0 { + log.Fatalf("can not find any running pod by name %s in namespace %s", options.PodName, options.PodNameSpace) + } + containers = append(containers, cs...) + } + result := containerFilterResult{ + pidnsIds: make([]uint32, 0), + mntnsIds: make([]uint32, 0), + netnsIds: make([]uint32, 0), + } + for _, container := range containers { + if container.IsSandbox() { + common.DefaultLog.Infof("skip sandbox container: %#v", container) + continue + } + common.DefaultLog.Infof("filter by container %#v", container) + if container.PidNamespace > 0 && container.PidNamespace != metadata.HostPidNs { + result.pidnsIds = append(result.pidnsIds, uint32(container.PidNamespace)) + } + if container.MountNamespace > 0 && container.MountNamespace != metadata.HostMntNs { + result.mntnsIds = append(result.mntnsIds, uint32(container.MountNamespace)) + } + if container.NetworkNamespace > 0 && container.NetworkNamespace != metadata.HostNetNs { + result.netnsIds = append(result.netnsIds, uint32(container.NetworkNamespace)) + } + } + return cc, &result, nil +} + +func writeFilterNsIdsToMap(r *containerFilterResult, objs any) { + pidnsMap := bpf.GetMapFromObjs(objs, "FilterPidnsMap") + mntnsMap := bpf.GetMapFromObjs(objs, "FilterMntnsMap") + netnsMap := bpf.GetMapFromObjs(objs, "FilterNetnsMap") + value := uint8(0) + for _, id := range r.pidnsIds { + pidnsMap.Update(id, value, ebpf.UpdateAny) + } + for _, id := range r.mntnsIds { + mntnsMap.Update(id, value, ebpf.UpdateAny) + } + for _, id := range r.netnsIds { + netnsMap.Update(id, value, ebpf.UpdateAny) + } +} + +func removeNonFilterAbleContainers(containers []types.Container) []types.Container { + var final []types.Container + for _, c := range containers { + if c.IsSandbox() || c.EmptyNS() { + continue + } + if c.PidNamespace == metadata.HostPidNs && + c.MountNamespace == metadata.HostMntNs && + c.NetworkNamespace == metadata.HostNetNs { + continue + } + final = append(final, c) + } + return final +} + +func initProcExitEventChannel(ctx context.Context) chan *bpf.AgentProcessExitEvent { + ch := make(chan *bpf.AgentProcessExitEvent, 10) + go func() { + for { + select { + case <-ctx.Done(): + return + case evt := <-ch: + common.DeleteIfIdxToNameEntry(int(evt.Pid)) + } + } + }() + return ch +} diff --git a/bpf/loader/loader.go b/bpf/loader/loader.go new file mode 100644 index 00000000..f7ee285f --- /dev/null +++ b/bpf/loader/loader.go @@ -0,0 +1,584 @@ +package loader + +import ( + "cmp" + "container/list" + "context" + "errors" + "fmt" + "io/fs" + ac "kyanos/agent/common" + "kyanos/agent/compatible" + "kyanos/agent/uprobe" + "kyanos/bpf" + "kyanos/common" + "os" + "path/filepath" + "slices" + "strconv" + "strings" + + "github.com/cilium/ebpf" + "github.com/cilium/ebpf/asm" + "github.com/cilium/ebpf/btf" + "github.com/cilium/ebpf/link" + "github.com/emirpasic/gods/maps/treemap" + "github.com/spf13/viper" + "github.com/zcalusic/sysinfo" +) + +type BPF struct { + links *list.List // close + objs *bpf.AgentObjects // close +} + +func (b *BPF) Close() { + b.objs.Close() + + for e := b.links.Front(); e != nil; e = e.Next() { + if e.Value == nil { + continue + } + if l, ok := e.Value.(link.Link); ok { + err := l.Close() + if err != nil { + info, _ := l.Info() + common.AgentLog.Errorf("Fail to close link for: %v\n", info) + } + } + } + common.AgentLog.Debugln("All links closed!") +} + +func LoadBPF(options ac.AgentOptions) (*BPF, error) { + var links *list.List + var objs *bpf.AgentObjects + var spec *ebpf.CollectionSpec + var collectionOptions *ebpf.CollectionOptions + var err error + var bf *BPF = &BPF{} + if options.BTFFilePath != "" { + btfPath, err := btf.LoadSpec(options.BTFFilePath) + if err != nil { + common.AgentLog.Fatalf("can't load btf spec: %v", err) + } + collectionOptions = &ebpf.CollectionOptions{ + Programs: ebpf.ProgramOptions{ + KernelTypes: btfPath, + LogSize: options.BPFVerifyLogSize, + }, + } + } else { + fileBytes, err := getBestMatchedBTFFile() + if err != nil { + common.AgentLog.Fatalln(err) + } + needGenerateBTF := fileBytes != nil + + if needGenerateBTF { + btfFilePath, err := writeToFile(fileBytes, ".kyanos.btf") + if err != nil { + common.AgentLog.Fatalln(err) + } + defer os.Remove(btfFilePath) + + btfPath, err := btf.LoadSpec(btfFilePath) + if err != nil { + common.AgentLog.Fatalf("can't load btf spec: %v", err) + } + collectionOptions = &ebpf.CollectionOptions{ + Programs: ebpf.ProgramOptions{ + KernelTypes: btfPath, + LogSize: options.BPFVerifyLogSize, + }, + } + } else { + collectionOptions = &ebpf.CollectionOptions{ + Programs: ebpf.ProgramOptions{ + LogSize: options.BPFVerifyLogSize, + }, + } + } + } + + ac.CollectionOpts = collectionOptions + if !options.Kv.SupportCapability(compatible.SupportFilterByContainer) { + // if true { + lagacyobjs := &bpf.AgentLagacyKernel310Objects{} + spec, err = bpf.LoadAgentLagacyKernel310() + if err != nil { + common.AgentLog.Fatal("load Agent error:", err) + } + filterFunctions(spec, *options.Kv) + err = spec.LoadAndAssign(lagacyobjs, collectionOptions) + objs = AgentObjectsFromLagacyKernel310(lagacyobjs) + } else { + objs = &bpf.AgentObjects{} + spec, err = bpf.LoadAgent() + if err != nil { + common.AgentLog.Fatal("load Agent error:", err) + } + filterFunctions(spec, *options.Kv) + err = spec.LoadAndAssign(objs, collectionOptions) + } + bf.objs = objs + bpf.Objs = objs + + if err != nil { + err = errors.Unwrap(errors.Unwrap(err)) + inner_err, ok := err.(*ebpf.VerifierError) + if ok { + inner_err.Truncated = false + common.AgentLog.Errorf("loadAgentObjects: %+v", inner_err) + } else { + common.AgentLog.Errorf("loadAgentObjects: %+v", err) + } + return nil, err + } + + var validateResult = setAndValidateParameters(options.Ctx, &options) + + if options.LoadBpfProgramFunction != nil { + links = options.LoadBpfProgramFunction() + } else { + links = attachBpfProgs(options.IfName, options.Kv, &options) + } + + if !validateResult { + return nil, fmt.Errorf("validate param failed!") + } + if !options.DisableOpensslUprobe { + attachOpenSslUprobes(links, options, options.Kv, objs) + } + attachNfFunctions(links) + bpf.PullProcessExitEvents(options.Ctx, []chan *bpf.AgentProcessExitEvent{initProcExitEventChannel(options.Ctx)}) + + bf.links = links + return bf, nil +} + +func getBestMatchedBTFFile() ([]uint8, error) { + if bpf.IsKernelSupportHasBTF() { + return nil, nil + } + + var si sysinfo.SysInfo + si.GetSysInfo() + common.AgentLog.Debugf("[sys info] vendor: %s, os_arch: %s, kernel_arch: %s", si.OS.Vendor, si.OS.Architecture, si.Kernel.Architecture) + + if si.OS.Vendor != "ubuntu" && si.OS.Vendor != "centos" { + common.AgentLog.Fatal("Current only support centos and ubuntu") + } + if si.OS.Architecture != "amd64" { + common.AgentLog.Fatal("Current only support amd64") + } + if si.Kernel.Architecture != "x86_64" { + common.AgentLog.Fatal("Current only support x86_64") + } + + var btfFileDir string + btfFileDir += "custom-archive" + btfFileDir += "/" + si.OS.Vendor + if si.OS.Vendor == "centos" { + btfFileDir += "/" + si.OS.Release[:1] + } else { + btfFileDir += "/" + si.OS.Release[:5] + } + btfFileDir += "/" + si.Kernel.Architecture + dir, err := bpf.BtfFiles.ReadDir(btfFileDir) + if err != nil { + common.AgentLog.Warnf("btf file not exists, path: %s", btfFileDir) + return nil, err + } + btfFileNames := treemap.NewWithStringComparator() + for _, entry := range dir { + btfFileName := entry.Name() + if idx := strings.Index(btfFileName, ".btf"); idx != -1 { + btfFileName = btfFileName[:idx] + btfFileNames.Put(btfFileName, entry) + } + } + + release := si.Kernel.Release + if value, found := btfFileNames.Get(release); found { + common.AgentLog.Debug("find btf file exactly!") + dirEntry := value.(fs.DirEntry) + fileName := dirEntry.Name() + file, err := bpf.BtfFiles.ReadFile(btfFileDir + "/" + fileName) + if err == nil { + return file, nil + } + } else { + common.AgentLog.Debug("find btf file exactly failed, try to find a lower version btf file...") + } + + sortedBtfFileNames := btfFileNames.Keys() + slices.SortFunc(sortedBtfFileNames, func(a, b interface{}) int { + return cmp.Compare(a.(string), b.(string)) + }) + var result string + var commonPrefixLength = 0 + for _, btfFileName := range btfFileNames.Keys() { + prefix := common.CommonPrefix(btfFileName.(string), release) + if len(prefix) > commonPrefixLength { + result = btfFileName.(string) + commonPrefixLength = len(prefix) + } + } + if result != "" { + value, _ := btfFileNames.Get(result) + dirEntry := value.(fs.DirEntry) + fileName := dirEntry.Name() + common.AgentLog.Debugf("find a btf file may be success: %s", fileName) + file, err := bpf.BtfFiles.ReadFile(btfFileDir + "/" + fileName) + if err == nil { + return file, nil + } + } + return nil, errors.New("no btf file found to load") +} + +// writeToFile writes the []uint8 slice to a specified file in the system's temp directory. +// If the temp directory does not exist, it creates a ".kyanos" directory in the current directory. +func writeToFile(data []uint8, filename string) (string, error) { + // Get the system's temp directory + tempDir := os.TempDir() + + // Check if the temp directory exists + if _, err := os.Stat(tempDir); os.IsNotExist(err) { + // Create a ".kyanos" directory in the current directory + tempDir = "." + } + + // Create the file path + filePath := filepath.Join(tempDir, filename) + + // Write the byte slice to the file + err := os.WriteFile(filePath, data, 0644) + if err != nil { + return "", fmt.Errorf("failed to write file: %v", err) + } + + // Return the absolute path of the file + absPath, err := filepath.Abs(filePath) + if err != nil { + return "", fmt.Errorf("failed to get absolute path: %v", err) + } + + return absPath, nil +} + +func AgentObjectsFromLagacyKernel310(legacy *bpf.AgentLagacyKernel310Objects) *bpf.AgentObjects { + ret := &bpf.AgentObjects{} + ret.AgentMaps = bpf.AgentMaps(legacy.AgentLagacyKernel310Maps) + ret.AgentPrograms = bpf.AgentPrograms(legacy.AgentLagacyKernel310Programs) + return ret +} + +func filterFunctions(coll *ebpf.CollectionSpec, kernelVersion compatible.KernelVersion) { + finalCProgNames := make([]string, 0) + + if kernelVersion.SupportCapability(compatible.SupportXDP) { + finalCProgNames = append(finalCProgNames, bpf.XDPProgramName) + } + if kernelVersion.SupportCapability(compatible.SupportRawTracepoint) { + finalCProgNames = append(finalCProgNames, bpf.TcpDestroySocketProgName) + } + for step := bpf.AgentStepTStart; step < bpf.AgentStepTEnd; step++ { + functions, ok := kernelVersion.InstrumentFunctions[step] + if ok { + for _, function := range functions { + finalCProgNames = append(finalCProgNames, bpf.GoProgName2CProgName[function.BPFGoProgName]) + } + } + } + + finalCProgNames = append(finalCProgNames, bpf.SyscallExtraProgNames...) + for name := range coll.Programs { + if strings.HasPrefix(name, "tracepoint__syscalls") || strings.HasPrefix(name, "tracepoint__sched") || strings.HasPrefix(name, "kprobe__nf") { + // if strings.HasPrefix(name, "tracepoint__syscalls") { + finalCProgNames = append(finalCProgNames, name) + } + } + + needsDelete := make([]string, 0) + for cProgName, _ := range coll.Programs { + if slices.Index(finalCProgNames, cProgName) == -1 { + needsDelete = append(needsDelete, cProgName) + } + } + for _, each := range needsDelete { + coll.Programs[each] = socketFilterSpec + } +} + +var socketFilterSpec = &ebpf.ProgramSpec{ + Name: "test", + Type: ebpf.Kprobe, + SectionName: "kprobe/sys_accept", + Instructions: asm.Instructions{ + asm.LoadImm(asm.R0, 2, asm.DWord), + asm.Return(), + }, + License: "MIT", +} + +func setAndValidateParameters(ctx context.Context, options *ac.AgentOptions) bool { + var controlValues *ebpf.Map = bpf.GetMapFromObjs(bpf.Objs, "ControlValues") + var enabledRemotePortMap *ebpf.Map = bpf.GetMapFromObjs(bpf.Objs, "EnabledRemotePortMap") + var enabledRemoteIpv4Map *ebpf.Map = bpf.GetMapFromObjs(bpf.Objs, "EnabledRemoteIpv4Map") + var enabledLocalPortMap *ebpf.Map = bpf.GetMapFromObjs(bpf.Objs, "EnabledLocalPortMap") + var filterPidMap *ebpf.Map = bpf.GetMapFromObjs(bpf.Objs, "FilterPidMap") + + // if targetPid := viper.GetInt64(common.FilterPidVarName); targetPid > 0 { + // common.AgentLog.Infoln("filter for pid: ", targetPid) + // controlValues.Update(bpf.AgentControlValueIndexTKTargetTGIDIndex, targetPid, ebpf.UpdateAny) + // } + targetPids := viper.GetStringSlice(common.FilterPidVarName) + if len(targetPids) > 0 { + common.AgentLog.Infoln("filter for remote pids: ", targetPids) + one := int64(1) + controlValues.Update(bpf.AgentControlValueIndexTKEnableFilterByPid, one, ebpf.UpdateAny) + for _, each := range targetPids { + pidInt, err := strconv.Atoi(each) + if err != nil { + common.AgentLog.Errorf("Invalid pid : %s\n", each) + return false + } + filterPidMap.Update(pidInt, one, ebpf.UpdateAny) + } + } + + if options.FilterByContainer() && !options.Kv.SupportCapability(compatible.SupportFilterByContainer) { + common.AgentLog.Warnf("current kernel version 3.10 doesn't support filter by container id/name/podname etc.") + } else if options.FilterByContainer() { + cc, filterResult, err := applyContainerFilter(ctx, options) + if err == nil { + options.Cc = cc + writeFilterNsIdsToMap(filterResult, bpf.Objs) + one := int64(1) + controlValues.Update(bpf.AgentControlValueIndexTKEnableFilterByPid, one, ebpf.UpdateAny) + } + } + + remotePorts := viper.GetStringSlice(common.RemotePortsVarName) + oneKey := uint16(1) + zeroValue := uint8(0) + if len(remotePorts) > 0 { + common.AgentLog.Infoln("filter for remote ports: ", remotePorts) + err := enabledRemotePortMap.Update(oneKey, zeroValue, ebpf.UpdateAny) + if err != nil { + common.AgentLog.Errorln("Update EnabledRemotePortMap failed: ", err) + } + for _, each := range remotePorts { + portInt, err := strconv.Atoi(each) + if err != nil || portInt <= 0 { + common.AgentLog.Errorf("Invalid remote port : %s\n", each) + return false + } + portNumber := uint16(portInt) + err = enabledRemotePortMap.Update(portNumber, zeroValue, ebpf.UpdateAny) + if err != nil { + common.AgentLog.Errorln("Update EnabledRemotePortMap failed: ", err) + } + } + } + + remoteIps := viper.GetStringSlice(common.RemoteIpsVarName) + if len(remoteIps) > 0 { + common.AgentLog.Infoln("filter for remote ips: ", remoteIps) + oneKeyU32 := uint32(1) + err := enabledRemoteIpv4Map.Update(&oneKeyU32, &zeroValue, ebpf.UpdateAny) + if err != nil { + common.AgentLog.Errorln("Update EnabledRemoteIpv4Map failed: ", err) + } + for _, each := range remoteIps { + ipInt32, err := common.IPv4ToUint32(each) + if err != nil { + common.AgentLog.Errorf("IPv4ToUint32 parse failed, ip string is: %s, err: %v", each, err) + return false + } else { + common.AgentLog.Debugln("Update EnabledRemoteIpv4Map, key: ", ipInt32, common.IntToIP(ipInt32)) + err = enabledRemoteIpv4Map.Update(&ipInt32, &zeroValue, ebpf.UpdateAny) + if err != nil { + common.AgentLog.Errorln("Update EnabledRemoteIpv4Map failed: ", err) + } + } + } + } + + localPorts := viper.GetStringSlice(common.LocalPortsVarName) + if len(localPorts) > 0 { + common.AgentLog.Infoln("filter for local ports: ", localPorts) + err := enabledLocalPortMap.Update(oneKey, uint8(oneKey), ebpf.UpdateAny) + if err != nil { + common.AgentLog.Errorln("Update EnabledLocalPortMap failed: ", err) + } + for _, each := range localPorts { + portInt, err := strconv.Atoi(each) + if err != nil || portInt <= 0 { + common.AgentLog.Errorf("Invalid local port : %s\n", each) + return false + } + portNumber := uint16(portInt) + err = enabledLocalPortMap.Update(portNumber, zeroValue, ebpf.UpdateAny) + if err != nil { + common.AgentLog.Errorln("Update EnabledLocalPortMap failed: ", err) + } + } + } + + return true +} + +func attachBpfProgs(ifName string, kernelVersion *compatible.KernelVersion, options *ac.AgentOptions) *list.List { + linkList := list.New() + + if kernelVersion.SupportCapability(compatible.SupportXDP) { + l, err := bpf.AttachXdpWithSpecifiedIfName(options.IfName) + if err != nil { + common.AgentLog.Warnf("Attach XDP program failed, fallbacking...") + } else { + linkList.PushBack(l) + } + } + + if kernelVersion.SupportCapability(compatible.SupportRawTracepoint) { + l, err := bpf.AttachRawTracepointTcpDestroySockEntry() + if err != nil { + common.AgentLog.Warnf("Attach TCP destroy raw tracepoint failed, fallbacking...") + } else { + linkList.PushBack(l) + } + } + + for _, functions := range kernelVersion.InstrumentFunctions { + for idx, function := range functions { + var err error + var l link.Link + if function.IsKprobe() { + l, err = bpf.Kprobe(function.GetKprobeName(), bpf.GetProgramFromObjs(bpf.Objs, function.BPFGoProgName)) + } else if function.IsTracepoint() { + l, err = bpf.Tracepoint(function.GetTracepointGroupName(), function.GetTracepointName(), + bpf.GetProgramFromObjs(bpf.Objs, function.BPFGoProgName)) + } else if function.IsKRetprobe() { + l, err = bpf.Kretprobe(function.GetKprobeName(), bpf.GetProgramFromObjs(bpf.Objs, function.BPFGoProgName)) + } else { + panic(fmt.Sprintf("invalid program type: %v", function)) + } + if err != nil { + if idx == len(functions)-1 { + common.AgentLog.Fatalf("Attach failed: %v, functions: %v", err, functions) + } else { + common.AgentLog.Debugf("Attach failed but has fallback: %v, functions: %v", err, functions) + } + } else { + linkList.PushBack(l) + break + } + } + } + + linkList.PushBack(bpf.AttachSyscallAcceptEntry()) + linkList.PushBack(bpf.AttachSyscallAcceptExit()) + + linkList.PushBack(bpf.AttachSyscallSockAllocExit()) + + linkList.PushBack(bpf.AttachSyscallConnectEntry()) + linkList.PushBack(bpf.AttachSyscallConnectExit()) + + linkList.PushBack(bpf.AttachSyscallCloseEntry()) + linkList.PushBack(bpf.AttachSyscallCloseExit()) + + linkList.PushBack(bpf.AttachSyscallWriteEntry()) + linkList.PushBack(bpf.AttachSyscallWriteExit()) + + linkList.PushBack(bpf.AttachSyscallSendMsgEntry()) + linkList.PushBack(bpf.AttachSyscallSendMsgExit()) + + linkList.PushBack(bpf.AttachSyscallRecvMsgEntry()) + linkList.PushBack(bpf.AttachSyscallRecvMsgExit()) + + linkList.PushBack(bpf.AttachSyscallWritevEntry()) + linkList.PushBack(bpf.AttachSyscallWritevExit()) + + linkList.PushBack(bpf.AttachSyscallSendtoEntry()) + linkList.PushBack(bpf.AttachSyscallSendtoExit()) + + linkList.PushBack(bpf.AttachSyscallReadEntry()) + linkList.PushBack(bpf.AttachSyscallReadExit()) + + linkList.PushBack(bpf.AttachSyscallReadvEntry()) + linkList.PushBack(bpf.AttachSyscallReadvExit()) + + linkList.PushBack(bpf.AttachSyscallRecvfromEntry()) + linkList.PushBack(bpf.AttachSyscallRecvfromExit()) + + linkList.PushBack(bpf.AttachKProbeSecuritySocketRecvmsgEntry()) + linkList.PushBack(bpf.AttachKProbeSecuritySocketSendmsgEntry()) + + return linkList +} + +func attachOpenSslUprobes(links *list.List, options ac.AgentOptions, kernelVersion *compatible.KernelVersion, objs any) { + if attachOpensslToSpecificProcess() { + uprobeLinks, err := uprobe.AttachSslUprobe(int(viper.GetInt64(common.FilterPidVarName))) + if err == nil { + for _, l := range uprobeLinks { + links.PushBack(l) + } + } else { + common.AgentLog.Infof("Attach OpenSsl uprobes failed: %+v for pid: %d", err, viper.GetInt64(common.FilterPidVarName)) + } + } else { + pids, err := common.GetAllPids() + if err == nil { + for _, pid := range pids { + uprobeLinks, err := uprobe.AttachSslUprobe(int(pid)) + if err == nil && len(uprobeLinks) > 0 { + for _, l := range uprobeLinks { + links.PushBack(l) + } + common.AgentLog.Infof("Attach OpenSsl uprobes success for pid: %d", pid) + } else if err != nil { + common.AgentLog.Infof("Attach OpenSsl uprobes failed: %+v for pid: %d", err, pid) + } else if len(uprobeLinks) == 0 { + common.AgentLog.Infof("Attach OpenSsl uprobes success for pid: %d use previous libssl path", pid) + } + } + } else { + common.AgentLog.Warnf("get all pid failed: %v", err) + } + attachSchedProgs(links) + uprobeSchedExecEvent := uprobe.StartHandleSchedExecEvent() + bpf.PullProcessExecEvents(options.Ctx, []chan *bpf.AgentProcessExecEvent{uprobeSchedExecEvent}) + } +} + +func attachOpensslToSpecificProcess() bool { + return viper.GetInt64(common.FilterPidVarName) > 0 +} + +func attachSchedProgs(links *list.List) { + link, err := link.Tracepoint("sched", "sched_process_exec", bpf.GetProgramFromObjs(bpf.Objs, "TracepointSchedSchedProcessExec"), nil) + if err != nil { + common.AgentLog.Warnf("Attach tracepoint/sched/sched_process_exec error: %v", err) + } else { + links.PushBack(link) + } +} + +func attachNfFunctions(links *list.List) { + l, err := link.Kprobe("nf_nat_manip_pkt", bpf.GetProgramFromObjs(bpf.Objs, "KprobeNfNatManipPkt"), nil) + if err != nil { + common.AgentLog.Warnf("Attahc kprobe/nf_nat_manip_pkt failed: %v", err) + } else { + links.PushBack(l) + } + l, err = link.Kprobe("nf_nat_packet", bpf.GetProgramFromObjs(bpf.Objs, "KprobeNfNatPacket"), nil) + if err != nil { + common.AgentLog.Warnf("Attahc kprobe/nf_nat_packet failed: %v", err) + } else { + links.PushBack(l) + } +} diff --git a/bpf/map.go b/bpf/map.go index f10723f4..7cc565aa 100644 --- a/bpf/map.go +++ b/bpf/map.go @@ -7,38 +7,38 @@ import ( ) // TODO remove me -func GetMap(mapName string) *ebpf.Map { - oldObjs, isOld := Objs.(*AgentOldObjects) - if isOld { - maps := oldObjs.AgentOldMaps - v := reflect.ValueOf(maps) - f := v.FieldByName(mapName).Interface() - return f.(*ebpf.Map) - } else { - newobjs := Objs.(*AgentObjects) - maps := newobjs.AgentMaps - v := reflect.ValueOf(maps) - f := v.FieldByName(mapName).Interface() - return f.(*ebpf.Map) - } -} +// func GetMap(mapName string) *ebpf.Map { +// oldObjs, isOld := Objs.(*AgentOldObjects) +// if isOld { +// maps := oldObjs.AgentOldMaps +// v := reflect.ValueOf(maps) +// f := v.FieldByName(mapName).Interface() +// return f.(*ebpf.Map) +// } else { +// newobjs := Objs.(*AgentObjects) +// maps := newobjs.AgentMaps +// v := reflect.ValueOf(maps) +// f := v.FieldByName(mapName).Interface() +// return f.(*ebpf.Map) +// } +// } -// TODO remove me -func GetMapByObjs(mapName string, objs any) *ebpf.Map { - oldObjs, isOld := objs.(*AgentOldObjects) - if isOld { - maps := oldObjs.AgentOldMaps - v := reflect.ValueOf(maps) - f := v.FieldByName(mapName).Interface() - return f.(*ebpf.Map) - } else { - newobjs := objs.(*AgentObjects) - maps := newobjs.AgentMaps - v := reflect.ValueOf(maps) - f := v.FieldByName(mapName).Interface() - return f.(*ebpf.Map) - } -} +// // TODO remove me +// func GetMapByObjs(mapName string, objs any) *ebpf.Map { +// oldObjs, isOld := objs.(*AgentOldObjects) +// if isOld { +// maps := oldObjs.AgentOldMaps +// v := reflect.ValueOf(maps) +// f := v.FieldByName(mapName).Interface() +// return f.(*ebpf.Map) +// } else { +// newobjs := objs.(*AgentObjects) +// maps := newobjs.AgentMaps +// v := reflect.ValueOf(maps) +// f := v.FieldByName(mapName).Interface() +// return f.(*ebpf.Map) +// } +// } func GetMapFromObjs(objs any, mapName string) *ebpf.Map { val := reflect.ValueOf(objs) diff --git a/bpf/openssl102a_x86_bpfel.go b/bpf/openssl102a_x86_bpfel.go index 04eace1e..4645fdce 100644 --- a/bpf/openssl102a_x86_bpfel.go +++ b/bpf/openssl102a_x86_bpfel.go @@ -79,10 +79,14 @@ const ( type Openssl102aControlValueIndexT uint32 const ( - Openssl102aControlValueIndexTKTargetTGIDIndex Openssl102aControlValueIndexT = 0 - Openssl102aControlValueIndexTKStirlingTGIDIndex Openssl102aControlValueIndexT = 1 - Openssl102aControlValueIndexTKEnabledXdpIndex Openssl102aControlValueIndexT = 2 - Openssl102aControlValueIndexTKNumControlValues Openssl102aControlValueIndexT = 3 + Openssl102aControlValueIndexTKTargetTGIDIndex Openssl102aControlValueIndexT = 0 + Openssl102aControlValueIndexTKStirlingTGIDIndex Openssl102aControlValueIndexT = 1 + Openssl102aControlValueIndexTKEnabledXdpIndex Openssl102aControlValueIndexT = 2 + Openssl102aControlValueIndexTKEnableFilterByPid Openssl102aControlValueIndexT = 3 + Openssl102aControlValueIndexTKEnableFilterByLocalPort Openssl102aControlValueIndexT = 4 + Openssl102aControlValueIndexTKEnableFilterByRemotePort Openssl102aControlValueIndexT = 5 + Openssl102aControlValueIndexTKEnableFilterByRemoteHost Openssl102aControlValueIndexT = 6 + Openssl102aControlValueIndexTKNumControlValues Openssl102aControlValueIndexT = 7 ) type Openssl102aEndpointRoleT uint32 @@ -100,9 +104,11 @@ type Openssl102aKernEvt struct { Len uint32 Flags uint8 _ [3]byte + Ifindex uint32 + _ [4]byte ConnIdS Openssl102aConnIdS_t - IsSample int32 Step Openssl102aStepT + _ [4]byte } type Openssl102aKernEvtData struct { @@ -231,6 +237,10 @@ type Openssl102aMapSpecs struct { ActiveSslWriteArgsMap *ebpf.MapSpec `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.MapSpec `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.MapSpec `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.MapSpec `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.MapSpec `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.MapSpec `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.MapSpec `ebpf:"filter_pidns_map"` Rb *ebpf.MapSpec `ebpf:"rb"` SslDataMap *ebpf.MapSpec `ebpf:"ssl_data_map"` SslRb *ebpf.MapSpec `ebpf:"ssl_rb"` @@ -262,6 +272,10 @@ type Openssl102aMaps struct { ActiveSslWriteArgsMap *ebpf.Map `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.Map `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.Map `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.Map `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.Map `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.Map `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.Map `ebpf:"filter_pidns_map"` Rb *ebpf.Map `ebpf:"rb"` SslDataMap *ebpf.Map `ebpf:"ssl_data_map"` SslRb *ebpf.Map `ebpf:"ssl_rb"` @@ -276,6 +290,10 @@ func (m *Openssl102aMaps) Close() error { m.ActiveSslWriteArgsMap, m.ConnEvtRb, m.ConnInfoMap, + m.FilterMntnsMap, + m.FilterNetnsMap, + m.FilterPidMap, + m.FilterPidnsMap, m.Rb, m.SslDataMap, m.SslRb, diff --git a/bpf/openssl110a_x86_bpfel.go b/bpf/openssl110a_x86_bpfel.go index b193245a..59e13d02 100644 --- a/bpf/openssl110a_x86_bpfel.go +++ b/bpf/openssl110a_x86_bpfel.go @@ -79,10 +79,14 @@ const ( type Openssl110aControlValueIndexT uint32 const ( - Openssl110aControlValueIndexTKTargetTGIDIndex Openssl110aControlValueIndexT = 0 - Openssl110aControlValueIndexTKStirlingTGIDIndex Openssl110aControlValueIndexT = 1 - Openssl110aControlValueIndexTKEnabledXdpIndex Openssl110aControlValueIndexT = 2 - Openssl110aControlValueIndexTKNumControlValues Openssl110aControlValueIndexT = 3 + Openssl110aControlValueIndexTKTargetTGIDIndex Openssl110aControlValueIndexT = 0 + Openssl110aControlValueIndexTKStirlingTGIDIndex Openssl110aControlValueIndexT = 1 + Openssl110aControlValueIndexTKEnabledXdpIndex Openssl110aControlValueIndexT = 2 + Openssl110aControlValueIndexTKEnableFilterByPid Openssl110aControlValueIndexT = 3 + Openssl110aControlValueIndexTKEnableFilterByLocalPort Openssl110aControlValueIndexT = 4 + Openssl110aControlValueIndexTKEnableFilterByRemotePort Openssl110aControlValueIndexT = 5 + Openssl110aControlValueIndexTKEnableFilterByRemoteHost Openssl110aControlValueIndexT = 6 + Openssl110aControlValueIndexTKNumControlValues Openssl110aControlValueIndexT = 7 ) type Openssl110aEndpointRoleT uint32 @@ -100,9 +104,11 @@ type Openssl110aKernEvt struct { Len uint32 Flags uint8 _ [3]byte + Ifindex uint32 + _ [4]byte ConnIdS Openssl110aConnIdS_t - IsSample int32 Step Openssl110aStepT + _ [4]byte } type Openssl110aKernEvtData struct { @@ -231,6 +237,10 @@ type Openssl110aMapSpecs struct { ActiveSslWriteArgsMap *ebpf.MapSpec `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.MapSpec `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.MapSpec `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.MapSpec `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.MapSpec `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.MapSpec `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.MapSpec `ebpf:"filter_pidns_map"` Rb *ebpf.MapSpec `ebpf:"rb"` SslDataMap *ebpf.MapSpec `ebpf:"ssl_data_map"` SslRb *ebpf.MapSpec `ebpf:"ssl_rb"` @@ -262,6 +272,10 @@ type Openssl110aMaps struct { ActiveSslWriteArgsMap *ebpf.Map `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.Map `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.Map `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.Map `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.Map `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.Map `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.Map `ebpf:"filter_pidns_map"` Rb *ebpf.Map `ebpf:"rb"` SslDataMap *ebpf.Map `ebpf:"ssl_data_map"` SslRb *ebpf.Map `ebpf:"ssl_rb"` @@ -276,6 +290,10 @@ func (m *Openssl110aMaps) Close() error { m.ActiveSslWriteArgsMap, m.ConnEvtRb, m.ConnInfoMap, + m.FilterMntnsMap, + m.FilterNetnsMap, + m.FilterPidMap, + m.FilterPidnsMap, m.Rb, m.SslDataMap, m.SslRb, diff --git a/bpf/openssl111a_x86_bpfel.go b/bpf/openssl111a_x86_bpfel.go index 9ca3e728..06a5131c 100644 --- a/bpf/openssl111a_x86_bpfel.go +++ b/bpf/openssl111a_x86_bpfel.go @@ -79,10 +79,14 @@ const ( type Openssl111aControlValueIndexT uint32 const ( - Openssl111aControlValueIndexTKTargetTGIDIndex Openssl111aControlValueIndexT = 0 - Openssl111aControlValueIndexTKStirlingTGIDIndex Openssl111aControlValueIndexT = 1 - Openssl111aControlValueIndexTKEnabledXdpIndex Openssl111aControlValueIndexT = 2 - Openssl111aControlValueIndexTKNumControlValues Openssl111aControlValueIndexT = 3 + Openssl111aControlValueIndexTKTargetTGIDIndex Openssl111aControlValueIndexT = 0 + Openssl111aControlValueIndexTKStirlingTGIDIndex Openssl111aControlValueIndexT = 1 + Openssl111aControlValueIndexTKEnabledXdpIndex Openssl111aControlValueIndexT = 2 + Openssl111aControlValueIndexTKEnableFilterByPid Openssl111aControlValueIndexT = 3 + Openssl111aControlValueIndexTKEnableFilterByLocalPort Openssl111aControlValueIndexT = 4 + Openssl111aControlValueIndexTKEnableFilterByRemotePort Openssl111aControlValueIndexT = 5 + Openssl111aControlValueIndexTKEnableFilterByRemoteHost Openssl111aControlValueIndexT = 6 + Openssl111aControlValueIndexTKNumControlValues Openssl111aControlValueIndexT = 7 ) type Openssl111aEndpointRoleT uint32 @@ -100,9 +104,11 @@ type Openssl111aKernEvt struct { Len uint32 Flags uint8 _ [3]byte + Ifindex uint32 + _ [4]byte ConnIdS Openssl111aConnIdS_t - IsSample int32 Step Openssl111aStepT + _ [4]byte } type Openssl111aKernEvtData struct { @@ -231,6 +237,10 @@ type Openssl111aMapSpecs struct { ActiveSslWriteArgsMap *ebpf.MapSpec `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.MapSpec `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.MapSpec `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.MapSpec `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.MapSpec `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.MapSpec `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.MapSpec `ebpf:"filter_pidns_map"` Rb *ebpf.MapSpec `ebpf:"rb"` SslDataMap *ebpf.MapSpec `ebpf:"ssl_data_map"` SslRb *ebpf.MapSpec `ebpf:"ssl_rb"` @@ -262,6 +272,10 @@ type Openssl111aMaps struct { ActiveSslWriteArgsMap *ebpf.Map `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.Map `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.Map `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.Map `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.Map `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.Map `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.Map `ebpf:"filter_pidns_map"` Rb *ebpf.Map `ebpf:"rb"` SslDataMap *ebpf.Map `ebpf:"ssl_data_map"` SslRb *ebpf.Map `ebpf:"ssl_rb"` @@ -276,6 +290,10 @@ func (m *Openssl111aMaps) Close() error { m.ActiveSslWriteArgsMap, m.ConnEvtRb, m.ConnInfoMap, + m.FilterMntnsMap, + m.FilterNetnsMap, + m.FilterPidMap, + m.FilterPidnsMap, m.Rb, m.SslDataMap, m.SslRb, diff --git a/bpf/openssl111b_x86_bpfel.go b/bpf/openssl111b_x86_bpfel.go index f9ddb0ad..376ff258 100644 --- a/bpf/openssl111b_x86_bpfel.go +++ b/bpf/openssl111b_x86_bpfel.go @@ -79,10 +79,14 @@ const ( type Openssl111bControlValueIndexT uint32 const ( - Openssl111bControlValueIndexTKTargetTGIDIndex Openssl111bControlValueIndexT = 0 - Openssl111bControlValueIndexTKStirlingTGIDIndex Openssl111bControlValueIndexT = 1 - Openssl111bControlValueIndexTKEnabledXdpIndex Openssl111bControlValueIndexT = 2 - Openssl111bControlValueIndexTKNumControlValues Openssl111bControlValueIndexT = 3 + Openssl111bControlValueIndexTKTargetTGIDIndex Openssl111bControlValueIndexT = 0 + Openssl111bControlValueIndexTKStirlingTGIDIndex Openssl111bControlValueIndexT = 1 + Openssl111bControlValueIndexTKEnabledXdpIndex Openssl111bControlValueIndexT = 2 + Openssl111bControlValueIndexTKEnableFilterByPid Openssl111bControlValueIndexT = 3 + Openssl111bControlValueIndexTKEnableFilterByLocalPort Openssl111bControlValueIndexT = 4 + Openssl111bControlValueIndexTKEnableFilterByRemotePort Openssl111bControlValueIndexT = 5 + Openssl111bControlValueIndexTKEnableFilterByRemoteHost Openssl111bControlValueIndexT = 6 + Openssl111bControlValueIndexTKNumControlValues Openssl111bControlValueIndexT = 7 ) type Openssl111bEndpointRoleT uint32 @@ -100,9 +104,11 @@ type Openssl111bKernEvt struct { Len uint32 Flags uint8 _ [3]byte + Ifindex uint32 + _ [4]byte ConnIdS Openssl111bConnIdS_t - IsSample int32 Step Openssl111bStepT + _ [4]byte } type Openssl111bKernEvtData struct { @@ -231,6 +237,10 @@ type Openssl111bMapSpecs struct { ActiveSslWriteArgsMap *ebpf.MapSpec `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.MapSpec `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.MapSpec `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.MapSpec `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.MapSpec `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.MapSpec `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.MapSpec `ebpf:"filter_pidns_map"` Rb *ebpf.MapSpec `ebpf:"rb"` SslDataMap *ebpf.MapSpec `ebpf:"ssl_data_map"` SslRb *ebpf.MapSpec `ebpf:"ssl_rb"` @@ -262,6 +272,10 @@ type Openssl111bMaps struct { ActiveSslWriteArgsMap *ebpf.Map `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.Map `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.Map `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.Map `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.Map `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.Map `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.Map `ebpf:"filter_pidns_map"` Rb *ebpf.Map `ebpf:"rb"` SslDataMap *ebpf.Map `ebpf:"ssl_data_map"` SslRb *ebpf.Map `ebpf:"ssl_rb"` @@ -276,6 +290,10 @@ func (m *Openssl111bMaps) Close() error { m.ActiveSslWriteArgsMap, m.ConnEvtRb, m.ConnInfoMap, + m.FilterMntnsMap, + m.FilterNetnsMap, + m.FilterPidMap, + m.FilterPidnsMap, m.Rb, m.SslDataMap, m.SslRb, diff --git a/bpf/openssl111d_x86_bpfel.go b/bpf/openssl111d_x86_bpfel.go index 356fad86..5f051843 100644 --- a/bpf/openssl111d_x86_bpfel.go +++ b/bpf/openssl111d_x86_bpfel.go @@ -79,10 +79,14 @@ const ( type Openssl111dControlValueIndexT uint32 const ( - Openssl111dControlValueIndexTKTargetTGIDIndex Openssl111dControlValueIndexT = 0 - Openssl111dControlValueIndexTKStirlingTGIDIndex Openssl111dControlValueIndexT = 1 - Openssl111dControlValueIndexTKEnabledXdpIndex Openssl111dControlValueIndexT = 2 - Openssl111dControlValueIndexTKNumControlValues Openssl111dControlValueIndexT = 3 + Openssl111dControlValueIndexTKTargetTGIDIndex Openssl111dControlValueIndexT = 0 + Openssl111dControlValueIndexTKStirlingTGIDIndex Openssl111dControlValueIndexT = 1 + Openssl111dControlValueIndexTKEnabledXdpIndex Openssl111dControlValueIndexT = 2 + Openssl111dControlValueIndexTKEnableFilterByPid Openssl111dControlValueIndexT = 3 + Openssl111dControlValueIndexTKEnableFilterByLocalPort Openssl111dControlValueIndexT = 4 + Openssl111dControlValueIndexTKEnableFilterByRemotePort Openssl111dControlValueIndexT = 5 + Openssl111dControlValueIndexTKEnableFilterByRemoteHost Openssl111dControlValueIndexT = 6 + Openssl111dControlValueIndexTKNumControlValues Openssl111dControlValueIndexT = 7 ) type Openssl111dEndpointRoleT uint32 @@ -100,9 +104,11 @@ type Openssl111dKernEvt struct { Len uint32 Flags uint8 _ [3]byte + Ifindex uint32 + _ [4]byte ConnIdS Openssl111dConnIdS_t - IsSample int32 Step Openssl111dStepT + _ [4]byte } type Openssl111dKernEvtData struct { @@ -231,6 +237,10 @@ type Openssl111dMapSpecs struct { ActiveSslWriteArgsMap *ebpf.MapSpec `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.MapSpec `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.MapSpec `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.MapSpec `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.MapSpec `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.MapSpec `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.MapSpec `ebpf:"filter_pidns_map"` Rb *ebpf.MapSpec `ebpf:"rb"` SslDataMap *ebpf.MapSpec `ebpf:"ssl_data_map"` SslRb *ebpf.MapSpec `ebpf:"ssl_rb"` @@ -262,6 +272,10 @@ type Openssl111dMaps struct { ActiveSslWriteArgsMap *ebpf.Map `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.Map `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.Map `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.Map `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.Map `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.Map `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.Map `ebpf:"filter_pidns_map"` Rb *ebpf.Map `ebpf:"rb"` SslDataMap *ebpf.Map `ebpf:"ssl_data_map"` SslRb *ebpf.Map `ebpf:"ssl_rb"` @@ -276,6 +290,10 @@ func (m *Openssl111dMaps) Close() error { m.ActiveSslWriteArgsMap, m.ConnEvtRb, m.ConnInfoMap, + m.FilterMntnsMap, + m.FilterNetnsMap, + m.FilterPidMap, + m.FilterPidnsMap, m.Rb, m.SslDataMap, m.SslRb, diff --git a/bpf/openssl111j_x86_bpfel.go b/bpf/openssl111j_x86_bpfel.go index ba734d22..1597fc8b 100644 --- a/bpf/openssl111j_x86_bpfel.go +++ b/bpf/openssl111j_x86_bpfel.go @@ -79,10 +79,14 @@ const ( type Openssl111jControlValueIndexT uint32 const ( - Openssl111jControlValueIndexTKTargetTGIDIndex Openssl111jControlValueIndexT = 0 - Openssl111jControlValueIndexTKStirlingTGIDIndex Openssl111jControlValueIndexT = 1 - Openssl111jControlValueIndexTKEnabledXdpIndex Openssl111jControlValueIndexT = 2 - Openssl111jControlValueIndexTKNumControlValues Openssl111jControlValueIndexT = 3 + Openssl111jControlValueIndexTKTargetTGIDIndex Openssl111jControlValueIndexT = 0 + Openssl111jControlValueIndexTKStirlingTGIDIndex Openssl111jControlValueIndexT = 1 + Openssl111jControlValueIndexTKEnabledXdpIndex Openssl111jControlValueIndexT = 2 + Openssl111jControlValueIndexTKEnableFilterByPid Openssl111jControlValueIndexT = 3 + Openssl111jControlValueIndexTKEnableFilterByLocalPort Openssl111jControlValueIndexT = 4 + Openssl111jControlValueIndexTKEnableFilterByRemotePort Openssl111jControlValueIndexT = 5 + Openssl111jControlValueIndexTKEnableFilterByRemoteHost Openssl111jControlValueIndexT = 6 + Openssl111jControlValueIndexTKNumControlValues Openssl111jControlValueIndexT = 7 ) type Openssl111jEndpointRoleT uint32 @@ -100,9 +104,11 @@ type Openssl111jKernEvt struct { Len uint32 Flags uint8 _ [3]byte + Ifindex uint32 + _ [4]byte ConnIdS Openssl111jConnIdS_t - IsSample int32 Step Openssl111jStepT + _ [4]byte } type Openssl111jKernEvtData struct { @@ -231,6 +237,10 @@ type Openssl111jMapSpecs struct { ActiveSslWriteArgsMap *ebpf.MapSpec `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.MapSpec `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.MapSpec `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.MapSpec `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.MapSpec `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.MapSpec `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.MapSpec `ebpf:"filter_pidns_map"` Rb *ebpf.MapSpec `ebpf:"rb"` SslDataMap *ebpf.MapSpec `ebpf:"ssl_data_map"` SslRb *ebpf.MapSpec `ebpf:"ssl_rb"` @@ -262,6 +272,10 @@ type Openssl111jMaps struct { ActiveSslWriteArgsMap *ebpf.Map `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.Map `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.Map `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.Map `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.Map `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.Map `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.Map `ebpf:"filter_pidns_map"` Rb *ebpf.Map `ebpf:"rb"` SslDataMap *ebpf.Map `ebpf:"ssl_data_map"` SslRb *ebpf.Map `ebpf:"ssl_rb"` @@ -276,6 +290,10 @@ func (m *Openssl111jMaps) Close() error { m.ActiveSslWriteArgsMap, m.ConnEvtRb, m.ConnInfoMap, + m.FilterMntnsMap, + m.FilterNetnsMap, + m.FilterPidMap, + m.FilterPidnsMap, m.Rb, m.SslDataMap, m.SslRb, diff --git a/bpf/openssl300_x86_bpfel.go b/bpf/openssl300_x86_bpfel.go index c39fae6b..b2a7ea98 100644 --- a/bpf/openssl300_x86_bpfel.go +++ b/bpf/openssl300_x86_bpfel.go @@ -79,10 +79,14 @@ const ( type Openssl300ControlValueIndexT uint32 const ( - Openssl300ControlValueIndexTKTargetTGIDIndex Openssl300ControlValueIndexT = 0 - Openssl300ControlValueIndexTKStirlingTGIDIndex Openssl300ControlValueIndexT = 1 - Openssl300ControlValueIndexTKEnabledXdpIndex Openssl300ControlValueIndexT = 2 - Openssl300ControlValueIndexTKNumControlValues Openssl300ControlValueIndexT = 3 + Openssl300ControlValueIndexTKTargetTGIDIndex Openssl300ControlValueIndexT = 0 + Openssl300ControlValueIndexTKStirlingTGIDIndex Openssl300ControlValueIndexT = 1 + Openssl300ControlValueIndexTKEnabledXdpIndex Openssl300ControlValueIndexT = 2 + Openssl300ControlValueIndexTKEnableFilterByPid Openssl300ControlValueIndexT = 3 + Openssl300ControlValueIndexTKEnableFilterByLocalPort Openssl300ControlValueIndexT = 4 + Openssl300ControlValueIndexTKEnableFilterByRemotePort Openssl300ControlValueIndexT = 5 + Openssl300ControlValueIndexTKEnableFilterByRemoteHost Openssl300ControlValueIndexT = 6 + Openssl300ControlValueIndexTKNumControlValues Openssl300ControlValueIndexT = 7 ) type Openssl300EndpointRoleT uint32 @@ -100,9 +104,11 @@ type Openssl300KernEvt struct { Len uint32 Flags uint8 _ [3]byte + Ifindex uint32 + _ [4]byte ConnIdS Openssl300ConnIdS_t - IsSample int32 Step Openssl300StepT + _ [4]byte } type Openssl300KernEvtData struct { @@ -231,6 +237,10 @@ type Openssl300MapSpecs struct { ActiveSslWriteArgsMap *ebpf.MapSpec `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.MapSpec `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.MapSpec `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.MapSpec `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.MapSpec `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.MapSpec `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.MapSpec `ebpf:"filter_pidns_map"` Rb *ebpf.MapSpec `ebpf:"rb"` SslDataMap *ebpf.MapSpec `ebpf:"ssl_data_map"` SslRb *ebpf.MapSpec `ebpf:"ssl_rb"` @@ -262,6 +272,10 @@ type Openssl300Maps struct { ActiveSslWriteArgsMap *ebpf.Map `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.Map `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.Map `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.Map `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.Map `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.Map `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.Map `ebpf:"filter_pidns_map"` Rb *ebpf.Map `ebpf:"rb"` SslDataMap *ebpf.Map `ebpf:"ssl_data_map"` SslRb *ebpf.Map `ebpf:"ssl_rb"` @@ -276,6 +290,10 @@ func (m *Openssl300Maps) Close() error { m.ActiveSslWriteArgsMap, m.ConnEvtRb, m.ConnInfoMap, + m.FilterMntnsMap, + m.FilterNetnsMap, + m.FilterPidMap, + m.FilterPidnsMap, m.Rb, m.SslDataMap, m.SslRb, diff --git a/bpf/openssl310_x86_bpfel.go b/bpf/openssl310_x86_bpfel.go index 6d02d187..9204d4f4 100644 --- a/bpf/openssl310_x86_bpfel.go +++ b/bpf/openssl310_x86_bpfel.go @@ -79,10 +79,14 @@ const ( type Openssl310ControlValueIndexT uint32 const ( - Openssl310ControlValueIndexTKTargetTGIDIndex Openssl310ControlValueIndexT = 0 - Openssl310ControlValueIndexTKStirlingTGIDIndex Openssl310ControlValueIndexT = 1 - Openssl310ControlValueIndexTKEnabledXdpIndex Openssl310ControlValueIndexT = 2 - Openssl310ControlValueIndexTKNumControlValues Openssl310ControlValueIndexT = 3 + Openssl310ControlValueIndexTKTargetTGIDIndex Openssl310ControlValueIndexT = 0 + Openssl310ControlValueIndexTKStirlingTGIDIndex Openssl310ControlValueIndexT = 1 + Openssl310ControlValueIndexTKEnabledXdpIndex Openssl310ControlValueIndexT = 2 + Openssl310ControlValueIndexTKEnableFilterByPid Openssl310ControlValueIndexT = 3 + Openssl310ControlValueIndexTKEnableFilterByLocalPort Openssl310ControlValueIndexT = 4 + Openssl310ControlValueIndexTKEnableFilterByRemotePort Openssl310ControlValueIndexT = 5 + Openssl310ControlValueIndexTKEnableFilterByRemoteHost Openssl310ControlValueIndexT = 6 + Openssl310ControlValueIndexTKNumControlValues Openssl310ControlValueIndexT = 7 ) type Openssl310EndpointRoleT uint32 @@ -100,9 +104,11 @@ type Openssl310KernEvt struct { Len uint32 Flags uint8 _ [3]byte + Ifindex uint32 + _ [4]byte ConnIdS Openssl310ConnIdS_t - IsSample int32 Step Openssl310StepT + _ [4]byte } type Openssl310KernEvtData struct { @@ -231,6 +237,10 @@ type Openssl310MapSpecs struct { ActiveSslWriteArgsMap *ebpf.MapSpec `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.MapSpec `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.MapSpec `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.MapSpec `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.MapSpec `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.MapSpec `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.MapSpec `ebpf:"filter_pidns_map"` Rb *ebpf.MapSpec `ebpf:"rb"` SslDataMap *ebpf.MapSpec `ebpf:"ssl_data_map"` SslRb *ebpf.MapSpec `ebpf:"ssl_rb"` @@ -262,6 +272,10 @@ type Openssl310Maps struct { ActiveSslWriteArgsMap *ebpf.Map `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.Map `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.Map `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.Map `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.Map `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.Map `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.Map `ebpf:"filter_pidns_map"` Rb *ebpf.Map `ebpf:"rb"` SslDataMap *ebpf.Map `ebpf:"ssl_data_map"` SslRb *ebpf.Map `ebpf:"ssl_rb"` @@ -276,6 +290,10 @@ func (m *Openssl310Maps) Close() error { m.ActiveSslWriteArgsMap, m.ConnEvtRb, m.ConnInfoMap, + m.FilterMntnsMap, + m.FilterNetnsMap, + m.FilterPidMap, + m.FilterPidnsMap, m.Rb, m.SslDataMap, m.SslRb, diff --git a/bpf/openssl320_x86_bpfel.go b/bpf/openssl320_x86_bpfel.go index 0b285e8b..548d05e2 100644 --- a/bpf/openssl320_x86_bpfel.go +++ b/bpf/openssl320_x86_bpfel.go @@ -79,10 +79,14 @@ const ( type Openssl320ControlValueIndexT uint32 const ( - Openssl320ControlValueIndexTKTargetTGIDIndex Openssl320ControlValueIndexT = 0 - Openssl320ControlValueIndexTKStirlingTGIDIndex Openssl320ControlValueIndexT = 1 - Openssl320ControlValueIndexTKEnabledXdpIndex Openssl320ControlValueIndexT = 2 - Openssl320ControlValueIndexTKNumControlValues Openssl320ControlValueIndexT = 3 + Openssl320ControlValueIndexTKTargetTGIDIndex Openssl320ControlValueIndexT = 0 + Openssl320ControlValueIndexTKStirlingTGIDIndex Openssl320ControlValueIndexT = 1 + Openssl320ControlValueIndexTKEnabledXdpIndex Openssl320ControlValueIndexT = 2 + Openssl320ControlValueIndexTKEnableFilterByPid Openssl320ControlValueIndexT = 3 + Openssl320ControlValueIndexTKEnableFilterByLocalPort Openssl320ControlValueIndexT = 4 + Openssl320ControlValueIndexTKEnableFilterByRemotePort Openssl320ControlValueIndexT = 5 + Openssl320ControlValueIndexTKEnableFilterByRemoteHost Openssl320ControlValueIndexT = 6 + Openssl320ControlValueIndexTKNumControlValues Openssl320ControlValueIndexT = 7 ) type Openssl320EndpointRoleT uint32 @@ -100,9 +104,11 @@ type Openssl320KernEvt struct { Len uint32 Flags uint8 _ [3]byte + Ifindex uint32 + _ [4]byte ConnIdS Openssl320ConnIdS_t - IsSample int32 Step Openssl320StepT + _ [4]byte } type Openssl320KernEvtData struct { @@ -231,6 +237,10 @@ type Openssl320MapSpecs struct { ActiveSslWriteArgsMap *ebpf.MapSpec `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.MapSpec `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.MapSpec `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.MapSpec `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.MapSpec `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.MapSpec `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.MapSpec `ebpf:"filter_pidns_map"` Rb *ebpf.MapSpec `ebpf:"rb"` SslDataMap *ebpf.MapSpec `ebpf:"ssl_data_map"` SslRb *ebpf.MapSpec `ebpf:"ssl_rb"` @@ -262,6 +272,10 @@ type Openssl320Maps struct { ActiveSslWriteArgsMap *ebpf.Map `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.Map `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.Map `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.Map `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.Map `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.Map `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.Map `ebpf:"filter_pidns_map"` Rb *ebpf.Map `ebpf:"rb"` SslDataMap *ebpf.Map `ebpf:"ssl_data_map"` SslRb *ebpf.Map `ebpf:"ssl_rb"` @@ -276,6 +290,10 @@ func (m *Openssl320Maps) Close() error { m.ActiveSslWriteArgsMap, m.ConnEvtRb, m.ConnInfoMap, + m.FilterMntnsMap, + m.FilterNetnsMap, + m.FilterPidMap, + m.FilterPidnsMap, m.Rb, m.SslDataMap, m.SslRb, diff --git a/bpf/openssl323_x86_bpfel.go b/bpf/openssl323_x86_bpfel.go index 12592acb..f02ea1d9 100644 --- a/bpf/openssl323_x86_bpfel.go +++ b/bpf/openssl323_x86_bpfel.go @@ -79,10 +79,14 @@ const ( type Openssl323ControlValueIndexT uint32 const ( - Openssl323ControlValueIndexTKTargetTGIDIndex Openssl323ControlValueIndexT = 0 - Openssl323ControlValueIndexTKStirlingTGIDIndex Openssl323ControlValueIndexT = 1 - Openssl323ControlValueIndexTKEnabledXdpIndex Openssl323ControlValueIndexT = 2 - Openssl323ControlValueIndexTKNumControlValues Openssl323ControlValueIndexT = 3 + Openssl323ControlValueIndexTKTargetTGIDIndex Openssl323ControlValueIndexT = 0 + Openssl323ControlValueIndexTKStirlingTGIDIndex Openssl323ControlValueIndexT = 1 + Openssl323ControlValueIndexTKEnabledXdpIndex Openssl323ControlValueIndexT = 2 + Openssl323ControlValueIndexTKEnableFilterByPid Openssl323ControlValueIndexT = 3 + Openssl323ControlValueIndexTKEnableFilterByLocalPort Openssl323ControlValueIndexT = 4 + Openssl323ControlValueIndexTKEnableFilterByRemotePort Openssl323ControlValueIndexT = 5 + Openssl323ControlValueIndexTKEnableFilterByRemoteHost Openssl323ControlValueIndexT = 6 + Openssl323ControlValueIndexTKNumControlValues Openssl323ControlValueIndexT = 7 ) type Openssl323EndpointRoleT uint32 @@ -100,9 +104,11 @@ type Openssl323KernEvt struct { Len uint32 Flags uint8 _ [3]byte + Ifindex uint32 + _ [4]byte ConnIdS Openssl323ConnIdS_t - IsSample int32 Step Openssl323StepT + _ [4]byte } type Openssl323KernEvtData struct { @@ -231,6 +237,10 @@ type Openssl323MapSpecs struct { ActiveSslWriteArgsMap *ebpf.MapSpec `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.MapSpec `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.MapSpec `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.MapSpec `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.MapSpec `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.MapSpec `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.MapSpec `ebpf:"filter_pidns_map"` Rb *ebpf.MapSpec `ebpf:"rb"` SslDataMap *ebpf.MapSpec `ebpf:"ssl_data_map"` SslRb *ebpf.MapSpec `ebpf:"ssl_rb"` @@ -262,6 +272,10 @@ type Openssl323Maps struct { ActiveSslWriteArgsMap *ebpf.Map `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.Map `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.Map `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.Map `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.Map `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.Map `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.Map `ebpf:"filter_pidns_map"` Rb *ebpf.Map `ebpf:"rb"` SslDataMap *ebpf.Map `ebpf:"ssl_data_map"` SslRb *ebpf.Map `ebpf:"ssl_rb"` @@ -276,6 +290,10 @@ func (m *Openssl323Maps) Close() error { m.ActiveSslWriteArgsMap, m.ConnEvtRb, m.ConnInfoMap, + m.FilterMntnsMap, + m.FilterNetnsMap, + m.FilterPidMap, + m.FilterPidnsMap, m.Rb, m.SslDataMap, m.SslRb, diff --git a/bpf/openssl330_x86_bpfel.go b/bpf/openssl330_x86_bpfel.go index e94ba1f2..8ddd1142 100644 --- a/bpf/openssl330_x86_bpfel.go +++ b/bpf/openssl330_x86_bpfel.go @@ -79,10 +79,14 @@ const ( type Openssl330ControlValueIndexT uint32 const ( - Openssl330ControlValueIndexTKTargetTGIDIndex Openssl330ControlValueIndexT = 0 - Openssl330ControlValueIndexTKStirlingTGIDIndex Openssl330ControlValueIndexT = 1 - Openssl330ControlValueIndexTKEnabledXdpIndex Openssl330ControlValueIndexT = 2 - Openssl330ControlValueIndexTKNumControlValues Openssl330ControlValueIndexT = 3 + Openssl330ControlValueIndexTKTargetTGIDIndex Openssl330ControlValueIndexT = 0 + Openssl330ControlValueIndexTKStirlingTGIDIndex Openssl330ControlValueIndexT = 1 + Openssl330ControlValueIndexTKEnabledXdpIndex Openssl330ControlValueIndexT = 2 + Openssl330ControlValueIndexTKEnableFilterByPid Openssl330ControlValueIndexT = 3 + Openssl330ControlValueIndexTKEnableFilterByLocalPort Openssl330ControlValueIndexT = 4 + Openssl330ControlValueIndexTKEnableFilterByRemotePort Openssl330ControlValueIndexT = 5 + Openssl330ControlValueIndexTKEnableFilterByRemoteHost Openssl330ControlValueIndexT = 6 + Openssl330ControlValueIndexTKNumControlValues Openssl330ControlValueIndexT = 7 ) type Openssl330EndpointRoleT uint32 @@ -100,9 +104,11 @@ type Openssl330KernEvt struct { Len uint32 Flags uint8 _ [3]byte + Ifindex uint32 + _ [4]byte ConnIdS Openssl330ConnIdS_t - IsSample int32 Step Openssl330StepT + _ [4]byte } type Openssl330KernEvtData struct { @@ -231,6 +237,10 @@ type Openssl330MapSpecs struct { ActiveSslWriteArgsMap *ebpf.MapSpec `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.MapSpec `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.MapSpec `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.MapSpec `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.MapSpec `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.MapSpec `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.MapSpec `ebpf:"filter_pidns_map"` Rb *ebpf.MapSpec `ebpf:"rb"` SslDataMap *ebpf.MapSpec `ebpf:"ssl_data_map"` SslRb *ebpf.MapSpec `ebpf:"ssl_rb"` @@ -262,6 +272,10 @@ type Openssl330Maps struct { ActiveSslWriteArgsMap *ebpf.Map `ebpf:"active_ssl_write_args_map"` ConnEvtRb *ebpf.Map `ebpf:"conn_evt_rb"` ConnInfoMap *ebpf.Map `ebpf:"conn_info_map"` + FilterMntnsMap *ebpf.Map `ebpf:"filter_mntns_map"` + FilterNetnsMap *ebpf.Map `ebpf:"filter_netns_map"` + FilterPidMap *ebpf.Map `ebpf:"filter_pid_map"` + FilterPidnsMap *ebpf.Map `ebpf:"filter_pidns_map"` Rb *ebpf.Map `ebpf:"rb"` SslDataMap *ebpf.Map `ebpf:"ssl_data_map"` SslRb *ebpf.Map `ebpf:"ssl_rb"` @@ -276,6 +290,10 @@ func (m *Openssl330Maps) Close() error { m.ActiveSslWriteArgsMap, m.ConnEvtRb, m.ConnInfoMap, + m.FilterMntnsMap, + m.FilterNetnsMap, + m.FilterPidMap, + m.FilterPidnsMap, m.Rb, m.SslDataMap, m.SslRb, diff --git a/bpf/pktlatency.bpf.c b/bpf/pktlatency.bpf.c index f0d98c77..20e04f2c 100644 --- a/bpf/pktlatency.bpf.c +++ b/bpf/pktlatency.bpf.c @@ -22,6 +22,7 @@ const struct kern_evt_data *kern_evt_data_unused __attribute__((unused)); const struct conn_id_s_t *conn_id_s_t_unused __attribute__((unused)); const struct conn_info_t *conn_info_t_unused __attribute__((unused)); const struct process_exec_event *process_exec_event_unused __attribute__((unused)); +const struct process_exit_event *process_exit_event_unused __attribute__((unused)); const enum conn_type_t *conn_type_t_unused __attribute__((unused)); const enum endpoint_role_t *endpoint_role_unused __attribute__((unused)); const enum traffic_direction_t *traffic_direction_t_unused __attribute__((unused)); @@ -58,7 +59,16 @@ struct { __uint(map_flags, 0); } sock_key_conn_id_map SEC(".maps"); +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(key_size, sizeof(struct sock_key)); + __uint(value_size, sizeof(struct sock_key)); + __uint(max_entries, 65535); + __uint(map_flags, 0); +} nat_flow_map SEC(".maps"); + MY_BPF_ARRAY_PERCPU(conn_info_t_map, struct conn_info_t) +MY_BPF_ARRAY_PERCPU(kern_evt_t_map, struct kern_evt) MY_BPF_HASH(control_values, uint32_t, int64_t) @@ -69,23 +79,58 @@ enum target_tgid_match_result_t { TARGET_TGID_MATCHED, TARGET_TGID_UNMATCHED, }; -static __inline enum target_tgid_match_result_t match_trace_tgid(const uint32_t tgid) { - // TODO(yzhao): Use externally-defined macro to replace BPF_MAP. Since this function is called for - // all PIDs, this optimization is useful. - uint32_t idx = kTargetTGIDIndex; - int64_t* target_tgid = bpf_map_lookup_elem(&control_values, &idx); - if (target_tgid == NULL) { - return TARGET_TGID_UNSPECIFIED; - } - if (*target_tgid < 0) { - // Negative value means trace all. - return TARGET_TGID_ALL; - } - if (*target_tgid == tgid) { - return TARGET_TGID_MATCHED; - } - return TARGET_TGID_UNMATCHED; -// return TARGET_TGID_UNSPECIFIED; + +static __always_inline int filter_mntns(u32 ns) { + if (bpf_map_lookup_elem(&filter_mntns_map, &ns)) { + return 0; + } + return -1; +} + +static __always_inline int filter_pidns(u32 ns) { + if (bpf_map_lookup_elem(&filter_pidns_map, &ns)) { + return 0; + } + return -1; +} + +static __always_inline int filter_netns(u32 ns) { + if (bpf_map_lookup_elem(&filter_netns_map, &ns)) { + return 0; + } + return -1; +} + +static __always_inline enum target_tgid_match_result_t match_trace_tgid(const uint32_t tgid) { + uint32_t idx = kEnableFilterByPid; + int64_t* target_tgid = bpf_map_lookup_elem(&control_values, &idx); + if (target_tgid == NULL) { + return TARGET_TGID_ALL; + } + if (bpf_map_lookup_elem(&filter_pid_map, &tgid)) { + return TARGET_TGID_MATCHED; + } +#ifdef LAGACY_KERNEL_310 + + return TARGET_TGID_UNMATCHED; +#else + struct task_struct *task = (struct task_struct *)bpf_get_current_task(); + + bool should_filter = false; + u32 pidns_id = BPF_CORE_READ(task, nsproxy, pid_ns_for_children, ns.inum); + u32 mntns_id = BPF_CORE_READ(task, nsproxy, mnt_ns, ns.inum); + u32 netns_id = BPF_CORE_READ(task, nsproxy, net_ns, ns.inum); + if ((filter_pidns(pidns_id) == 0) || (filter_mntns(mntns_id) == 0) || (filter_netns(netns_id) == 0)) { + should_filter = true; + } + if (should_filter) { + u8 u8_zero = 0; + bpf_map_update_elem(&filter_pid_map, &tgid, &u8_zero, BPF_NOEXIST); + return TARGET_TGID_MATCHED; + } + + return TARGET_TGID_UNMATCHED; +#endif } static __always_inline void reverse_sock_key_no_copy(struct sock_key* key) { @@ -113,21 +158,14 @@ static void __always_inline parse_kern_evt_body(struct parse_kern_evt_body *para u32 len = param->len; const char *func_name = param->func_name; enum step_t step = param->step; -#ifdef KERNEL_VERSION_BELOW_58 - struct kern_evt _evt = {0}; - struct kern_evt* evt = &_evt; -#else - struct kern_evt* evt = bpf_ringbuf_reserve(&rb, sizeof(struct kern_evt), 0); -#endif + int zero = 0; + struct kern_evt* evt = bpf_map_lookup_elem(&kern_evt_t_map, &zero); if(!evt) { return; } struct conn_id_s_t* conn_id_s = bpf_map_lookup_elem(&sock_key_conn_id_map, key); if (conn_id_s == NULL || conn_id_s->no_trace) { -#ifndef KERNEL_VERSION_BELOW_58 - bpf_ringbuf_discard(evt, 0); -#endif return; } uint64_t tgid_fd = conn_id_s->tgid_fd; @@ -145,11 +183,7 @@ static void __always_inline parse_kern_evt_body(struct parse_kern_evt_body *para evt->step = step; bpf_probe_read_kernel(evt->func_name,FUNC_NAME_LIMIT, func_name); // my_strcpy(evt->func_name, func_name, FUNC_NAME_LIMIT); -#ifdef KERNEL_VERSION_BELOW_58 - bpf_perf_event_output(ctx, &rb, BPF_F_CURRENT_CPU, evt, sizeof(_evt)); -#else - bpf_ringbuf_submit(evt, 0); -#endif + bpf_perf_event_output(ctx, &rb, BPF_F_CURRENT_CPU, evt, sizeof(struct kern_evt)); } // static __always_inline void report_kern_evt(void* ctx, u32 seq, struct sock_key* key,struct tcphdr* tcp, int len, char* func_name, enum step_t step) { static __always_inline void report_kern_evt(struct parse_kern_evt_body *param) { @@ -160,21 +194,17 @@ static __always_inline void report_kern_evt(struct parse_kern_evt_body *param) int len = param->len; const char *func_name = param->func_name; enum step_t step = param->step; -#ifdef KERNEL_VERSION_BELOW_58 - struct kern_evt _evt = {0}; - struct kern_evt* evt = &_evt; -#else - struct kern_evt* evt = bpf_ringbuf_reserve(&rb, sizeof(struct kern_evt), 0); + // struct kern_evt _evt = {0}; + // struct kern_evt* evt = &_evt; + + int zero = 0; + struct kern_evt* evt = bpf_map_lookup_elem(&kern_evt_t_map, &zero); if(!evt) { return; } -#endif struct conn_id_s_t* conn_id_s = bpf_map_lookup_elem(&sock_key_conn_id_map, key); if (conn_id_s == NULL || conn_id_s->no_trace) { -#ifndef KERNEL_VERSION_BELOW_58 - bpf_ringbuf_discard(evt, 0); -#endif // if (key->sport==3306&& step == DEV_IN) { // bpf_printk("discard!"); // print_sock_key(key); @@ -200,16 +230,13 @@ static __always_inline void report_kern_evt(struct parse_kern_evt_body *param) evt->len = len - hdr_len; evt->ts = bpf_ktime_get_ns(); evt->step = step; + evt->ifindex = param->ifindex; // evt->flags = _(((u8 *)tcp)[13]); bpf_probe_read_kernel(&evt->flags, sizeof(uint8_t), &(((u8 *)tcp)[13])); // bpf_probe_read_kernel(evt->func_name,FUNC_NAME_LIMIT, func_name); // my_strcpy(evt->func_name, func_name, FUNC_NAME_LIMIT); -#ifdef KERNEL_VERSION_BELOW_58 bpf_perf_event_output(ctx, &rb, BPF_F_CURRENT_CPU, evt, sizeof(struct kern_evt)); -#else - bpf_ringbuf_submit(evt, 0); -#endif } #define DEBUG 0 @@ -314,22 +341,6 @@ static void __always_inline parse_sock_key_from_ipv6_tcp_hdr(struct sock_key *ke key->dport = bpf_ntohs(dport); } -static bool __always_inline should_trace_sock_key(struct sock_key *key) { - struct conn_id_s_t *conn_id_s = {0}; - conn_id_s = bpf_map_lookup_elem(&sock_key_conn_id_map, key); - if (conn_id_s == NULL) { - // 可能还在握手 - return true; - } - struct conn_info_t *conn_info = {0}; - u64 tgidfd = conn_id_s->tgid_fd; - conn_info = bpf_map_lookup_elem(&conn_info_map, &tgidfd); - if (conn_info == NULL) { - // why? - return true; - } - return should_trace_conn(conn_info); -} static __always_inline int enabledXDP() { uint32_t idx = kEnabledXdpIndex; @@ -364,9 +375,6 @@ static __always_inline int parse_skb(void* ctx, struct sk_buff *skb, bool sk_not if (found == NULL) { return 0; } - if (!should_trace_sock_key(&key)) { - return 0; - } bpf_probe_read_kernel(&inital_seq, sizeof(inital_seq), found); } } @@ -458,16 +466,21 @@ static __always_inline int parse_skb(void* ctx, struct sk_buff *skb, bool sk_not }else{ parse_sock_key_from_ipv6_tcp_hdr(&key, ipv6, tcp); } - + if (step == DEV_IN || step == DEV_OUT) { + struct sock_key *translated_flow = bpf_map_lookup_elem(&nat_flow_map, &key); + if (translated_flow != NULL) { + key = *translated_flow; + } + } // if (key.dport != target_port && key.sport != target_port) { // goto err; // } - if (!should_trace_sock_key(&key)) { - goto err; - } + // if (!should_trace_sock_key(&key)) { + // goto err; + // } int *found = bpf_map_lookup_elem(&sock_xmit_map, &key); if (found == NULL) { - if (step == DEV_IN && enabledXDP() != 1 && should_trace_sock_key(&key)) { + if (step == DEV_IN) { BPF_CORE_READ_INTO(&inital_seq, tcp, seq); inital_seq = bpf_ntohl(inital_seq); uint8_t flag = 0; @@ -492,6 +505,13 @@ static __always_inline int parse_skb(void* ctx, struct sk_buff *skb, bool sk_not body.len = tcp_len; // body.func_name = func_name; body.step = step; + + struct net_device *dev = _C(skb, dev); + if (dev) { + body.ifindex = _C(dev, ifindex); + } else { + body.ifindex = _C(skb, skb_iif); + } if (step >= NIC_IN){ reverse_sock_key_no_copy(&key); } @@ -505,13 +525,10 @@ static __always_inline int parse_skb(void* ctx, struct sk_buff *skb, bool sk_not err:return BPF_OK; } -// #ifndef KERNEL_VERSION_BELOW_58 SEC("xdp") int xdp_proxy(struct xdp_md *ctx){ return XDP_PASS; } -// #else -// #endif static __always_inline int handle_skb_data_copy(void *ctx, struct sk_buff *skb, int offset, struct iov_iter *to, int len) { struct sock_key key = {0}; @@ -520,9 +537,9 @@ static __always_inline int handle_skb_data_copy(void *ctx, struct sk_buff *skb, if (!found) { return BPF_OK; } - if (!should_trace_sock_key(&key)) { - return BPF_OK; - } + // if (!should_trace_sock_key(&key)) { + // return BPF_OK; + // } u32 inital_seq = 0; bpf_probe_read_kernel(&inital_seq, sizeof(inital_seq), found); @@ -629,7 +646,7 @@ static __always_inline int handle_ip_queue_xmit(void* ctx, struct sk_buff *skb) parse_sock_key(skb, &key); // 如果map里有才进行后面的步骤 int *found = bpf_map_lookup_elem(&sock_xmit_map, &key); - if (found == NULL && !should_trace_sock_key(&key)) { + if (found == NULL) { return 0; } u32 inital_seq = 0; @@ -667,7 +684,6 @@ int BPF_KPROBE(ip_queue_xmit, void *sk, struct sk_buff *skb) return handle_ip_queue_xmit(ctx, skb); } -// #ifndef KERNEL_VERSION_BELOW_58 SEC("raw_tp/tcp_destroy_sock") int BPF_PROG(tcp_destroy_sock, struct sock *sk) { @@ -697,6 +713,81 @@ int BPF_PROG(tcp_destroy_sock, struct sock *sk) } // #endif +// nat + +static __always_inline void parse_conntrack_tuple(struct nf_conntrack_tuple *tuple, struct sock_key *flow) { + BPF_CORE_READ_INTO(&flow->sip, tuple, src.u3.all); + BPF_CORE_READ_INTO(&flow->dip, tuple, dst.u3.all); + + flow->sport = bpf_ntohs(tuple->src.u.all); + flow->dport = bpf_ntohs(tuple->dst.u.all); +} +static __always_inline void reverse_flow(struct sock_key *orig_flow, struct sock_key *new_flow) { + new_flow->sip[0] = orig_flow->dip[0]; + new_flow->sip[1] = orig_flow->dip[1]; + + new_flow->dip[0] = orig_flow->sip[0]; + new_flow->dip[1] = orig_flow->sip[1]; + + new_flow->sport = orig_flow->dport; + new_flow->dport = orig_flow->sport; +} + +static __always_inline void handle_nat(struct nf_conn *ct) { + struct nf_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX]; + + if (bpf_core_field_exists(ct->tuplehash)) { + BPF_CORE_READ_INTO(&tuplehash, ct, tuplehash); + } else { + struct nf_conn___older_52 *nf_conn_old = (void *)ct; + if (bpf_core_field_exists(nf_conn_old->tuplehash)) { + BPF_CORE_READ_INTO(&tuplehash, nf_conn_old, tuplehash); + } else { + return; + } + } + + struct nf_conntrack_tuple *orig_tuple = &tuplehash[IP_CT_DIR_ORIGINAL].tuple; + struct nf_conntrack_tuple *reply_tuple = &tuplehash[IP_CT_DIR_REPLY].tuple; + + struct sock_key orig = {0}; + struct sock_key reply = {0}; + parse_conntrack_tuple(orig_tuple, &orig); + parse_conntrack_tuple(reply_tuple, &reply); + + struct sock_key reversed_orig = {0}; + reverse_flow(&orig, &reversed_orig); + // debug_log("[ptcpdump] nat flow %pI4:%d %pI4:%d ->\n", + // &reply.saddr[0], reply.sport, + // &reply.daddr[0], reply.dport); + // debug_log("[ptcpdump] -> %pI4:%d %pI4:%d\n", + // &reversed_orig.saddr[0], reversed_orig.sport, + // &reversed_orig.saddr[0], reversed_orig.dport); + bpf_map_update_elem(&nat_flow_map, &reply, &reversed_orig, BPF_ANY); + + struct sock_key reversed_reply = {0}; + reverse_flow(&reply, &reversed_reply); + // debug_log("[ptcpdump] nat flow %pI4:%d %pI4:%d ->\n", + // &reversed_reply.saddr[0], reversed_reply.sport, + // &reversed_reply.daddr[0], reversed_reply.dport); + // debug_log("[ptcpdump] -> %pI4:%d %pI4:%d\n", + // &orig.saddr[0], orig.sport, + // &orig.saddr[0], orig.dport); + bpf_map_update_elem(&nat_flow_map, &reversed_reply, &orig, BPF_ANY); +} + +SEC("kprobe/nf_nat_packet") +int BPF_KPROBE(kprobe__nf_nat_packet, struct nf_conn *ct) { + handle_nat(ct); + return 0; +} + +SEC("kprobe/nf_nat_manip_pkt") +int BPF_KPROBE(kprobe__nf_nat_manip_pkt, void *_, struct nf_conn *ct) { + handle_nat(ct); + return 0; +} + MY_BPF_HASH(accept_args_map, uint64_t, struct accept_args) MY_BPF_HASH(connect_args_map, uint64_t, struct connect_args) MY_BPF_HASH(close_args_map, uint64_t, struct close_args) @@ -780,10 +871,10 @@ static __always_inline struct tcp_sock *get_socket_from_fd(int fd_num) { sk = (struct tcp_sock *)_C(socket,sk); } if ((socket_type == SOCK_STREAM || socket_type == SOCK_DGRAM) -#ifdef KERNEL_VERSION_BELOW_58 -#else - && check_file == file /*&& __socket.state == SS_CONNECTED */ -#endif +// #ifdef KERNEL_VERSION_BELOW_58 +// #else +// && check_file == file /*&& __socket.state == SS_CONNECTED */ +// #endif ) { return sk; } @@ -1650,11 +1741,20 @@ struct { __uint(key_size, sizeof(u32)); __uint(value_size, sizeof(u32)); } proc_exec_events SEC(".maps"); +struct { + __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY); + __uint(key_size, sizeof(u32)); + __uint(value_size, sizeof(u32)); +} proc_exit_events SEC(".maps"); struct process_exec_event { int pid; }; +struct process_exit_event { + int pid; +}; + SEC("tracepoint/sched/sched_process_exec") int tracepoint__sched__sched_process_exec(struct trace_event_raw_sched_process_exec *ctx) { struct process_exec_event event = {0}; @@ -1668,4 +1768,20 @@ int tracepoint__sched__sched_process_exec(struct trace_event_raw_sched_process_e bpf_perf_event_output(ctx, &proc_exec_events, BPF_F_CURRENT_CPU, &event, sizeof(struct process_exec_event)); } return BPF_OK; +} + + +SEC("tracepoint/sched/sched_process_exit") +int tracepoint__sched__sched_process_exit(struct trace_event_raw_sched_process_exec *ctx) { + struct process_exit_event event = {0}; + uint64_t id = bpf_get_current_pid_tgid(); + uint32_t tgid = id >> 32; + uint32_t tid = id; + + bool is_thread_group_leader = tgid == tid; + if (is_thread_group_leader) { + event.pid = tgid; + bpf_perf_event_output(ctx, &proc_exit_events, BPF_F_CURRENT_CPU, &event, sizeof(struct process_exit_event)); + } + return BPF_OK; } \ No newline at end of file diff --git a/bpf/pktlatency.h b/bpf/pktlatency.h index 90a0a60d..3e47fbe3 100644 --- a/bpf/pktlatency.h +++ b/bpf/pktlatency.h @@ -94,6 +94,10 @@ enum control_value_index_t { kTargetTGIDIndex = 0, kStirlingTGIDIndex, kEnabledXdpIndex, + kEnableFilterByPid, + kEnableFilterByLocalPort, + kEnableFilterByRemotePort, + kEnableFilterByRemoteHost, kNumControlValues, }; @@ -167,8 +171,8 @@ struct kern_evt { uint64_t seq; uint32_t len; uint8_t flags; + uint32_t ifindex; struct conn_id_s_t conn_id_s; - int is_sample; enum step_t step; }; #define MAX_MSG_SIZE 30720 @@ -294,6 +298,7 @@ struct parse_kern_evt_body { const char *func_name; enum step_t step; struct tcphdr* tcp; + u32 ifindex; }; // const char SYSCALL_FUNC_NAME[] = "syscall"; @@ -364,7 +369,48 @@ bpf_probe_read_kernel(dst, sizeof(*dst), __p);} {void *__p = (void*)ctx + sizeof(struct trace_entry) + sizeof(long int); \ bpf_probe_read_kernel(dst, sizeof(*dst), __p); } - - +struct nf_conntrack_tuple___custom { + struct nf_conntrack_man src; + struct { + union nf_inet_addr u3; + union { + __be16 all; + struct { + __be16 port; + } tcp; + struct { + __be16 port; + } udp; + struct { + u_int8_t type; + u_int8_t code; + } icmp; + struct { + __be16 port; + } dccp; + struct { + __be16 port; + } sctp; + struct { + __be16 key; + } gre; + } u; + u_int8_t protonum; + u_int8_t dir; + } dst; +} __attribute__((preserve_access_index)); + +struct nf_conntrack_tuple_hash___custom { + struct hlist_nulls_node hnnode; + struct nf_conntrack_tuple___custom tuple; +} __attribute__((preserve_access_index)); +// https://elixir.bootlin.com/linux/v5.2.21/source/include/net/netfilter/nf_conntrack.h +struct nf_conn___older_52 { + struct nf_conntrack ct_general; + spinlock_t lock; + u16 ___cpu; + struct nf_conntrack_zone zone; + struct nf_conntrack_tuple_hash___custom tuplehash[IP_CT_DIR_MAX]; +} __attribute__((preserve_access_index)); #endif diff --git a/bpf/prog.go b/bpf/prog.go index ad9ad335..2bff2610 100644 --- a/bpf/prog.go +++ b/bpf/prog.go @@ -11,7 +11,7 @@ import ( var Objs any -type AttachBpfProgFunction func(interface{}) link.Link +type AttachBpfProgFunction func() link.Link func GetProgramFromObjs(objs any, progName string) *ebpf.Program { val := reflect.ValueOf(objs) @@ -31,139 +31,125 @@ func GetProgramFromObjs(objs any, progName string) *ebpf.Program { } } -func GetProgram(programs any, fieldName string) *ebpf.Program { - oldprograms, isOld := programs.(AgentOldPrograms) - if isOld { - v := reflect.ValueOf(oldprograms) - f := v.FieldByName(fieldName).Interface() - return f.(*ebpf.Program) - } else { - newprograms := programs.(AgentPrograms) - v := reflect.ValueOf(newprograms) - f := v.FieldByName(fieldName).Interface() - return f.(*ebpf.Program) - } -} - /* accept pair */ -func AttachSyscallAcceptEntry(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_enter_accept4", GetProgram(programs, "TracepointSyscallsSysEnterAccept4")) +func AttachSyscallAcceptEntry() link.Link { + return TracepointNoError("syscalls", "sys_enter_accept4", GetProgramFromObjs(Objs, "TracepointSyscallsSysEnterAccept4")) } -func AttachSyscallAcceptExit(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_exit_accept4", GetProgram(programs, "TracepointSyscallsSysExitAccept4")) +func AttachSyscallAcceptExit() link.Link { + return TracepointNoError("syscalls", "sys_exit_accept4", GetProgramFromObjs(Objs, "TracepointSyscallsSysExitAccept4")) } /* sock_alloc */ -func AttachSyscallSockAllocExit(programs interface{}) link.Link { - return KretprobeNoError("sock_alloc", GetProgram(programs, "SockAllocRet")) +func AttachSyscallSockAllocExit() link.Link { + return KretprobeNoError("sock_alloc", GetProgramFromObjs(Objs, "SockAllocRet")) } /* connect pair */ -func AttachSyscallConnectEntry(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_enter_connect", GetProgram(programs, "TracepointSyscallsSysEnterConnect")) +func AttachSyscallConnectEntry() link.Link { + return TracepointNoError("syscalls", "sys_enter_connect", GetProgramFromObjs(Objs, "TracepointSyscallsSysEnterConnect")) } -func AttachSyscallConnectExit(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_exit_connect", GetProgram(programs, "TracepointSyscallsSysExitConnect")) +func AttachSyscallConnectExit() link.Link { + return TracepointNoError("syscalls", "sys_exit_connect", GetProgramFromObjs(Objs, "TracepointSyscallsSysExitConnect")) } /* close pair */ -func AttachSyscallCloseEntry(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_enter_close", GetProgram(programs, "TracepointSyscallsSysEnterClose")) +func AttachSyscallCloseEntry() link.Link { + return TracepointNoError("syscalls", "sys_enter_close", GetProgramFromObjs(Objs, "TracepointSyscallsSysEnterClose")) } -func AttachSyscallCloseExit(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_exit_close", GetProgram(programs, "TracepointSyscallsSysExitClose")) +func AttachSyscallCloseExit() link.Link { + return TracepointNoError("syscalls", "sys_exit_close", GetProgramFromObjs(Objs, "TracepointSyscallsSysExitClose")) } /* write pair */ -func AttachSyscallWriteEntry(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_enter_write", GetProgram(programs, "TracepointSyscallsSysEnterWrite")) +func AttachSyscallWriteEntry() link.Link { + return TracepointNoError("syscalls", "sys_enter_write", GetProgramFromObjs(Objs, "TracepointSyscallsSysEnterWrite")) } -func AttachSyscallWriteExit(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_exit_write", GetProgram(programs, "TracepointSyscallsSysExitWrite")) +func AttachSyscallWriteExit() link.Link { + return TracepointNoError("syscalls", "sys_exit_write", GetProgramFromObjs(Objs, "TracepointSyscallsSysExitWrite")) } /* sendmsg pair */ -func AttachSyscallSendMsgEntry(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_enter_sendmsg", GetProgram(programs, "TracepointSyscallsSysEnterSendmsg")) +func AttachSyscallSendMsgEntry() link.Link { + return TracepointNoError("syscalls", "sys_enter_sendmsg", GetProgramFromObjs(Objs, "TracepointSyscallsSysEnterSendmsg")) } -func AttachSyscallSendMsgExit(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_exit_sendmsg", GetProgram(programs, "TracepointSyscallsSysExitSendmsg")) +func AttachSyscallSendMsgExit() link.Link { + return TracepointNoError("syscalls", "sys_exit_sendmsg", GetProgramFromObjs(Objs, "TracepointSyscallsSysExitSendmsg")) } /* recvmsg pair */ -func AttachSyscallRecvMsgEntry(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_enter_recvmsg", GetProgram(programs, "TracepointSyscallsSysEnterRecvmsg")) +func AttachSyscallRecvMsgEntry() link.Link { + return TracepointNoError("syscalls", "sys_enter_recvmsg", GetProgramFromObjs(Objs, "TracepointSyscallsSysEnterRecvmsg")) } -func AttachSyscallRecvMsgExit(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_exit_recvmsg", GetProgram(programs, "TracepointSyscallsSysExitRecvmsg")) +func AttachSyscallRecvMsgExit() link.Link { + return TracepointNoError("syscalls", "sys_exit_recvmsg", GetProgramFromObjs(Objs, "TracepointSyscallsSysExitRecvmsg")) } /* writev pair */ -func AttachSyscallWritevEntry(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_enter_writev", GetProgram(programs, "TracepointSyscallsSysEnterWritev")) +func AttachSyscallWritevEntry() link.Link { + return TracepointNoError("syscalls", "sys_enter_writev", GetProgramFromObjs(Objs, "TracepointSyscallsSysEnterWritev")) } -func AttachSyscallWritevExit(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_exit_writev", GetProgram(programs, "TracepointSyscallsSysExitWritev")) +func AttachSyscallWritevExit() link.Link { + return TracepointNoError("syscalls", "sys_exit_writev", GetProgramFromObjs(Objs, "TracepointSyscallsSysExitWritev")) } /* sendto pair */ -func AttachSyscallSendtoEntry(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_enter_sendto", GetProgram(programs, "TracepointSyscallsSysEnterSendto")) +func AttachSyscallSendtoEntry() link.Link { + return TracepointNoError("syscalls", "sys_enter_sendto", GetProgramFromObjs(Objs, "TracepointSyscallsSysEnterSendto")) } -func AttachSyscallSendtoExit(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_exit_sendto", GetProgram(programs, "TracepointSyscallsSysExitSendto")) +func AttachSyscallSendtoExit() link.Link { + return TracepointNoError("syscalls", "sys_exit_sendto", GetProgramFromObjs(Objs, "TracepointSyscallsSysExitSendto")) } /* read pair */ -func AttachSyscallReadEntry(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_enter_read", GetProgram(programs, "TracepointSyscallsSysEnterRead")) +func AttachSyscallReadEntry() link.Link { + return TracepointNoError("syscalls", "sys_enter_read", GetProgramFromObjs(Objs, "TracepointSyscallsSysEnterRead")) } -func AttachSyscallReadExit(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_exit_read", GetProgram(programs, "TracepointSyscallsSysExitRead")) +func AttachSyscallReadExit() link.Link { + return TracepointNoError("syscalls", "sys_exit_read", GetProgramFromObjs(Objs, "TracepointSyscallsSysExitRead")) } /* readv pair */ -func AttachSyscallReadvEntry(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_enter_readv", GetProgram(programs, "TracepointSyscallsSysEnterReadv")) +func AttachSyscallReadvEntry() link.Link { + return TracepointNoError("syscalls", "sys_enter_readv", GetProgramFromObjs(Objs, "TracepointSyscallsSysEnterReadv")) } -func AttachSyscallReadvExit(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_exit_readv", GetProgram(programs, "TracepointSyscallsSysExitReadv")) +func AttachSyscallReadvExit() link.Link { + return TracepointNoError("syscalls", "sys_exit_readv", GetProgramFromObjs(Objs, "TracepointSyscallsSysExitReadv")) } /* recvfrom pair */ -func AttachSyscallRecvfromEntry(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_enter_recvfrom", GetProgram(programs, "TracepointSyscallsSysEnterRecvfrom")) +func AttachSyscallRecvfromEntry() link.Link { + return TracepointNoError("syscalls", "sys_enter_recvfrom", GetProgramFromObjs(Objs, "TracepointSyscallsSysEnterRecvfrom")) } -func AttachSyscallRecvfromExit(programs interface{}) link.Link { - return TracepointNoError("syscalls", "sys_exit_recvfrom", GetProgram(programs, "TracepointSyscallsSysExitRecvfrom")) +func AttachSyscallRecvfromExit() link.Link { + return TracepointNoError("syscalls", "sys_exit_recvfrom", GetProgramFromObjs(Objs, "TracepointSyscallsSysExitRecvfrom")) } /* security_socket_recvmsg */ -func AttachKProbeSecuritySocketRecvmsgEntry(programs interface{}) link.Link { - return Kprobe2("security_socket_recvmsg", GetProgram(programs, "SecuritySocketRecvmsgEnter")) +func AttachKProbeSecuritySocketRecvmsgEntry() link.Link { + return Kprobe2("security_socket_recvmsg", GetProgramFromObjs(Objs, "SecuritySocketRecvmsgEnter")) } /* security_socket_sendmsg */ -func AttachKProbeSecuritySocketSendmsgEntry(programs interface{}) link.Link { - return Kprobe2("security_socket_sendmsg", GetProgram(programs, "SecuritySocketSendmsgEnter")) +func AttachKProbeSecuritySocketSendmsgEntry() link.Link { + return Kprobe2("security_socket_sendmsg", GetProgramFromObjs(Objs, "SecuritySocketSendmsgEnter")) } /* tcp_destroy_sock */ -func AttachRawTracepointTcpDestroySockEntry(programs interface{}) (link.Link, error) { +func AttachRawTracepointTcpDestroySockEntry() (link.Link, error) { return link.AttachRawTracepoint(link.RawTracepointOptions{ Name: "tcp_destroy_sock", - Program: GetProgram(programs, "TcpDestroySock"), + Program: GetProgramFromObjs(Objs, "TcpDestroySock"), }) // if err != nil { // log.Fatal("tcp_destroy_sock failed: ", err) @@ -171,20 +157,20 @@ func AttachRawTracepointTcpDestroySockEntry(programs interface{}) (link.Link, er // return l } -func AttachKProbeDevQueueXmitEntry(programs interface{}) (link.Link, error) { - return Kprobe("dev_queue_xmit", GetProgram(programs, "DevQueueXmit")) +func AttachKProbeDevQueueXmitEntry() (link.Link, error) { + return Kprobe("dev_queue_xmit", GetProgramFromObjs(Objs, "DevQueueXmit")) } -func AttachKProbeDevHardStartXmitEntry(programs interface{}) (link.Link, error) { - return Kprobe("dev_hard_start_xmit", GetProgram(programs, "DevHardStartXmit")) +func AttachKProbeDevHardStartXmitEntry() (link.Link, error) { + return Kprobe("dev_hard_start_xmit", GetProgramFromObjs(Objs, "DevHardStartXmit")) } -func AttachKProbeTcpV4DoRcvEntry(programs interface{}) (link.Link, error) { - return Kprobe("tcp_v4_do_rcv", GetProgram(programs, "TcpV4DoRcv")) +func AttachKProbeTcpV4DoRcvEntry() (link.Link, error) { + return Kprobe("tcp_v4_do_rcv", GetProgramFromObjs(Objs, "TcpV4DoRcv")) } -func AttachTracepointNetifReceiveSkb(programs interface{}) link.Link { - return TracepointNoError("net", "netif_receive_skb", GetProgram(programs, "TracepointNetifReceiveSkb")) +func AttachTracepointNetifReceiveSkb() link.Link { + return TracepointNoError("net", "netif_receive_skb", GetProgramFromObjs(Objs, "TracepointNetifReceiveSkb")) } -func AttachXdpWithSpecifiedIfName(programs interface{}, ifname string) (link.Link, error) { +func AttachXdpWithSpecifiedIfName(ifname string) (link.Link, error) { iface, err := net.InterfaceByName(ifname) if err != nil { @@ -193,21 +179,21 @@ func AttachXdpWithSpecifiedIfName(programs interface{}, ifname string) (link.Lin } l, err := link.AttachXDP(link.XDPOptions{ - Program: GetProgram(programs, "XdpProxy"), + Program: GetProgramFromObjs(Objs, "XdpProxy"), Interface: iface.Index, Flags: link.XDPDriverMode, }) if err != nil { l, err = link.AttachXDP(link.XDPOptions{ - Program: GetProgram(programs, "XdpProxy"), + Program: GetProgramFromObjs(Objs, "XdpProxy"), Interface: iface.Index, Flags: link.XDPGenericMode, }) } return l, err } -func AttachXdp(programs interface{}) (link.Link, error) { - return AttachXdpWithSpecifiedIfName(programs, "eth0") +func AttachXdp() (link.Link, error) { + return AttachXdpWithSpecifiedIfName("eth0") } func Kprobe(func_name string, prog *ebpf.Program) (link.Link, error) { diff --git a/cmd/common.go b/cmd/common.go index c1eab89e..4f7d3ba4 100644 --- a/cmd/common.go +++ b/cmd/common.go @@ -3,13 +3,16 @@ package cmd import ( "fmt" "kyanos/agent" + ac "kyanos/agent/common" "kyanos/agent/protocol" "kyanos/common" + "github.com/go-logr/logr" "github.com/jefurry/logrus" "github.com/sevlyar/go-daemon" "github.com/spf13/cobra" "github.com/spf13/viper" + "k8s.io/klog/v2" ) type ModeEnum int @@ -36,7 +39,7 @@ func ParseSide(side string) (common.SideEnum, error) { } } -func startAgent(options agent.AgentOptions) { +func startAgent(options ac.AgentOptions) { side, err := ParseSide(SidePar) if err != nil { return @@ -57,6 +60,13 @@ func startAgent(options agent.AgentOptions) { options.PerfEventBufferSizeForEvent = KernEvtPerfEventBufferSize options.PerfEventBufferSizeForData = DataEvtPerfEventBufferSize + options.ContainerdEndpoint = ContainerdEndpoint + options.DockerEndpoint = DockerEndpoint + options.CriRuntimeEndpoint = CriRuntimeEndpoint + options.ContainerId = ContainerId + options.ContainerName = ContainerName + options.PodName = PodName + InitLog() common.AgentLog.Infoln("Kyanos starting...") if viper.GetBool(common.DaemonVarName) { @@ -144,6 +154,13 @@ func InitLog() { if isValidLogLevel(UprobeLogLevel) { common.UprobeLog.SetLevel(logrus.Level(UprobeLogLevel)) } + + switch common.AgentLog.Level { + case logrus.InfoLevel: + fallthrough + case logrus.DebugLevel: + klog.SetLogger(logr.Discard()) + } } func isValidLogLevel(level int32) bool { diff --git a/cmd/http.go b/cmd/http.go index 22ae5ff7..96960742 100644 --- a/cmd/http.go +++ b/cmd/http.go @@ -1,7 +1,7 @@ package cmd import ( - "kyanos/agent" + ac "kyanos/agent/common" "kyanos/agent/protocol" "github.com/spf13/cobra" @@ -23,7 +23,7 @@ var httpCmd *cobra.Command = &cobra.Command{ if err != nil { logger.Fatalf("invalid host: %v\n", err) } - startAgent(agent.AgentOptions{ + startAgent(ac.AgentOptions{ MessageFilter: protocol.HttpFilter{ TargetPath: path, TargetMethods: methods, diff --git a/cmd/mysql.go b/cmd/mysql.go index 8cdb2a49..e2c9088e 100644 --- a/cmd/mysql.go +++ b/cmd/mysql.go @@ -1,7 +1,7 @@ package cmd import ( - "kyanos/agent" + ac "kyanos/agent/common" "kyanos/agent/protocol/mysql" "github.com/spf13/cobra" @@ -11,7 +11,7 @@ var mysqlCmd *cobra.Command = &cobra.Command{ Use: "mysql", Short: "watch MYSQL message", Run: func(cmd *cobra.Command, args []string) { - startAgent(agent.AgentOptions{ + startAgent(ac.AgentOptions{ MessageFilter: mysql.MysqlFilter{}, LatencyFilter: initLatencyFilter(cmd), SizeFilter: initSizeFilter(cmd), diff --git a/cmd/redis.go b/cmd/redis.go index 0cef9313..89a27333 100644 --- a/cmd/redis.go +++ b/cmd/redis.go @@ -1,7 +1,7 @@ package cmd import ( - "kyanos/agent" + ac "kyanos/agent/common" "kyanos/agent/protocol" "github.com/spf13/cobra" @@ -23,7 +23,7 @@ var redisCmd *cobra.Command = &cobra.Command{ if err != nil { logger.Fatalf("invalid prefix: %v\n", err) } - startAgent(agent.AgentOptions{ + startAgent(ac.AgentOptions{ MessageFilter: protocol.RedisFilter{ TargetCommands: commands, TargetKeys: keys, diff --git a/cmd/root.go b/cmd/root.go index 567edaec..b7e774c7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -2,8 +2,10 @@ package cmd import ( "fmt" - "kyanos/agent" + ac "kyanos/agent/common" + "kyanos/agent/metadata/k8s" "kyanos/common" + "strings" "github.com/jefurry/logrus" "github.com/spf13/cobra" @@ -33,13 +35,13 @@ sudo kyanos stat http --metrics t --group-by remote-ip sudo kyanos stat http --metrics t --samples 3 --full-body sudo kyanos stat http --metrics tq --sort-by avg --group-by remote-ip`, Run: func(cmd *cobra.Command, args []string) { - startAgent(agent.AgentOptions{}) + startAgent(ac.AgentOptions{}) }, } var Daemon bool var Debug bool -var FilterPid int64 +var FilterPids []string var RemotePorts []string var LocalPorts []string var RemoteIps []string @@ -55,9 +57,15 @@ var BPFEventLogLevel int32 var ConntrackLogLevel int32 var ProtocolLogLevel int32 var UprobeLogLevel int32 +var DockerEndpoint string +var ContainerdEndpoint string +var CriRuntimeEndpoint string +var ContainerId string +var ContainerName string +var PodName string func init() { - rootCmd.PersistentFlags().Int64VarP(&FilterPid, "pid", "p", 0, "Filter by pid") + rootCmd.PersistentFlags().StringSliceVarP(&FilterPids, "pids", "p", []string{}, "Filter by pids, seperate by ','") rootCmd.PersistentFlags().StringSliceVarP(&RemotePorts, common.RemotePortsVarName, "", []string{}, "Filter by remote ports, seperate by ','") rootCmd.PersistentFlags().StringSliceVarP(&LocalPorts, common.LocalPortsVarName, "", []string{}, "Filter by local ports, seperate by ','") rootCmd.PersistentFlags().StringSliceVarP(&RemoteIps, common.RemoteIpsVarName, "", []string{}, "Filter by remote ips, seperate by ','") @@ -73,6 +81,19 @@ func init() { rootCmd.PersistentFlags().Int32Var(&ProtocolLogLevel, "protocol-log-level", 0, "specify protocol module log level individually") rootCmd.PersistentFlags().Int32Var(&UprobeLogLevel, "uprobe-log-level", 0, "specify uprobe module log level individually") + // container + rootCmd.PersistentFlags().StringVar(&ContainerId, "container-id", "", "Filter by container id (only TCP and UDP packets are supported)") + rootCmd.PersistentFlags().StringVar(&ContainerName, "container-name", "", "Filter by container name (only TCP and UDP packets are supported)") + rootCmd.PersistentFlags().StringVar(&PodName, "pod-name", "", "Filter by pod name (format: NAME.NAMESPACE, only TCP and UDP packets are supported)") + rootCmd.PersistentFlags().StringVar(&DockerEndpoint, "docker-address", "unix:///var/run/docker.sock", + `Address of Docker Engine service`) + rootCmd.PersistentFlags().StringVar(&ContainerdEndpoint, "containerd-address", "/run/containerd/containerd.sock", + `Address of containerd service`) + rootCmd.PersistentFlags().StringVar(&CriRuntimeEndpoint, "cri-runtime-address", "", + "Address of CRI container runtime service "+ + fmt.Sprintf("(default: uses in order the first successful one of [%s])", + strings.Join(getDefaultCriRuntimeEndpoint(), ", "))) + // internal rootCmd.PersistentFlags().IntVar(&BPFVerifyLogSize, "bpf-verify-log-size", 10*1024, "--bpf-verify-log-size 1024") rootCmd.PersistentFlags().IntVar(&KernEvtPerfEventBufferSize, "kern-perf-event-buffer-size", 1*1024*1024, "--kern-perf-event-buffer-size 1024") @@ -98,3 +119,11 @@ func Execute() { fmt.Println(err) } } + +func getDefaultCriRuntimeEndpoint() []string { + var rs []string + for _, end := range k8s.DefaultRuntimeEndpoints { + rs = append(rs, strings.TrimPrefix(end, "unix://")) + } + return rs +} diff --git a/cmd/stat.go b/cmd/stat.go index 2c3182cb..d62ebb29 100644 --- a/cmd/stat.go +++ b/cmd/stat.go @@ -2,8 +2,9 @@ package cmd import ( "fmt" - "kyanos/agent" "kyanos/agent/analysis" + anc "kyanos/agent/analysis/common" + ac "kyanos/agent/common" "slices" "github.com/spf13/cobra" @@ -39,7 +40,7 @@ sudo kyanos stat http --metrics tqp `, PersistentPreRun: func(cmd *cobra.Command, args []string) { Mode = AnalysisMode }, Run: func(cmd *cobra.Command, args []string) { - startAgent(agent.AgentOptions{LatencyFilter: initLatencyFilter(cmd), SizeFilter: initSizeFilter(cmd)}) + startAgent(ac.AgentOptions{LatencyFilter: initLatencyFilter(cmd), SizeFilter: initSizeFilter(cmd)}) }, } var enabledMetricsString string @@ -60,30 +61,30 @@ func validateEnabledMetricsString() error { return nil } -func createAnalysisOptions() (analysis.AnalysisOptions, error) { - options := analysis.AnalysisOptions{ - EnabledMetricTypeSet: make(analysis.MetricTypeSet), +func createAnalysisOptions() (anc.AnalysisOptions, error) { + options := anc.AnalysisOptions{ + EnabledMetricTypeSet: make(anc.MetricTypeSet), } err := validateEnabledMetricsString() if err != nil { logger.Errorln(err) - return analysis.AnalysisOptions{}, err + return anc.AnalysisOptions{}, err } enabledMetricsBytes := []byte(enabledMetricsString) if slices.Contains(enabledMetricsBytes, 't') { - options.EnabledMetricTypeSet[analysis.TotalDuration] = true + options.EnabledMetricTypeSet[anc.TotalDuration] = true } if slices.Contains(enabledMetricsBytes, 'q') { - options.EnabledMetricTypeSet[analysis.RequestSize] = true + options.EnabledMetricTypeSet[anc.RequestSize] = true } if slices.Contains(enabledMetricsBytes, 'p') { - options.EnabledMetricTypeSet[analysis.ResponseSize] = true + options.EnabledMetricTypeSet[anc.ResponseSize] = true } if slices.Contains(enabledMetricsBytes, 'n') || slices.Contains(enabledMetricsBytes, 'i') { - options.EnabledMetricTypeSet[analysis.BlackBoxDuration] = true + options.EnabledMetricTypeSet[anc.BlackBoxDuration] = true } if slices.Contains(enabledMetricsBytes, 's') { - options.EnabledMetricTypeSet[analysis.ReadFromSocketBufferDuration] = true + options.EnabledMetricTypeSet[anc.ReadFromSocketBufferDuration] = true } if sampleCount < 0 { sampleCount = 0 @@ -101,18 +102,18 @@ func createAnalysisOptions() (analysis.AnalysisOptions, error) { switch sortByPar { case "avg": - options.SortBy = analysis.Avg + options.SortBy = anc.Avg case "max": - options.SortBy = analysis.Max + options.SortBy = anc.Max case "p50": - options.SortBy = analysis.P50 + options.SortBy = anc.P50 case "P90": - options.SortBy = analysis.P90 + options.SortBy = anc.P90 case "P99": - options.SortBy = analysis.P99 + options.SortBy = anc.P99 default: logger.Warnf("unknown --sort-by flag: %s, use default '%s'", sortByPar, "avg") - options.SortBy = analysis.Avg + options.SortBy = anc.Avg } if fullBody { diff --git a/cmd/watch.go b/cmd/watch.go index ce754451..465f4808 100644 --- a/cmd/watch.go +++ b/cmd/watch.go @@ -2,7 +2,7 @@ package cmd import ( "fmt" - "kyanos/agent" + ac "kyanos/agent/common" "github.com/spf13/cobra" ) @@ -25,7 +25,7 @@ sudo kyanos watch mysql --latency 100 --req-size 1024 --resp-size 2048 if list { fmt.Println([]string{"http", "redis", "mysql"}) } else { - startAgent(agent.AgentOptions{LatencyFilter: initLatencyFilter(cmd), SizeFilter: initSizeFilter(cmd)}) + startAgent(ac.AgentOptions{LatencyFilter: initLatencyFilter(cmd), SizeFilter: initSizeFilter(cmd)}) } } }, diff --git a/common/constant.go b/common/constant.go index 6550eea7..3018d2d5 100644 --- a/common/constant.go +++ b/common/constant.go @@ -6,7 +6,7 @@ var LocalModeVarName string = "local-mode" // var VerboseVarName string = "verbose" var DaemonVarName string = "daemon" var LogDirVarName string = "log-dir" -var FilterPidVarName string = "pid" +var FilterPidVarName string = "pids" var RemotePortsVarName string = "remote-ports" var LocalPortsVarName string = "local-ports" var RemoteIpsVarName string = "remote-ips" diff --git a/common/log.go b/common/log.go index f4047973..7ff0c573 100644 --- a/common/log.go +++ b/common/log.go @@ -4,6 +4,7 @@ import "github.com/jefurry/logrus" var DefaultLog *logrus.Logger = logrus.New() var AgentLog *logrus.Logger = logrus.New() +var BPFLog *logrus.Logger = logrus.New() var BPFEventLog *logrus.Logger = logrus.New() var UprobeLog *logrus.Logger = logrus.New() diff --git a/common/namspace.go b/common/namspace.go new file mode 100644 index 00000000..b9f56eeb --- /dev/null +++ b/common/namspace.go @@ -0,0 +1,45 @@ +package common + +import ( + "fmt" + "os" + "strconv" + "strings" +) + +func GetPidNamespaceFromPid(pid int) int64 { + raw, err := os.Readlink(fmt.Sprintf("/proc/%d/ns/pid", pid)) + if err != nil { + return 0 + } + return getNamespaceId(raw) +} + +func GetMountNamespaceFromPid(pid int) int64 { + raw, err := os.Readlink(fmt.Sprintf("/proc/%d/ns/mnt", pid)) + if err != nil { + return 0 + } + return getNamespaceId(raw) +} + +func GetNetworkNamespaceFromPid(pid int) int64 { + raw, err := os.Readlink(fmt.Sprintf("/proc/%d/ns/net", pid)) + if err != nil { + return 0 + } + return getNamespaceId(raw) +} + +func getNamespaceId(raw string) int64 { + parts := strings.Split(raw, "[") + if len(parts) > 1 { + n := strings.Trim(parts[1], "[]") + id, err := strconv.ParseInt(n, 10, 64) + if err != nil { + return 0 + } + return id + } + return 0 +} diff --git a/common/net.go b/common/net.go new file mode 100644 index 00000000..da805dea --- /dev/null +++ b/common/net.go @@ -0,0 +1,101 @@ +package common + +import ( + "bufio" + "net" + "regexp" + "strconv" + "strings" + "sync" +) + +var ifIdxToName map[int]string = make(map[int]string) +var lock *sync.Mutex = &sync.Mutex{} + +func init() { + ifs, err := net.Interfaces() + if err == nil { + for _, each := range ifs { + ifIdxToName[each.Index] = each.Name + } + } +} + +func DeleteIfIdxToNameEntry(pid int) { + delete(ifIdxToName, pid) +} + +func GetInterfaceNameByIndex(index int, pid int) (string, error) { + exist, found := ifIdxToName[index] + if found { + return exist, nil + } + + netNs := GetNetworkNamespaceFromPid(pid) + var result string + + lock.Lock() + defer lock.Unlock() + if netNs == hostNetNs { + exist, found := ifIdxToName[index] + if found { + return exist, nil + } + interfc, err := net.InterfaceByIndex(index) + if err != nil { + result = "" + // return "", fmt.Errorf("GetInterfaceNameByIndex(%d) err: %v ", index, err) + } else { + result = interfc.Name + // ifIdxToName[interfc.Index] = interfc.Name + // return interfc.Name, nil + } + } else { + config := NsEnterConfig{ + Net: true, + Target: pid, + } + stdout, _, _ := config.Execute("sh", "-c", "ip a") + scanner := bufio.NewScanner(strings.NewReader(stdout)) + for scanner.Scan() { + line := scanner.Text() + if strings.TrimSpace(line) == "" || !strings.Contains(line, ":") { + continue + } + + parsedIndex, parsedName, ok := parseIpCmdLine(line) + if ok && index == parsedIndex { + result = parsedName + break + } + } + } + ifIdxToName[index] = result + return result, nil +} + +func parseIpCmdLine(line string) (int, string, bool) { + // 使用正则表达式匹配接口索引和接口名称 + // 假设接口索引是以数字开头,后面跟着冒号和接口名称 + re := regexp.MustCompile(`^(\d+):\s*([^:]+)`) + match := re.FindStringSubmatch(line) + if len(match) < 3 { + return 0, "", false // 没有匹配到 + } + + index, err := strconv.Atoi(match[1]) + if err != nil { + return 0, "", false // 转换索引失败 + } + + interfaceName := match[2] + return index, interfaceName, true // 成功提取 +} + +var ( + hostNetNs int64 +) + +func init() { + hostNetNs = GetNetworkNamespaceFromPid(1) +} diff --git a/common/nsenter.go b/common/nsenter.go new file mode 100644 index 00000000..ee274504 --- /dev/null +++ b/common/nsenter.go @@ -0,0 +1,162 @@ +package common + +import ( + "bytes" + "context" + "fmt" + "os/exec" + "strconv" +) + +// NsEnterConfig is the nsenter configuration used to generate +// nsenter command +type NsEnterConfig struct { + Cgroup bool // Enter cgroup namespace + CgroupFile string // Cgroup namespace location, default to /proc/PID/ns/cgroup + FollowContext bool // Set SELinux security context + GID int // GID to use to execute given program + IPC bool // Enter IPC namespace + IPCFile string // IPC namespace location, default to /proc/PID/ns/ipc + Mount bool // Enter mount namespace + MountFile string // Mount namespace location, default to /proc/PID/ns/mnt + Net bool // Enter network namespace + NetFile string // Network namespace location, default to /proc/PID/ns/net + NoFork bool // Do not fork before executing the specified program + PID bool // Enter PID namespace + PIDFile string // PID namespace location, default to /proc/PID/ns/pid + PreserveCredentials bool // Preserve current UID/GID when entering namespaces + RootDirectory string // Set the root directory, default to target process root directory + Target int // Target PID (required) + UID int // UID to use to execute given program + User bool // Enter user namespace + UserFile string // User namespace location, default to /proc/PID/ns/user + UTS bool // Enter UTS namespace + UTSFile string // UTS namespace location, default to /proc/PID/ns/uts + WorkingDirectory string // Set the working directory, default to target process working directory +} + +// Execute executs the givne command with a default background context +func (c *NsEnterConfig) Execute(program string, args ...string) (string, string, error) { + return c.ExecuteContext(context.Background(), program, args...) +} + +// ExecuteContext the given program using the given nsenter configuration and given context +// and return stdout/stderr or an error if command has failed +func (c *NsEnterConfig) ExecuteContext(ctx context.Context, program string, args ...string) (string, string, error) { + cmd, err := c.buildCommand(ctx) + if err != nil { + return "", "", fmt.Errorf("Error while building command: %v", err) + } + + // Prepare command + var stdout bytes.Buffer + var stderr bytes.Buffer + cmd.Stdout = &stdout + cmd.Stderr = &stderr + cmd.Args = append(cmd.Args, program) + cmd.Args = append(cmd.Args, args...) + + err = cmd.Run() + if err != nil { + return stdout.String(), stderr.String(), fmt.Errorf("Error while executing command: %v", err) + } + + return stdout.String(), stderr.String(), nil +} + +func (c *NsEnterConfig) buildCommand(ctx context.Context) (*exec.Cmd, error) { + if c.Target == 0 { + return nil, fmt.Errorf("Target must be specified") + } + + var args []string + args = append(args, "--target", strconv.Itoa(c.Target)) + + if c.Cgroup { + if c.CgroupFile != "" { + args = append(args, fmt.Sprintf("--cgroup=%s", c.CgroupFile)) + } else { + args = append(args, "--cgroup") + } + } + + if c.FollowContext { + args = append(args, "--follow-context") + } + + if c.GID != 0 { + args = append(args, "--setgid", strconv.Itoa(c.GID)) + } + + if c.IPC { + if c.IPCFile != "" { + args = append(args, fmt.Sprintf("--ip=%s", c.IPCFile)) + } else { + args = append(args, "--ipc") + } + } + + if c.Mount { + if c.MountFile != "" { + args = append(args, fmt.Sprintf("--mount=%s", c.MountFile)) + } else { + args = append(args, "--mount") + } + } + + if c.Net { + if c.NetFile != "" { + args = append(args, fmt.Sprintf("--net=%s", c.NetFile)) + } else { + args = append(args, "--net") + } + } + + if c.NoFork { + args = append(args, "--no-fork") + } + + if c.PID { + if c.PIDFile != "" { + args = append(args, fmt.Sprintf("--pid=%s", c.PIDFile)) + } else { + args = append(args, "--pid") + } + } + + if c.PreserveCredentials { + args = append(args, "--preserve-credentials") + } + + if c.RootDirectory != "" { + args = append(args, "--root", c.RootDirectory) + } + + if c.UID != 0 { + args = append(args, "--setuid", strconv.Itoa(c.UID)) + } + + if c.User { + if c.UserFile != "" { + args = append(args, fmt.Sprintf("--user=%s", c.UserFile)) + } else { + args = append(args, "--user") + } + } + + if c.UTS { + if c.UTSFile != "" { + args = append(args, fmt.Sprintf("--uts=%s", c.UTSFile)) + } else { + args = append(args, "--uts") + } + } + + if c.WorkingDirectory != "" { + args = append(args, "--wd", c.WorkingDirectory) + } + + cmd := exec.CommandContext(ctx, "nsenter", args...) + + return cmd, nil +} diff --git a/common/nsenter_test.go b/common/nsenter_test.go new file mode 100644 index 00000000..67f018b0 --- /dev/null +++ b/common/nsenter_test.go @@ -0,0 +1 @@ +package common_test diff --git a/common/utils.go b/common/utils.go index 0d518795..5f13b3c7 100644 --- a/common/utils.go +++ b/common/utils.go @@ -291,3 +291,13 @@ func CommonPrefix(str1, str2 string) string { return str1[:i] } + +func UnwrapErr(err error) error { + for { + if v := errors.Unwrap(err); v != nil { + err = v + } else { + return err + } + } +} diff --git a/go.mod b/go.mod index 1e088553..244ebc82 100644 --- a/go.mod +++ b/go.mod @@ -1,36 +1,86 @@ module kyanos -go 1.22 +go 1.22.0 toolchain go1.22.6 require ( github.com/cilium/ebpf v0.14.0 + github.com/containerd/containerd v1.7.22 + github.com/containerd/containerd/api v1.7.19 + github.com/containerd/errdefs v0.1.0 + github.com/containerd/typeurl/v2 v2.2.0 + github.com/docker/docker v26.1.5+incompatible github.com/emirpasic/gods v1.18.1 github.com/hashicorp/go-version v1.7.0 github.com/jefurry/logrus v2.0.6+incompatible github.com/sevlyar/go-daemon v0.1.6 github.com/shirou/gopsutil v3.21.11+incompatible - github.com/spf13/cobra v1.8.0 + github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 github.com/zcalusic/sysinfo v1.1.0 + k8s.io/cri-api v0.31.0 + k8s.io/kubernetes v1.24.17 ) require ( + github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect + github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/Microsoft/hcsshim v0.11.7 // indirect github.com/airbrake/gobrake v3.7.4+incompatible // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/blang/semver/v4 v4.0.0 // indirect github.com/caio/go-tdigest v3.1.0+incompatible // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/containerd/cgroups v1.1.0 // indirect + github.com/containerd/continuity v0.4.2 // indirect + github.com/containerd/fifo v1.1.0 // indirect + github.com/containerd/log v0.1.0 // indirect + github.com/containerd/platforms v0.2.1 // indirect + github.com/containerd/ttrpc v1.2.5 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/distribution/reference v0.6.0 // indirect + github.com/docker/go-connections v0.5.0 // indirect + github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect + github.com/docker/go-units v0.5.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect + github.com/klauspost/compress v1.17.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/moby/docker-image-spec v1.3.1 // indirect + github.com/moby/locker v1.0.1 // indirect + github.com/moby/sys/mountinfo v0.7.1 // indirect + github.com/moby/sys/sequential v0.5.0 // indirect + github.com/moby/sys/signal v0.7.0 // indirect + github.com/moby/sys/user v0.3.0 // indirect + github.com/moby/sys/userns v0.1.0 // indirect + github.com/morikuni/aec v1.0.0 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/image-spec v1.1.0 // indirect + github.com/opencontainers/runtime-spec v1.1.0 // indirect + github.com/opencontainers/selinux v1.11.0 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.19.1 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.6.0 // indirect @@ -38,13 +88,32 @@ require ( github.com/tklauser/go-sysconf v0.3.14 // indirect github.com/tklauser/numcpus v0.8.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.uber.org/atomic v1.9.0 // indirect - go.uber.org/multierr v1.9.0 // indirect - golang.org/x/crypto v0.16.0 // indirect - golang.org/x/term v0.15.0 // indirect - golang.org/x/text v0.14.0 // indirect + go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/term v0.24.0 // indirect + golang.org/x/text v0.18.0 // indirect + google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/grpc v1.66.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/v3 v3.5.1 // indirect + k8s.io/apimachinery v0.31.1 // indirect + k8s.io/apiserver v0.31.1 // indirect + k8s.io/component-base v0.31.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect ) require ( @@ -52,5 +121,10 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.18.2 golang.org/x/exp v0.0.0-20230905200255-921286631fa9 - golang.org/x/sys v0.19.0 + golang.org/x/sys v0.25.0 +) + +replace ( + k8s.io/apiserver => k8s.io/apiserver v0.24.17 + k8s.io/cri-api => k8s.io/kubernetes/staging/src/k8s.io/cri-api v0.0.0-20230824000246-2cb31c9333ad ) diff --git a/go.sum b/go.sum index 280743d5..3b4cdc61 100644 --- a/go.sum +++ b/go.sum @@ -1,28 +1,120 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= +github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 h1:59MxjQVfjXsBpLy+dbd2/ELV5ofnUkUZBvWSC85sheA= +github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0/go.mod h1:OahwfttHWG6eJ0clwcfBAHoDI6X/LV/15hx/wlMZSrU= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= +github.com/Microsoft/hcsshim v0.11.7 h1:vl/nj3Bar/CvJSYo7gIQPyRWc9f3c6IeSNavBTSZNZQ= +github.com/Microsoft/hcsshim v0.11.7/go.mod h1:MV8xMfmECjl5HdO7U/3/hFVnkmSBjAjmA09d4bExKcU= github.com/airbrake/gobrake v3.7.4+incompatible h1:NHbD3yqK+qQagH42V1ZkCb9yXAMLswxI2UkQpkqjVvw= github.com/airbrake/gobrake v3.7.4+incompatible/go.mod h1:wM4gu3Cn0W0K7GUuVWnlXZU11AGBXMILnrdOU8Kn00o= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/caio/go-tdigest v3.1.0+incompatible h1:uoVMJ3Q5lXmVLCCqaMGHLBWnbGoN6Lpu7OAUPR60cds= github.com/caio/go-tdigest v3.1.0+incompatible/go.mod h1:sHQM/ubZStBUmF1WbB8FAm8q9GjDajLC5T7ydxE3JHI= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cilium/ebpf v0.14.0 h1:0PsxAjO6EjI1rcT+rkp6WcCnE0ZvfkXBYiMedJtrSUs= github.com/cilium/ebpf v0.14.0/go.mod h1:DHp1WyrLeiBh19Cf/tfiSMhqheEiK8fXFZ4No0P1Hso= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= +github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= +github.com/containerd/containerd v1.7.22 h1:nZuNnNRA6T6jB975rx2RRNqqH2k6ELYKDZfqTHqwyy0= +github.com/containerd/containerd v1.7.22/go.mod h1:e3Jz1rYRUZ2Lt51YrH9Rz0zPyJBOlSvB3ghr2jbVD8g= +github.com/containerd/containerd/api v1.7.19 h1:VWbJL+8Ap4Ju2mx9c9qS1uFSB1OVYr5JJrW2yT5vFoA= +github.com/containerd/containerd/api v1.7.19/go.mod h1:fwGavl3LNwAV5ilJ0sbrABL44AQxmNjDRcwheXDb6Ig= +github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= +github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= +github.com/containerd/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM= +github.com/containerd/errdefs v0.1.0/go.mod h1:YgWiiHtLmSeBrvpw+UfPijzbLaB77mEG1WwJTDETIV0= +github.com/containerd/errdefs v0.2.0 h1:XllDESRfJtVrMwMmR2mCabxyvBK4UlbyyiWI3MvRw0o= +github.com/containerd/errdefs v0.2.0/go.mod h1:C28ixlj3dKhQS9hsQ13b+HIb4X7+s2G4FYhbSPcRDLM= +github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY= +github.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= +github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw= +github.com/containerd/ttrpc v1.2.5 h1:IFckT1EFQoFBMG4c3sMdT8EP3/aKfumK1msY+Ze4oLU= +github.com/containerd/ttrpc v1.2.5/go.mod h1:YCXHsb32f+Sq5/72xHubdiJRQY9inL4a4ZQrAbN1q9o= +github.com/containerd/typeurl/v2 v2.2.0 h1:6NBDbQzr7I5LHgp34xAXYF5DOTQDn05X58lsPEmzLso= +github.com/containerd/typeurl/v2 v2.2.0/go.mod h1:8XOOxnyatxSWuG8OfsZXVnAF4iZfedjS/8UHSPJnX4g= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/docker/docker v26.1.5+incompatible h1:NEAxTwEjxV6VbBMBoGG3zPqbiJosIApZjxlbrG9q3/g= +github.com/docker/docker v26.1.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= +github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= +github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= +github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -33,6 +125,10 @@ github.com/jefurry/logrus v2.0.6+incompatible h1:l+GsATm3Adk9fndg/2Vz74uaFnpGNNR github.com/jefurry/logrus v2.0.6+incompatible/go.mod h1:1MMHep0WOv0aG80OfeUdIephSwu95L2XxIsizUUM2b0= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= +github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -41,6 +137,34 @@ github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0V github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= +github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= +github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= +github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= +github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g= +github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= +github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= +github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= +github.com/moby/sys/signal v0.7.0 h1:25RW3d5TnQEoKvRbEKUGay6DCQ46IxAVTT9CUMgmsSI= +github.com/moby/sys/signal v0.7.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= +github.com/moby/sys/user v0.3.0 h1:9ni5DlcW5an3SvRSx4MouotOygvzaXbaSrc/wGDFWPo= +github.com/moby/sys/user v0.3.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs= +github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g= +github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= +github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= +github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= +github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU= +github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec= github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -48,8 +172,17 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= @@ -59,14 +192,16 @@ github.com/sevlyar/go-daemon v0.1.6 h1:EUh1MDjEM4BI109Jign0EaknA2izkOyi0LV3ro3QQ github.com/sevlyar/go-daemon v0.1.6/go.mod h1:6dJpPatBT9eUwM5VCw9Bt6CdX9Tk6UWvhW3MebLDRKE= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= @@ -74,9 +209,10 @@ github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMV github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -86,30 +222,149 @@ github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZ github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY= github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYgY= github.com/tklauser/numcpus v0.8.0/go.mod h1:ZJZlAY+dmR4eut8epnzf0u/VwodKmryxR8txiloSqBE= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zcalusic/sysinfo v1.1.0 h1:79Hqn8h4poVz6T57/4ezXbT5ZkZbZm7u1YU1C4paMyk= github.com/zcalusic/sysinfo v1.1.0/go.mod h1:NX+qYnWGtJVPV0yWldff9uppNKU4h40hJIRPf/pGLv4= -go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 h1:ZIg3ZT/aQ7AfKqdwp7ECpOK6vHqquXXuyTjIO8ZdmPs= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0/go.mod h1:DQAwmETtZV00skUwgD6+0U89g80NKsJE3DCKeLLPQMI= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/otlp v0.20.0 h1:PTNgq9MRmQqqJY0REVbZFvwkYOA85vbdQU/nVfxDyqg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 h1:lsInsfvhVIfOI6qHVyysXMNDnjO9Npvl7tlDPJFBVd4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0/go.mod h1:KQsVNh4OjgjTG0G6EiNi1jVpnaeeKsKMRwbLN+f1+8M= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0 h1:umZgi92IyxfXd/l4kaDhnKgY8rnN/cZcF1LKc6I8OQ8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0/go.mod h1:4lVs6obhSVRb1EW5FhOuBTyiQhtRtAnnva9vD3yRfq8= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= +go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= +go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 h1:1hfbdAfFbkmpg41000wDVqr7jUpK/Yo+LPnIxxGzmkg= +google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3/go.mod h1:5RBcpGRxr25RbDzY5w+dmaqpSEvl8Gwl1x2CICf60ic= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.66.1 h1:hO5qAXR19+/Z44hmvIM4dQFMSYX9XcWsByfoxutBpAM= +google.golang.org/grpc v1.66.1/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U= +k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apiserver v0.24.17 h1:APbTxPHcOXkorGZXUtA8esA938W9choQA9z9NUDmqm4= +k8s.io/apiserver v0.24.17/go.mod h1:qr6HYxuodmqma+f4f2ck1lahy3bgJQ+8A17YPJKiJNg= +k8s.io/component-base v0.31.1 h1:UpOepcrX3rQ3ab5NB6g5iP0tvsgJWzxTyAo20sgYSy8= +k8s.io/component-base v0.31.1/go.mod h1:WGeaw7t/kTsqpVTaCoVEtillbqAhF2/JgvO0LDOMa0w= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kubernetes v1.24.17 h1:+4+5VIoxcDv35PnVELouMdDC58AQF/sWs+hjjr4Ra44= +k8s.io/kubernetes v1.24.17/go.mod h1:LJ66K8sMVLCol0l5oJlWPaj59qXgWCCYZIaHHPm+5s8= +k8s.io/kubernetes/staging/src/k8s.io/cri-api v0.0.0-20230824000246-2cb31c9333ad h1:V1kbcqWsidxP+X9aGWhQT7hG3TUoMVOTTthzUzD7odQ= +k8s.io/kubernetes/staging/src/k8s.io/cri-api v0.0.0-20230824000246-2cb31c9333ad/go.mod h1:92B+ezOsw1+IWrnyKuKTKb9ioXD7xacrEml1MI6lv2I= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=