blob: 57fc4b9924ea681b7fe32934f7f654409703273b [file] [log] [blame]
Jakub Kicinskiff69c212017-10-04 20:10:05 -07001================
2bpftool-prog
3================
4-------------------------------------------------------------------------------
5tool for inspection and simple manipulation of eBPF progs
6-------------------------------------------------------------------------------
7
8:Manual section: 8
9
10SYNOPSIS
11========
12
13| **bpftool** prog show [*PROG*]
14| **bpftool** prog dump xlated *PROG* file *FILE*
15| **bpftool** prog dump jited *PROG* [file *FILE*] [opcodes]
16| **bpftool** prog pin *PROG* *FILE*
17| **bpftool** prog help
18|
19| *PROG* := { id *PROG_ID* | pinned *FILE* | tag *PROG_TAG* }
20
21DESCRIPTION
22===========
23 **bpftool prog show** [*PROG*]
24 Show information about loaded programs. If *PROG* is
25 specified show information only about given program, otherwise
26 list all programs currently loaded on the system.
27
28 Output will start with program ID followed by program type and
29 zero or more named attributes (depending on kernel version).
30
31 **bpftool prog dump xlated** *PROG* **file** *FILE*
32 Dump eBPF instructions of the program from the kernel to a
33 file.
34
35 **bpftool prog dump jited** *PROG* [**file** *FILE*] [**opcodes**]
36 Dump jited image (host machine code) of the program.
37 If *FILE* is specified image will be written to a file,
38 otherwise it will be disassembled and printed to stdout.
39
40 **opcodes** controls if raw opcodes will be printed.
41
42 **bpftool prog pin** *PROG* *FILE*
43 Pin program *PROG* as *FILE*.
44
45 Note: *FILE* must be located in *bpffs* mount.
46
47 **bpftool prog help**
48 Print short help message.
49
50EXAMPLES
51========
52**# bpftool prog show**
53::
54
55 10: xdp name some_prog tag 00:5a:3d:21:23:62:0c:8b
56 loaded_at Sep 29/20:11 uid 0
57 xlated 528B jited 370B memlock 4096B map_ids 10
58
59|
60| **# bpftool prog dump xlated id 10 file /tmp/t**
61| **# ls -l /tmp/t**
62| -rw------- 1 root root 560 Jul 22 01:42 /tmp/t
63
64|
65| **# bpftool prog dum jited pinned /sys/fs/bpf/prog**
66
67::
68
69 push %rbp
70 mov %rsp,%rbp
71 sub $0x228,%rsp
72 sub $0x28,%rbp
73 mov %rbx,0x0(%rbp)
74
75
76
77SEE ALSO
78========
79 **bpftool**\ (8), **bpftool-map**\ (8)