From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: netdev@vger.kernel.org, alexei.starovoitov@gmail.com,
daniel@iogearbox.net
Cc: oss-drivers@netronome.com, guro@fb.com,
Jakub Kicinski <jakub.kicinski@netronome.com>
Subject: [PATCH bpf-next 1/3] tools: bpftool: rename cgroup list -> show in the code
Date: Tue, 2 Jan 2018 14:48:35 -0800 [thread overview]
Message-ID: <20180102224837.13736-2-jakub.kicinski@netronome.com> (raw)
In-Reply-To: <20180102224837.13736-1-jakub.kicinski@netronome.com>
So far we have used "show" as a keyword for listing
programs and maps. Use the word "show" in the code
for cgroups too, next commit will alias show and list.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
---
tools/bpf/bpftool/cgroup.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/tools/bpf/bpftool/cgroup.c b/tools/bpf/bpftool/cgroup.c
index 34ca303d72bc..24091d87bee3 100644
--- a/tools/bpf/bpftool/cgroup.c
+++ b/tools/bpf/bpftool/cgroup.c
@@ -41,7 +41,7 @@ static enum bpf_attach_type parse_attach_type(const char *str)
return __MAX_BPF_ATTACH_TYPE;
}
-static int list_bpf_prog(int id, const char *attach_type_str,
+static int show_bpf_prog(int id, const char *attach_type_str,
const char *attach_flags_str)
{
struct bpf_prog_info info = {};
@@ -77,7 +77,7 @@ static int list_bpf_prog(int id, const char *attach_type_str,
return 0;
}
-static int list_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type)
+static int show_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type)
{
__u32 prog_ids[1024] = {0};
char *attach_flags_str;
@@ -111,23 +111,23 @@ static int list_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type)
}
for (iter = 0; iter < prog_cnt; iter++)
- list_bpf_prog(prog_ids[iter], attach_type_strings[type],
+ show_bpf_prog(prog_ids[iter], attach_type_strings[type],
attach_flags_str);
return 0;
}
-static int do_list(int argc, char **argv)
+static int do_show(int argc, char **argv)
{
enum bpf_attach_type type;
int cgroup_fd;
int ret = -1;
if (argc < 1) {
- p_err("too few parameters for cgroup list\n");
+ p_err("too few parameters for cgroup show\n");
goto exit;
} else if (argc > 1) {
- p_err("too many parameters for cgroup list\n");
+ p_err("too many parameters for cgroup show\n");
goto exit;
}
@@ -147,10 +147,10 @@ static int do_list(int argc, char **argv)
/*
* Not all attach types may be supported, so it's expected,
* that some requests will fail.
- * If we were able to get the list for at least one
+ * If we were able to get the show for at least one
* attach type, let's return 0.
*/
- if (list_attached_bpf_progs(cgroup_fd, type) == 0)
+ if (show_attached_bpf_progs(cgroup_fd, type) == 0)
ret = 0;
}
@@ -294,7 +294,7 @@ static int do_help(int argc, char **argv)
}
static const struct cmd cmds[] = {
- { "list", do_list },
+ { "list", do_show },
{ "attach", do_attach },
{ "detach", do_detach },
{ "help", do_help },
--
2.15.1
next prev parent reply other threads:[~2018-01-02 22:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-02 22:48 [PATCH bpf-next 0/3] tools: bpftool: alias "show" and "list" and fix errors in JSON Jakub Kicinski
2018-01-02 22:48 ` Jakub Kicinski [this message]
2018-01-02 22:48 ` [PATCH bpf-next 2/3] tools: bpftool: alias show and list commands Jakub Kicinski
2018-01-02 22:48 ` [PATCH bpf-next 3/3] tools: bpftool: remove new lines from errors Jakub Kicinski
2018-01-04 11:31 ` [PATCH bpf-next 0/3] tools: bpftool: alias "show" and "list" and fix errors in JSON Daniel Borkmann
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=20180102224837.13736-2-jakub.kicinski@netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=alexei.starovoitov@gmail.com \
--cc=daniel@iogearbox.net \
--cc=guro@fb.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.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