samples: bpf: Count syscalls in xdpsock
authorCiara Loftus <ciara.loftus@intel.com>
Fri, 2 Oct 2020 13:36:11 +0000 (13:36 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 6 Oct 2020 18:46:50 +0000 (11:46 -0700)
commit60dc609dbd545226e00c9e7b518d0f4873f0a3e1
tree04b5c415865aee21ad2152cd5149447481bde582
parent2e8806f032f5d9d5c59b790c73b83842bda78f23
samples: bpf: Count syscalls in xdpsock

Categorise and record syscalls issued in the xdpsock sample app. The
categories recorded are:

  rx_empty_polls:    polls when the rx ring is empty
  fill_fail_polls:   polls when failed to get addr from fill ring
  copy_tx_sendtos:   sendtos issued for tx when copy mode enabled
  tx_wakeup_sendtos: sendtos issued when tx ring needs waking up
  opt_polls:         polls issued since the '-p' flag is set

Print the stats using '-a' on the xdpsock command line.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20201002133612.31536-2-ciara.loftus@intel.com
samples/bpf/xdpsock_user.c