INNER CODE UNIT · Go

parseFlags

inspektor-gadget/inspektor-gadget · cmd/gpu-ebpf-bridge/main.go:55

func parseFlags(args []string) (options, error) {
	fs := flag.NewFlagSet("gpu-ebpf-bridge", flag.ContinueOnError)
	var opt options
	fs.StringVar(&opt.mode, "mode", "auto",
		"Telemetry source: auto (try real, fall back to mock), real, mock")
	fs.DurationVar(&opt.pollInterval, "poll-interval", 100*time.Millisecond,
		"How often to poll the telemetry source")
	fs.StringVar(&opt.pinDir, "pin-dir", maps.DefaultPinDir,
		"bpffs directory under which to pin the maps")
	fs.BoolVar(&opt.keepPins, "keep-pins", false,
		"On clean shutdown, leave the pinned maps in place (default: unpin)")
	fs.StringVar(&opt.logLevel, "log-level", "info",
		"Logger level: debug, info, warn, error")
	fs.BoolVar(&opt.showVersion, "version", false, "Print version and exit")
	fs.BoolVar(&opt.dump, "dump", false,
		"Read the bpffs-pinned bridge maps and print their contents, then exit. "+
			"Useful as a bpftool-free debugging aid; does not start the poller.")
	fs.StringVar(&opt.hostPath, "host-path", "",

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…