All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Tobias Klauser <tklauser@distanz.ch>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andriin@fb.com>,
	Quentin Monnet <quentin@isovalent.com>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next 2/2] tools, bpftool: Define attach_type_name array only once
Date: Mon, 22 Jun 2020 22:58:15 -0700	[thread overview]
Message-ID: <CAEf4Bzau9o_0bAUmnjxCLODAMuReR+Vg3ZzV1=zg8k_-wvWi3w@mail.gmail.com> (raw)
In-Reply-To: <20200622140007.4922-3-tklauser@distanz.ch>

On Mon, Jun 22, 2020 at 7:00 AM Tobias Klauser <tklauser@distanz.ch> 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@distanz.ch>
> ---
>  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.

[...]

      reply	other threads:[~2020-06-23  5:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 14:00 [PATCH bpf-next 0/2] tools, bpftool: Define name arrays only once Tobias Klauser
2020-06-22 14:00 ` [PATCH bpf-next 1/2] tools, bpftool: Define prog_type_name array " Tobias Klauser
2020-06-22 14:26   ` Quentin Monnet
2020-06-22 15:05     ` Tobias Klauser
2020-06-22 15:17       ` Quentin Monnet
2020-06-23  9:58         ` Tobias Klauser
2020-06-22 14:00 ` [PATCH bpf-next 2/2] tools, bpftool: Define attach_type_name " Tobias Klauser
2020-06-23  5:58   ` Andrii Nakryiko [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='CAEf4Bzau9o_0bAUmnjxCLODAMuReR+Vg3ZzV1=zg8k_-wvWi3w@mail.gmail.com' \
    --to=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=quentin@isovalent.com \
    --cc=tklauser@distanz.ch \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.