diff mbox series

[RFC,bpf-next,4/4] bpftool: Documentation for bpftool prog profile

Message ID 20200213210115.1455809-5-songliubraving@fb.com
State RFC
Delegated to: BPF Maintainers
Headers show
Series bpftool: introduce prog profile | expand

Commit Message

Song Liu Feb. 13, 2020, 9:01 p.m. UTC
Add documentation for the new bpftool prog profile command.

Signed-off-by: Song Liu <songliubraving@fb.com>
---
 .../bpf/bpftool/Documentation/bpftool-prog.rst  | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
diff mbox series

Patch

diff --git a/tools/bpf/bpftool/Documentation/bpftool-prog.rst b/tools/bpf/bpftool/Documentation/bpftool-prog.rst
index 64ddf8a4c518..22ff0df327a1 100644
--- a/tools/bpf/bpftool/Documentation/bpftool-prog.rst
+++ b/tools/bpf/bpftool/Documentation/bpftool-prog.rst
@@ -30,6 +30,7 @@  PROG COMMANDS
 |	**bpftool** **prog detach** *PROG* *ATTACH_TYPE* [*MAP*]
 |	**bpftool** **prog tracelog**
 |	**bpftool** **prog run** *PROG* **data_in** *FILE* [**data_out** *FILE* [**data_size_out** *L*]] [**ctx_in** *FILE* [**ctx_out** *FILE* [**ctx_size_out** *M*]]] [**repeat** *N*]
+|	**bpftool** **prog profile** *DURATION* *PROG* *METRICs*
 |	**bpftool** **prog help**
 |
 |	*MAP* := { **id** *MAP_ID* | **pinned** *FILE* }
@@ -47,6 +48,9 @@  PROG COMMANDS
 |       *ATTACH_TYPE* := {
 |		**msg_verdict** | **stream_verdict** | **stream_parser** | **flow_dissector**
 |	}
+|	*METRIC* := {
+|		**cycles** | **instructions** | **l1d_loads** | **llc_misses**
+|	}
 
 
 DESCRIPTION
@@ -188,6 +192,10 @@  DESCRIPTION
 		  not all of them can take the **ctx_in**/**ctx_out**
 		  arguments. bpftool does not perform checks on program types.
 
+	**bpftool prog profile** *DURATION* *PROG* *METRICs*
+		  Profile *METRICs* for bpf program *PROG* for *DURATION*
+		  seconds.
+
 	**bpftool prog help**
 		  Print short help message.
 
@@ -310,6 +318,15 @@  EXAMPLES
 
 **# rm /sys/fs/bpf/xdp1**
 
+|
+| **# bpftool prog profile 20 id 810 cycles instructions**
+
+::
+    cycles: duration 20 run_cnt 1368 miss_cnt 665
+            counter 503377 enabled 668202 running 351857
+    instructions: duration 20 run_cnt 1368 miss_cnt 707
+	    counter 398625 enabled 502330 running 272014
+
 SEE ALSO
 ========
 	**bpf**\ (2),