aquasecurity / btfhub

BTFhub, in collaboration with the BTFhub Archive repository, supplies BTF files for all published kernels that lack native support for embedded BTF. This joint effort ensures that even kernels without built-in BTF support can effectively leverage the benefits of eBPF programs, promoting compatibility across various kernel versions.
Apache License 2.0
387 stars 45 forks source link

Reproducible BTF tarballs #98

Closed brycekahle closed 11 months ago

brycekahle commented 1 year ago

I believe that if you removed a BTF .tar.xz file and re-ran the script, you would get a different output. The actual BTF should be the same, but because tar is preserving mtime, users, and possible other data, the .tar.xz file will always be different.

I can see two potential avenues to explore:

  1. Extract a datetime from the package repo to use as the mtime for the BTF file itself
  2. Force the same datetime for all files. This StackOverflow answer talks about a way to do that.

WDYT?

brycekahle commented 1 year ago

For context, I think this is valuable so we can re-run the script on the archive when things change, such as pahole arguments, and only update what actually changes.

rafaeldtinoco commented 1 year ago

Sorry has been some busy last weeks. I wonder if the BTF ids coming from pahole won't be random. From libbpf, the BTF ids are created as the types are added to the "BTF" object.

I believe pahole has this process parallelized which would cause the IDs to, maybe, be different from one run to another.

brycekahle commented 1 year ago

We aren't using -j, so it isn't an issue: https://github.com/acmel/dwarves/issues/42