netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Quentin Monnet <quentin.monnet@netronome.com>
To: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>
Cc: netdev@vger.kernel.org, oss-drivers@netronome.com,
	Quentin Monnet <quentin.monnet@netronome.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jesper Dangaard Brouer <brouer@redhat.com>,
	Stanislav Fomichev <sdf@google.com>
Subject: [RFC bpf-next v3 9/9] tools: bpftool: add bash completion for bpftool probes
Date: Thu,  3 Jan 2019 14:02:39 +0000	[thread overview]
Message-ID: <20190103140239.23548-10-quentin.monnet@netronome.com> (raw)
In-Reply-To: <20190103140239.23548-1-quentin.monnet@netronome.com>

Add the bash completion related to the newly introduced "bpftool feature
probe" command.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
 tools/bpf/bpftool/bash-completion/bpftool | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/tools/bpf/bpftool/bash-completion/bpftool b/tools/bpf/bpftool/bash-completion/bpftool
index e4e4fab1b8c7..21d5295936ed 100644
--- a/tools/bpf/bpftool/bash-completion/bpftool
+++ b/tools/bpf/bpftool/bash-completion/bpftool
@@ -624,6 +624,25 @@ _bpftool()
                     ;;
             esac
             ;;
+        feature)
+            case $command in
+                probe)
+                    [[ $prev == "dev" ]] && _sysfs_get_netdevs && return 0
+                    [[ $prev == "prefix" ]] && return 0
+                    if _bpftool_search_list 'macros'; then
+                        COMPREPLY+=( $( compgen -W 'prefix' -- "$cur" ) )
+                    else
+                        COMPREPLY+=( $( compgen -W 'macros' -- "$cur" ) )
+                    fi
+                    _bpftool_one_of_list 'kernel dev'
+                    return 0
+                    ;;
+                *)
+                    [[ $prev == $object ]] && \
+                        COMPREPLY=( $( compgen -W 'help probe' -- "$cur" ) )
+                    ;;
+            esac
+            ;;
     esac
 } &&
 complete -F _bpftool bpftool
-- 
2.17.1

      parent reply	other threads:[~2019-01-03 14:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-03 14:02 [RFC bpf-next v3 0/9] tools: bpftool: add probes for system and device Quentin Monnet
2019-01-03 14:02 ` [RFC bpf-next v3 1/9] tools: bpftool: add basic probe capability, probe syscall availability Quentin Monnet
2019-01-03 14:02 ` [RFC bpf-next v3 2/9] tools: bpftool: add probes for /proc/ eBPF parameters Quentin Monnet
2019-01-04  6:32   ` Y Song
2019-01-04 14:22     ` Quentin Monnet
2019-01-03 14:02 ` [RFC bpf-next v3 3/9] tools: bpftool: add probes for kernel configuration options Quentin Monnet
2019-01-04  6:35   ` Y Song
2019-01-04 14:27     ` Quentin Monnet
2019-01-04 17:36       ` Y Song
2019-01-05 13:16         ` Quentin Monnet
2019-01-03 14:02 ` [RFC bpf-next v3 4/9] tools: bpftool: add probes for eBPF program types Quentin Monnet
2019-01-03 14:02 ` [RFC bpf-next v3 5/9] tools: bpftool: add probes for eBPF map types Quentin Monnet
2019-01-03 14:02 ` [RFC bpf-next v3 6/9] tools: bpftool: add probes for eBPF helper functions Quentin Monnet
2019-01-03 17:15   ` Stanislav Fomichev
2019-01-03 17:26     ` Quentin Monnet
2019-01-03 14:02 ` [RFC bpf-next v3 7/9] tools: bpftool: add C-style "#define" output for probes Quentin Monnet
2019-01-03 14:02 ` [RFC bpf-next v3 8/9] tools: bpftool: add probes for a network device Quentin Monnet
2019-01-03 14:02 ` Quentin Monnet [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190103140239.23548-10-quentin.monnet@netronome.com \
    --to=quentin.monnet@netronome.com \
    --cc=acme@kernel.org \
    --cc=ast@kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=sdf@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).