---
name: "bpftool-struct_ops"
section: "8"
platform: "linux"
package: "bpf"
version: "7.3.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/bpftool-struct_ops"
---

# bpftool-struct\_ops(8)

tool to register/unregister/introspect BPF struct\_ops

## Name

bpftool-struct\_ops - tool to register/unregister/introspect BPF struct\_ops

## SYNOPSIS

**bpftool** \[*OPTIONS*\] **struct\_ops** *COMMAND*

*OPTIONS* := { { **-j** \| **--json** } \[{ **-p** \| **--pretty** }\] \| { **-d** \| **--debug** } }

*COMMANDS* := { **show** \| **list** \| **dump** \| **register** \| **unregister** \| **help** }

## STRUCT\_OPS COMMANDS

```
bpftool struct_ops { show | list } [STRUCT_OPS_MAP]
bpftool struct_ops dump [STRUCT_OPS_MAP]
bpftool struct_ops register OBJ [LINK_DIR]
bpftool struct_ops unregister STRUCT_OPS_MAP
bpftool struct_ops help
STRUCT_OPS_MAP := { id STRUCT_OPS_MAP_ID | name STRUCT_OPS_MAP_NAME }
OBJ := /a/file/of/bpf_struct_ops.o
```

## DESCRIPTION

- **bpftool struct\_ops { show \| list } \[*STRUCT\_OPS\_MAP*\]**

  Show brief information about the struct\_ops in the system. If *STRUCT\_OPS\_MAP* is specified, it shows information only for the given struct\_ops.  Otherwise, it lists all struct\_ops currently existing in the system.

  Output will start with struct\_ops map ID, followed by its map name and its struct\_ops's kernel type.

- **bpftool struct\_ops dump \[*STRUCT\_OPS\_MAP*\]**

  Dump details information about the struct\_ops in the system. If *STRUCT\_OPS\_MAP* is specified, it dumps information only for the given struct\_ops.  Otherwise, it dumps all struct\_ops currently existing in the system.

- **bpftool struct\_ops register *OBJ* \[*LINK\_DIR*\]**

  Register bpf struct\_ops from *OBJ*.  All struct\_ops under the ELF section ".struct\_ops" and ".struct\_ops.link" will be registered to its kernel subsystem.  For each struct\_ops in the ".struct\_ops.link" section, a link will be created.  You can give *LINK\_DIR* to provide a directory path where these links will be pinned with the same name as their corresponding map name.

- **bpftool struct\_ops unregister *STRUCT\_OPS\_MAP***

  Unregister the *STRUCT\_OPS\_MAP* from the kernel subsystem.

- **bpftool struct\_ops help**

  Print short help message.

## OPTIONS

- **-h, --help**

  Print short help message (similar to **bpftool help**).

- **-V, --version**

  Print bpftool's version number (similar to **bpftool version**), the number of the libbpf version in use, and optional features that were included when bpftool was compiled. Optional features include linking against LLVM or libbfd to provide the disassembler for JIT-ted programs (**bpftool prog** **dump jited**) and usage of BPF skeletons (some features like **bpftool prog** **profile** or showing pids associated to BPF objects may rely on it).

- **-j, --json**

  Generate JSON output. For commands that cannot produce JSON, this option has no effect.

- **-p, --pretty**

  Generate human-readable JSON output. Implies **-j**.

- **-d, --debug**

  Print all logs available, even debug-level information. This includes logs from libbpf as well as from the verifier, when attempting to load programs.

## EXAMPLES

**# bpftool struct\_ops show**

```
100: dctcp           tcp_congestion_ops
105: cubic           tcp_congestion_ops
```

**# bpftool struct\_ops unregister id 105**

```
Unregistered tcp_congestion_ops cubic id 105
```

**# bpftool struct\_ops register bpf\_cubic.o**

```
Registered tcp_congestion_ops cubic id 110
```

## SEE ALSO

[**bpf**(2)](/bpf/2.md), [**bpf-helpers**(7)](/bpf-helpers/7.md), [**bpftool**(8)](/bpftool/8.md), [**bpftool-btf**(8)](/bpftool-btf/8.md), [**bpftool-cgroup**(8)](/bpftool-cgroup/8.md), [**bpftool-feature**(8)](/bpftool-feature/8.md), [**bpftool-gen**(8)](/bpftool-gen/8.md), [**bpftool-iter**(8)](/bpftool-iter/8.md), [**bpftool-link**(8)](/bpftool-link/8.md), [**bpftool-map**(8)](/bpftool-map/8.md), [**bpftool-net**(8)](/bpftool-net/8.md), [**bpftool-perf**(8)](/bpftool-perf/8.md), [**bpftool-prog**(8)](/bpftool-prog/8.md), [**bpftool-token**(8)](/bpftool-token/8.md)
