Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asphaltt/bpfbak
bpfbak is a tiny tool to backup bpf objects under bpffs. Apache 2.0 License
https://github.com/asphaltt/bpfbak
bpfbak bpffs ebpf
Last synced: about 1 month ago
JSON representation
bpfbak is a tiny tool to backup bpf objects under bpffs. Apache 2.0 License
- Host: GitHub
- URL: https://github.com/asphaltt/bpfbak
- Owner: Asphaltt
- License: apache-2.0
- Created: 2024-05-19T14:04:33.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-05-19T16:29:51.000Z (7 months ago)
- Last Synced: 2024-11-20T01:17:15.719Z (about 1 month ago)
- Topics: bpfbak, bpffs, ebpf
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bpfbak: a tiny tool to backup bpf objects under bpffs
Currently, bpffs does not support `cp` pinned bpf objects. This tool is a workaround to backup pinned bpf objects under bpffs.
## Usage
`bpfbak` can be used as a library:
```shell
opts := bpfbak.BackupOpts{
Src: rootFlags.src,
UnpinSrc: rootFlags.srcUnpin,
Dst: rootFlags.dst,
AutoMountBpffs: rootFlags.autoMount,
BpffsPath: rootFlags.mountBpffs,
}
err := bpfbak.Backup(opts)
if err != nil {
log.Fatalf("Failed to backup bpf object: %v", err)
}
```Or as a command line tool:
```shell
$ ./bpfbak -h
bpfbak is a tool to backup eBPF objectsUsage:
bpfbak [flags]Flags:
--auto-mount automatically mount bpffs at the destination directory or --mount-bpffs
-d, --dst string destination filepath to backup the bpf object
-h, --help help for bpfbak
--mount-bpffs string path to the directory where bpffs is mounted
-s, --src string source bpf object to be backed up
--unpin-src unpin the source bpf object after backing up
```## License
Licensed under the Apache License, Version 2.0.