From: Alan Maguire <alan.maguire@oracle.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: ast@kernel.org, andrii@kernel.org, daniel@iogearbox.net,
nathan@kernel.org, nicolas@fjasle.eu, martin.lau@linux.dev,
eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev,
john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com,
haoluo@google.com, jolsa@kernel.org, bpf@vger.kernel.org,
linux-kbuild@vger.kernel.org, asmadeus@codewreck.org
Subject: Re: [PATCH bpf-next] kbuild, bpf: reproducible BTF from pahole when KBUILD_BUILD_TIMESTAMP set
Date: Tue, 2 Jul 2024 10:49:10 +0100 [thread overview]
Message-ID: <21ec0d92-fb99-41b3-b1b9-3b8a4504271c@oracle.com> (raw)
In-Reply-To: <CAK7LNAStVrAx8LjDiYogRvS16-dZ+LrwcWq8gHnTbvKvR_JFFA@mail.gmail.com>
On 02/07/2024 08:58, Masahiro Yamada wrote:
> On Tue, Jul 2, 2024 at 2:32 AM Alan Maguire <alan.maguire@oracle.com> wrote:
>>
>> Reproducible builds [1] require that the same source code with
>> the same set of tools can build identical objects each time,
>> but pahole in parallel mode was non-deterministic in
>> BTF generation prior to
>>
>> dba7b5e ("pahole: Encode BTF serially in a reproducible build")
>>
>> This was a problem since said BTF is baked into kernels and modules in
>> .BTF sections, so parallel pahole was causing non-reproducible binary
>> generation. Now with the above commit we have support for parallel
>> reproducible BTF generation in pahole.
>>
>> KBUILD_BUILD_TIMESTAMP is set for reproducible builds, so if it
>> is set, add reproducible_build to --btf_features.
>>
>> [1] Documentation/kbuild/reproducible-builds.rst
>>
>> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
>
>
>
>
> Does not make sense.
>
>
>
> KBUILD_BUILD_TIMESTAMP is not a switch for
> "please enable the reproducible build".
>
>
> KBUILD_BUILD_TIMESTAMP requires the build code
> to use the given time in the output where timestamps are used.
>
> Your patch does not use the timestamp at all.
>
No, and that's not the intention. It is used as a signal to pahole to
enable reproducibility in parallel build. There is a cost to this so
it's not advisable in all scenarios [1]. Is there a kbuild-approved way
to determine if reproducible builds are in operation?
Alan
[1]
https://lore.kernel.org/dwarves/20240412211604.789632-12-acme@kernel.org/
>
> If --btf_features=reproducible_build has no downside,
> please add it whenever supported.
>
>
>
>
>
>
>
>> ---
>> scripts/Makefile.btf | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/scripts/Makefile.btf b/scripts/Makefile.btf
>> index b75f09f3f424..40bb72662967 100644
>> --- a/scripts/Makefile.btf
>> +++ b/scripts/Makefile.btf
>> @@ -21,6 +21,10 @@ else
>> # Switch to using --btf_features for v1.26 and later.
>> pahole-flags-$(call test-ge, $(pahole-ver), 126) = -j --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func,decl_tag_kfuncs
>>
>> +ifneq ($(KBUILD_BUILD_TIMESTAMP),)
>> +pahole-flags-$(call test-ge, $(pahole-ver), 126) += --btf_features=reproducible_build
>> +endif
>> +
>> ifneq ($(KBUILD_EXTMOD),)
>> module-pahole-flags-$(call test-ge, $(pahole-ver), 126) += --btf_features=distilled_base
>> endif
>> --
>> 2.31.1
>>
>
>
next prev parent reply other threads:[~2024-07-02 9:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-01 17:31 [PATCH bpf-next] kbuild, bpf: reproducible BTF from pahole when KBUILD_BUILD_TIMESTAMP set Alan Maguire
2024-07-01 23:07 ` Jiri Olsa
2024-07-02 7:58 ` Masahiro Yamada
2024-07-02 8:20 ` asmadeus
2024-07-02 9:49 ` Alan Maguire [this message]
2024-07-15 11:19 ` Masahiro Yamada
2024-07-20 12:12 ` asmadeus
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=21ec0d92-fb99-41b3-b1b9-3b8a4504271c@oracle.com \
--to=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--cc=asmadeus@codewreck.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=nicolas@fjasle.eu \
--cc=sdf@google.com \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox