aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2018-01-02 17:48:35 -0500
committerDaniel Borkmann <daniel@iogearbox.net>2018-01-04 06:28:46 -0500
commit65b875bcc816335be41c336a595adbc10bd885cb (patch)
tree3f927b1841638a1b8f0f92f51614e467e93f42b7
parent5620e1a8e2e6f96bdb72abfd68a56ce8cb94dd4d (diff)
tools: bpftool: rename cgroup list -> show in the code
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> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rw-r--r--tools/bpf/bpftool/cgroup.c18
1 files 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)
41 return __MAX_BPF_ATTACH_TYPE; 41 return __MAX_BPF_ATTACH_TYPE;
42} 42}
43 43
44static int list_bpf_prog(int id, const char *attach_type_str, 44static int show_bpf_prog(int id, const char *attach_type_str,
45 const char *attach_flags_str) 45 const char *attach_flags_str)
46{ 46{
47 struct bpf_prog_info info = {}; 47 struct bpf_prog_info info = {};
@@ -77,7 +77,7 @@ static int list_bpf_prog(int id, const char *attach_type_str,
77 return 0; 77 return 0;
78} 78}
79 79
80static int list_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type) 80static int show_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type)
81{ 81{
82 __u32 prog_ids[1024] = {0}; 82 __u32 prog_ids[1024] = {0};
83 char *attach_flags_str; 83 char *attach_flags_str;
@@ -111,23 +111,23 @@ static int list_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type)
111 } 111 }
112 112
113 for (iter = 0; iter < prog_cnt; iter++) 113 for (iter = 0; iter < prog_cnt; iter++)
114 list_bpf_prog(prog_ids[iter], attach_type_strings[type], 114 show_bpf_prog(prog_ids[iter], attach_type_strings[type],
115 attach_flags_str); 115 attach_flags_str);
116 116
117 return 0; 117 return 0;
118} 118}
119 119
120static int do_list(int argc, char **argv) 120static int do_show(int argc, char **argv)
121{ 121{
122 enum bpf_attach_type type; 122 enum bpf_attach_type type;
123 int cgroup_fd; 123 int cgroup_fd;
124 int ret = -1; 124 int ret = -1;
125 125
126 if (argc < 1) { 126 if (argc < 1) {
127 p_err("too few parameters for cgroup list\n"); 127 p_err("too few parameters for cgroup show\n");
128 goto exit; 128 goto exit;
129 } else if (argc > 1) { 129 } else if (argc > 1) {
130 p_err("too many parameters for cgroup list\n"); 130 p_err("too many parameters for cgroup show\n");
131 goto exit; 131 goto exit;
132 } 132 }
133 133
@@ -147,10 +147,10 @@ static int do_list(int argc, char **argv)
147 /* 147 /*
148 * Not all attach types may be supported, so it's expected, 148 * Not all attach types may be supported, so it's expected,
149 * that some requests will fail. 149 * that some requests will fail.
150 * If we were able to get the list for at least one 150 * If we were able to get the show for at least one
151 * attach type, let's return 0. 151 * attach type, let's return 0.
152 */ 152 */
153 if (list_attached_bpf_progs(cgroup_fd, type) == 0) 153 if (show_attached_bpf_progs(cgroup_fd, type) == 0)
154 ret = 0; 154 ret = 0;
155 } 155 }
156 156
@@ -294,7 +294,7 @@ static int do_help(int argc, char **argv)
294} 294}
295 295
296static const struct cmd cmds[] = { 296static const struct cmd cmds[] = {
297 { "list", do_list }, 297 { "list", do_show },
298 { "attach", do_attach }, 298 { "attach", do_attach },
299 { "detach", do_detach }, 299 { "detach", do_detach },
300 { "help", do_help }, 300 { "help", do_help },