Re: [PATCH bpf-next 2/2] tools, bpftool: Define attach_type_name array only once

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

[...]



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux