[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200902054132.y3p3spqt6vzxiy2t@ast-mbp.dhcp.thefacebook.com>
Date: Tue, 1 Sep 2020 22:41:32 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Andrii Nakryiko <andriin@...com>
Cc: bpf@...r.kernel.org, netdev@...r.kernel.org, ast@...com,
daniel@...earbox.net, andrii.nakryiko@...il.com, kernel-team@...com
Subject: Re: [PATCH v2 bpf-next 07/14] selftests/bpf: add selftest for
multi-prog sections and bpf-to-bpf calls
On Mon, Aug 31, 2020 at 06:49:56PM -0700, Andrii Nakryiko wrote:
> +
> +__noinline int sub1(int x)
> +{
> + return x + 1;
> +}
> +
> +static __noinline int sub5(int v);
> +
> +__noinline int sub2(int y)
> +{
> + return sub5(y + 2);
> +}
> +
> +static __noinline int sub3(int z)
> +{
> + return z + 3 + sub1(4);
> +}
> +
> +static __noinline int sub4(int w)
> +{
> + return w + sub3(5) + sub1(6);
Did you check that asm has these calls?
Since sub3 is static the compiler doesn't have to do the call.
'static noinline' doesn't mean that compiler have to do the call.
It can compute the value and replace a call with a constant.
It only has to keep the body of the function if the address of it
was taken.
Powered by blists - more mailing lists