~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/bpf/bpftool/Documentation/bpftool-link.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/bpf/bpftool/Documentation/bpftool-link.rst (Architecture mips) and /tools/bpf/bpftool/Documentation/bpftool-link.rst (Architecture sparc)


  1 .. SPDX-License-Identifier: (GPL-2.0-only OR B      1 .. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2                                                     2 
  3 ================                                    3 ================
  4 bpftool-link                                        4 bpftool-link
  5 ================                                    5 ================
  6 ----------------------------------------------      6 -------------------------------------------------------------------------------
  7 tool for inspection and simple manipulation of      7 tool for inspection and simple manipulation of eBPF links
  8 ----------------------------------------------      8 -------------------------------------------------------------------------------
  9                                                     9 
 10 :Manual section: 8                                 10 :Manual section: 8
 11                                                    11 
 12 .. include:: substitutions.rst                     12 .. include:: substitutions.rst
 13                                                    13 
 14 SYNOPSIS                                           14 SYNOPSIS
 15 ========                                           15 ========
 16                                                    16 
 17 **bpftool** [*OPTIONS*] **link** *COMMAND*         17 **bpftool** [*OPTIONS*] **link** *COMMAND*
 18                                                    18 
 19 *OPTIONS* := { |COMMON_OPTIONS| | { **-f** | *     19 *OPTIONS* := { |COMMON_OPTIONS| | { **-f** | **--bpffs** } | { **-n** | **--nomount** } }
 20                                                    20 
 21 *COMMANDS* := { **show** | **list** | **pin**      21 *COMMANDS* := { **show** | **list** | **pin** | **help** }
 22                                                    22 
 23 LINK COMMANDS                                      23 LINK COMMANDS
 24 =============                                      24 =============
 25                                                    25 
 26 | **bpftool** **link { show | list }** [*LINK*     26 | **bpftool** **link { show | list }** [*LINK*]
 27 | **bpftool** **link pin** *LINK* *FILE*           27 | **bpftool** **link pin** *LINK* *FILE*
 28 | **bpftool** **link detach** *LINK*               28 | **bpftool** **link detach** *LINK*
 29 | **bpftool** **link help**                        29 | **bpftool** **link help**
 30 |                                                  30 |
 31 | *LINK* := { **id** *LINK_ID* | **pinned** *F     31 | *LINK* := { **id** *LINK_ID* | **pinned** *FILE* }
 32                                                    32 
 33                                                    33 
 34 DESCRIPTION                                        34 DESCRIPTION
 35 ===========                                        35 ===========
 36 bpftool link { show | list } [*LINK*]              36 bpftool link { show | list } [*LINK*]
 37     Show information about active links. If *L     37     Show information about active links. If *LINK* is specified show
 38     information only about given link, otherwi     38     information only about given link, otherwise list all links currently
 39     active on the system.                          39     active on the system.
 40                                                    40 
 41     Output will start with link ID followed by     41     Output will start with link ID followed by link type and zero or more named
 42     attributes, some of which depend on type o     42     attributes, some of which depend on type of link.
 43                                                    43 
 44     Since Linux 5.8 bpftool is able to discove     44     Since Linux 5.8 bpftool is able to discover information about processes
 45     that hold open file descriptors (FDs) agai     45     that hold open file descriptors (FDs) against BPF links. On such kernels
 46     bpftool will automatically emit this infor     46     bpftool will automatically emit this information as well.
 47                                                    47 
 48 bpftool link pin *LINK* *FILE*                     48 bpftool link pin *LINK* *FILE*
 49     Pin link *LINK* as *FILE*.                     49     Pin link *LINK* as *FILE*.
 50                                                    50 
 51     Note: *FILE* must be located in *bpffs* mo     51     Note: *FILE* must be located in *bpffs* mount. It must not contain a dot
 52     character ('.'), which is reserved for fut     52     character ('.'), which is reserved for future extensions of *bpffs*.
 53                                                    53 
 54 bpftool link detach *LINK*                         54 bpftool link detach *LINK*
 55     Force-detach link *LINK*. BPF link and its     55     Force-detach link *LINK*. BPF link and its underlying BPF program will stay
 56     valid, but they will be detached from the      56     valid, but they will be detached from the respective BPF hook and BPF link
 57     will transition into a defunct state until     57     will transition into a defunct state until last open file descriptor for
 58     that link is closed.                           58     that link is closed.
 59                                                    59 
 60 bpftool link help                                  60 bpftool link help
 61     Print short help message.                      61     Print short help message.
 62                                                    62 
 63 OPTIONS                                            63 OPTIONS
 64 =======                                            64 =======
 65     .. include:: common_options.rst                65     .. include:: common_options.rst
 66                                                    66 
 67     -f, --bpffs                                    67     -f, --bpffs
 68         When showing BPF links, show file name     68         When showing BPF links, show file names of pinned links.
 69                                                    69 
 70     -n, --nomount                                  70     -n, --nomount
 71         Do not automatically attempt to mount      71         Do not automatically attempt to mount any virtual file system (such as
 72         tracefs or BPF virtual file system) wh     72         tracefs or BPF virtual file system) when necessary.
 73                                                    73 
 74 EXAMPLES                                           74 EXAMPLES
 75 ========                                           75 ========
 76 **# bpftool link show**                            76 **# bpftool link show**
 77                                                    77 
 78 ::                                                 78 ::
 79                                                    79 
 80     10: cgroup  prog 25                            80     10: cgroup  prog 25
 81             cgroup_id 614  attach_type egress      81             cgroup_id 614  attach_type egress
 82             pids test_progs(223)                   82             pids test_progs(223)
 83                                                    83 
 84 **# bpftool --json --pretty link show**            84 **# bpftool --json --pretty link show**
 85                                                    85 
 86 ::                                                 86 ::
 87                                                    87 
 88     [{                                             88     [{
 89             "type": "cgroup",                      89             "type": "cgroup",
 90             "prog_id": 25,                         90             "prog_id": 25,
 91             "cgroup_id": 614,                      91             "cgroup_id": 614,
 92             "attach_type": "egress",               92             "attach_type": "egress",
 93             "pids": [{                             93             "pids": [{
 94                     "pid": 223,                    94                     "pid": 223,
 95                     "comm": "test_progs"           95                     "comm": "test_progs"
 96                 }                                  96                 }
 97             ]                                      97             ]
 98         }                                          98         }
 99     ]                                              99     ]
100                                                   100 
101 |                                                 101 |
102 | **# bpftool link pin id 10 /sys/fs/bpf/link*    102 | **# bpftool link pin id 10 /sys/fs/bpf/link**
103 | **# ls -l /sys/fs/bpf/**                        103 | **# ls -l /sys/fs/bpf/**
104                                                   104 
105 ::                                                105 ::
106                                                   106 
107     -rw------- 1 root root 0 Apr 23 21:39 link    107     -rw------- 1 root root 0 Apr 23 21:39 link
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php