On Mon, Jun 22, 2020 at 7:00 AM Tobias Klauser <tklauser@xxxxxxxxxx> wrote: > > Follow the same approach as for map_type_name and prog_type_name. This > leads to a slight decrease in the binary size of bpftool. > > Before: > > text data bss dec hex filename > 399024 11168 1573160 1983352 1e4378 bpftool > > After: > > text data bss dec hex filename > 398256 10880 1573160 1982296 1e3f58 bpftool > > Signed-off-by: Tobias Klauser <tklauser@xxxxxxxxxx> > --- > tools/bpf/bpftool/cgroup.c | 36 ++++++++++++++++++++++++++++++++++++ > tools/bpf/bpftool/main.h | 36 +----------------------------------- > 2 files changed, 37 insertions(+), 35 deletions(-) > > diff --git a/tools/bpf/bpftool/cgroup.c b/tools/bpf/bpftool/cgroup.c > index d901cc1b904a..542050a4f071 100644 > --- a/tools/bpf/bpftool/cgroup.c > +++ b/tools/bpf/bpftool/cgroup.c > @@ -30,6 +30,42 @@ > " sendmsg6 | recvmsg4 | recvmsg6 |\n" \ > " sysctl | getsockopt | setsockopt }" > > +const char * const attach_type_name[__MAX_BPF_ATTACH_TYPE] = { Let's move it into common.c instead. It's not really cgroup-specific. [...]