Skip to content

Instantly share code, notes, and snippets.

@calavera
Last active June 5, 2019 14:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calavera/292d30a153a01bde10d4cd58544a6c10 to your computer and use it in GitHub Desktop.
Save calavera/292d30a153a01bde10d4cd58544a6c10 to your computer and use it in GitHub Desktop.
# We need to create a hash map.
# We'll attach that map to a program later.
map create /sys/fs/bpf/hash_map type hash key 4 value 8 entries 10 name hash_map
# List all maps in the system,
# so I can verify that the new map is there.
map show
# Load a program and attach the new map to it.
prog load bpf_prog.o /sys/fs/bpf/bpf_prog map name hash_map /sys/fs/bpf/hash_map
# List all programs in the system,
# so I can verify that the new program is there.
prog show
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment