func NewTCMonitor(event *model.DeviceEvent) *base.Monitor {
	monitor := base.Monitor{
		Name:    model.MonitorName(fmt.Sprintf("TCMonitor_%s", event.DeviceName)),
		Ifindex: event.Device.Ifindex,
	}
	// Set up classic ingress and egress classifiers for veth pair
	if event.Device.PeerIfindex != 0 {
		// For a veth pair device, Egress and Ingress are inverted from what you
		// would expect.
		monitor.Probes = []*base.Probe{
			&base.Probe{
				Name:        fmt.Sprintf("SchedIngress_%s", event.DeviceName),
				Enabled:     true,
				Type:        ebpf.SchedCLS,
				SectionName: "classifier/ingress_cls",
				QdiscParent: tc.Egress,
				PerfMaps:    []*base.PerfMap{},
			},
			&base.Probe{
				Name:        fmt.Sprintf("SchedEgress_%s", event.DeviceName),
				Enabled:     true,
				Type:        ebpf.SchedCLS,
				SectionName: "classifier/egress_cls",
				QdiscParent: tc.Ingress,
				PerfMaps:    []*base.PerfMap{},
			},
		}
	} else {
		monitor.Probes = []*base.Probe{
			&base.Probe{
				Name:        fmt.Sprintf("SchedExtIngress_%s", event.DeviceName),
				Enabled:     true,
				Type:        ebpf.SchedCLS,
				SectionName: "classifier/ingress_ext_cls",
				QdiscParent: tc.Ingress,
				PerfMaps:    []*base.PerfMap{},
			},
			&base.Probe{
				Name:        fmt.Sprintf("SchedExtEgress_%s", event.DeviceName),
				Enabled:     true,
				Type:        ebpf.SchedCLS,
				SectionName: "classifier/egress_ext_cls",
				QdiscParent: tc.Egress,
				PerfMaps:    []*base.PerfMap{},
			},
		}
	}
	return &monitor
}
// NewTCMonitor - Returns a new TC monitor for the provided network device
Returns a new TC monitor for the provided network device
// NewTCMonitor - Returns a new TC monitor for the provided network device
func NewTCMonitor(event *model.DeviceEvent) *base.Monitor {
	monitor := base.Monitor{
		Name:    model.MonitorName(fmt.Sprintf("TCMonitor_%s", event.DeviceName)),
		Ifindex: event.Device.Ifindex,
	}
	if event.Device.PeerIfindex != 0 {
		monitor.Probes = []*base.Probe{
			&base.Probe{
				Name:        fmt.Sprintf("SchedIngress_%s", event.DeviceName),
				Enabled:     true,
				Type:        ebpf.SchedCLS,
				SectionName: "classifier/ingress_cls",
				QdiscParent: tc.Egress,
				PerfMaps:    []*base.PerfMap{},
			},
			&base.Probe{
				Name:        fmt.Sprintf("SchedEgress_%s", event.DeviceName),
				Enabled:     true,
				Type:        ebpf.SchedCLS,
				SectionName: "classifier/egress_cls",
				QdiscParent: tc.Ingress,
				PerfMaps:    []*base.PerfMap{},
			},
		}
	} else {
		monitor.Probes = []*base.Probe{
			&base.Probe{
				Name:        fmt.Sprintf("SchedExtIngress_%s", event.DeviceName),
				Enabled:     true,
				Type:        ebpf.SchedCLS,
				SectionName: "classifier/ingress_ext_cls",
				QdiscParent: tc.Ingress,
				PerfMaps:    []*base.PerfMap{},
			},
			&base.Probe{
				Name:        fmt.Sprintf("SchedExtEgress_%s", event.DeviceName),
				Enabled:     true,
				Type:        ebpf.SchedCLS,
				SectionName: "classifier/egress_ext_cls",
				QdiscParent: tc.Egress,
				PerfMaps:    []*base.PerfMap{},
			},
		}
	}
	return &monitor
}
func NewTCMonitor ( event * model . DeviceEvent ) * base . Monitor { monitor := base . Monitor { Name : model . MonitorName ( fmt . Sprintf ( " " , event . DeviceName ) ) , Ifindex : event . Device . Ifindex , } if event . Device . PeerIfindex != 0 { monitor . Probes = [ ] * base . Probe { & base . Probe { Name : fmt . Sprintf ( " " , event . DeviceName ) , Enabled : true , Type : ebpf . SchedCLS , SectionName : " " , QdiscParent : tc . Egress , PerfMaps : [ ] * base . PerfMap { } , } , & base . Probe { Name : fmt . Sprintf ( " " , event . DeviceName ) , Enabled : true , Type : ebpf . SchedCLS , SectionName : " " , QdiscParent : tc . Ingress , PerfMaps : [ ] * base . PerfMap { } , } , } } else { monitor . Probes = [ ] * base . Probe { & base . Probe { Name : fmt . Sprintf ( " " , event . DeviceName ) , Enabled : true , Type : ebpf . SchedCLS , SectionName : " " , QdiscParent : tc . Ingress , PerfMaps : [ ] * base . PerfMap { } , } , & base . Probe { Name : fmt . Sprintf ( " " , event . DeviceName ) , Enabled : true , Type : ebpf . SchedCLS , SectionName : " " , QdiscParent : tc . Egress , PerfMaps : [ ] * base . PerfMap { } , } , } } return & monitor }
Returns a new TC monitor for the provided network device
Returns a new TC monitor for the provided network device
// Set up classic ingress and egress classifiers for veth pair // For a veth pair device, Egress and Ingress are inverted from what you // would expect.