[PATCH 00/10] Add build and target hash for test results
Gedare Bloom
gedare at rtems.org
Wed Feb 24 18:35:41 UTC 2021
On Wed, Feb 24, 2021 at 11:22 AM Gedare Bloom <gedare at rtems.org> wrote:
>
> On Wed, Feb 24, 2021 at 6:57 AM Sebastian Huber
> <sebastian.huber at embedded-brains.de> wrote:
> >
> > This patch set adds the new directives rtems_get_build_hash() and
> > rtems_get_target_hash() which can be used to differentiate test suite
> > results. See also the following discussion:
> >
> > https://lists.rtems.org/pipermail/devel/2020-November/063226.html
> >
> > Sebastian Huber (10):
> > build: Generate build hash
> > rtems: Add rtems_get_build_hash()
> > libtest: Report build hash
> > score: Add _IO_Base64url()
> > score: Add Hash Handler
> > rtems: Add rtems_get_target_hash()
> > Add system initialization step for target hash
> > bsps: Add default rtems_get_target_hash()
> > libtest: Report target hash
> > libtest: Print SHA256 hash in base64url
> >
>
> Is there a good reason to use SHA256 over a lighter weight algorithm?
> I guess I wonder about the overhead and value of using it.
>
> We don't need cryptographic security here, we just need a reasonably
> non-colliding checksum. The speed of hashing will matter for running
> testsuites.
>
Other than the choice of sha256, the patch set looks fine to me.
I would suggest PJW (ElfHash) or FNV hashes. PJW is nice for in-target
computation because it is just shift, AND, add without a table lookup.
FNV also has no table, but uses multiply.
https://en.wikipedia.org/wiki/PJW_hash_function
I don't know maybe there is a simple comparison of runtimes out there
for non-crypto hashes.
> > bsps/shared/start/gettargethash-default.c | 70 ++++++++
> > .../libbsp/arm/altera-cyclone-v/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/atsam/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/beagle/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/csb336/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/csb337/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/edb7312/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/gumstix/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/imx/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/lm3s69xx/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/lpc176x/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/lpc24xx/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/lpc32xx/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/raspberrypi/Makefile.am | 1 +
> > .../libbsp/arm/realview-pbx-a9/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/rtl22xx/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/smdk2410/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/stm32f4/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/tms570/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/xen/Makefile.am | 1 +
> > c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am | 1 +
> > .../lib/libbsp/arm/xilinx-zynqmp/Makefile.am | 1 +
> > c/src/lib/libbsp/bfin/TLL6527M/Makefile.am | 1 +
> > c/src/lib/libbsp/bfin/bf537Stamp/Makefile.am | 1 +
> > c/src/lib/libbsp/bfin/eZKit533/Makefile.am | 1 +
> > c/src/lib/libbsp/i386/pc386/Makefile.am | 1 +
> > c/src/lib/libbsp/lm32/lm32_evr/Makefile.am | 1 +
> > c/src/lib/libbsp/lm32/milkymist/Makefile.am | 1 +
> > c/src/lib/libbsp/m68k/av5282/Makefile.am | 1 +
> > c/src/lib/libbsp/m68k/csb360/Makefile.am | 1 +
> > c/src/lib/libbsp/m68k/gen68340/Makefile.am | 1 +
> > c/src/lib/libbsp/m68k/gen68360/Makefile.am | 1 +
> > c/src/lib/libbsp/m68k/genmcf548x/Makefile.am | 1 +
> > .../lib/libbsp/m68k/mcf5206elite/Makefile.am | 1 +
> > c/src/lib/libbsp/m68k/mcf52235/Makefile.am | 1 +
> > c/src/lib/libbsp/m68k/mcf5225x/Makefile.am | 1 +
> > c/src/lib/libbsp/m68k/mcf5235/Makefile.am | 1 +
> > c/src/lib/libbsp/m68k/mcf5329/Makefile.am | 1 +
> > c/src/lib/libbsp/m68k/mrm332/Makefile.am | 1 +
> > c/src/lib/libbsp/m68k/mvme147/Makefile.am | 1 +
> > c/src/lib/libbsp/m68k/mvme147s/Makefile.am | 1 +
> > c/src/lib/libbsp/m68k/mvme162/Makefile.am | 1 +
> > c/src/lib/libbsp/m68k/mvme167/Makefile.am | 1 +
> > c/src/lib/libbsp/m68k/uC5282/Makefile.am | 1 +
> > c/src/lib/libbsp/mips/csb350/Makefile.am | 1 +
> > c/src/lib/libbsp/mips/hurricane/Makefile.am | 1 +
> > c/src/lib/libbsp/mips/jmr3904/Makefile.am | 1 +
> > c/src/lib/libbsp/mips/malta/Makefile.am | 1 +
> > c/src/lib/libbsp/mips/rbtx4925/Makefile.am | 1 +
> > c/src/lib/libbsp/mips/rbtx4938/Makefile.am | 1 +
> > c/src/lib/libbsp/moxie/moxiesim/Makefile.am | 1 +
> > c/src/lib/libbsp/nios2/nios2_iss/Makefile.am | 1 +
> > c/src/lib/libbsp/no_cpu/no_bsp/Makefile.am | 1 +
> > .../lib/libbsp/or1k/generic_or1k/Makefile.am | 1 +
> > c/src/lib/libbsp/powerpc/beatnik/Makefile.am | 1 +
> > c/src/lib/libbsp/powerpc/gen5200/Makefile.am | 1 +
> > c/src/lib/libbsp/powerpc/gen83xx/Makefile.am | 1 +
> > .../lib/libbsp/powerpc/haleakala/Makefile.am | 1 +
> > .../powerpc/motorola_powerpc/Makefile.am | 1 +
> > .../lib/libbsp/powerpc/mpc55xxevb/Makefile.am | 1 +
> > .../lib/libbsp/powerpc/mpc8260ads/Makefile.am | 1 +
> > c/src/lib/libbsp/powerpc/mvme3100/Makefile.am | 1 +
> > c/src/lib/libbsp/powerpc/mvme5500/Makefile.am | 1 +
> > c/src/lib/libbsp/powerpc/psim/Makefile.am | 1 +
> > c/src/lib/libbsp/powerpc/qemuppc/Makefile.am | 1 +
> > c/src/lib/libbsp/powerpc/qoriq/Makefile.am | 1 +
> > c/src/lib/libbsp/powerpc/ss555/Makefile.am | 1 +
> > c/src/lib/libbsp/powerpc/t32mppc/Makefile.am | 1 +
> > c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am | 1 +
> > c/src/lib/libbsp/powerpc/virtex/Makefile.am | 1 +
> > c/src/lib/libbsp/powerpc/virtex4/Makefile.am | 1 +
> > c/src/lib/libbsp/powerpc/virtex5/Makefile.am | 1 +
> > c/src/lib/libbsp/riscv/griscv/Makefile.am | 1 +
> > c/src/lib/libbsp/riscv/riscv/Makefile.am | 1 +
> > c/src/lib/libbsp/sh/gensh1/Makefile.am | 1 +
> > c/src/lib/libbsp/sh/gensh2/Makefile.am | 1 +
> > c/src/lib/libbsp/sh/gensh4/Makefile.am | 1 +
> > c/src/lib/libbsp/sh/shsim/Makefile.am | 1 +
> > c/src/lib/libbsp/sparc/erc32/Makefile.am | 1 +
> > c/src/lib/libbsp/sparc/leon2/Makefile.am | 1 +
> > c/src/lib/libbsp/sparc/leon3/Makefile.am | 1 +
> > c/src/lib/libbsp/sparc64/niagara/Makefile.am | 1 +
> > c/src/lib/libbsp/sparc64/usiii/Makefile.am | 1 +
> > c/src/lib/libbsp/v850/gdbv850sim/Makefile.am | 1 +
> > c/src/lib/libbsp/x86_64/amd64/Makefile.am | 1 +
> > cpukit/Makefile.am | 1 +
> > cpukit/include/rtems/config.h | 69 ++++++-
> > cpukit/include/rtems/score/hash.h | 168 ++++++++++++++++++
> > cpukit/include/rtems/score/io.h | 51 +++++-
> > cpukit/include/rtems/sysinit.h | 1 +
> > cpukit/libtest/t-test-hash-sha256.c | 13 +-
> > cpukit/libtest/t-test.c | 2 +
> > cpukit/sapi/src/getbuildhash.c | 54 ++++++
> > cpukit/sapi/src/sysinitverbose.c | 10 +-
> > cpukit/score/src/hash.c | 76 ++++++++
> > cpukit/score/src/iobase64.c | 56 ++++--
> > spec/build/bsps/aarch64/a53/obj.yml | 1 +
> > spec/build/bsps/aarch64/xilinx-zynqmp/obj.yml | 1 +
> > .../altera-cyclone-v/bspalteracyclonev.yml | 1 +
> > spec/build/bsps/arm/atsam/bspatsam.yml | 1 +
> > spec/build/bsps/arm/beagle/obj.yml | 1 +
> > spec/build/bsps/arm/csb336/bspcsb336.yml | 1 +
> > spec/build/bsps/arm/csb337/obj.yml | 1 +
> > spec/build/bsps/arm/edb7312/bspedb7312.yml | 1 +
> > spec/build/bsps/arm/fvp/obj.yml | 1 +
> > spec/build/bsps/arm/gumstix/bspgumstix.yml | 1 +
> > spec/build/bsps/arm/imx/bspimx.yml | 1 +
> > spec/build/bsps/arm/imxrt/bspimxrt.yml | 1 +
> > spec/build/bsps/arm/lm3s69xx/obj.yml | 1 +
> > spec/build/bsps/arm/lpc176x/obj.yml | 1 +
> > spec/build/bsps/arm/lpc24xx/obj.yml | 1 +
> > spec/build/bsps/arm/lpc32xx/obj.yml | 1 +
> > spec/build/bsps/arm/raspberrypi/obj.yml | 1 +
> > .../arm/realview-pbx-a9/bsprealviewpbxa9.yml | 1 +
> > spec/build/bsps/arm/rtl22xx/obj.yml | 1 +
> > spec/build/bsps/arm/smdk2410/bspsmdk2410.yml | 1 +
> > spec/build/bsps/arm/stm32f4/obj.yml | 1 +
> > spec/build/bsps/arm/stm32h7/bspstm32h7.yml | 1 +
> > spec/build/bsps/arm/tms570/obj.yml | 1 +
> > spec/build/bsps/arm/xen/bspxen.yml | 1 +
> > spec/build/bsps/arm/xilinx-zynq/obj.yml | 1 +
> > .../arm/xilinx-zynqmp/bspxilinxzynqmp.yml | 1 +
> > spec/build/bsps/bfin/TLL6527M/bsptll6527m.yml | 1 +
> > .../bsps/bfin/bf537Stamp/bspbf537stamp.yml | 1 +
> > spec/build/bsps/bfin/eZKit533/bspezkit533.yml | 1 +
> > spec/build/bsps/i386/pc386/obj.yml | 1 +
> > spec/build/bsps/lm32/lm32_evr/obj.yml | 1 +
> > .../bsps/lm32/milkymist/bspmilkymist.yml | 1 +
> > spec/build/bsps/m68k/av5282/bspav5282.yml | 1 +
> > spec/build/bsps/m68k/csb360/bspcsb360.yml | 1 +
> > spec/build/bsps/m68k/gen68340/bspgen68340.yml | 1 +
> > spec/build/bsps/m68k/gen68360/obj.yml | 1 +
> > spec/build/bsps/m68k/genmcf548x/obj.yml | 1 +
> > .../m68k/mcf5206elite/bspmcf5206elite.yml | 1 +
> > spec/build/bsps/m68k/mcf52235/bspmcf52235.yml | 1 +
> > spec/build/bsps/m68k/mcf52235/tstmcf52235.yml | 1 +
> > spec/build/bsps/m68k/mcf5225x/bspmcf5225x.yml | 1 +
> > spec/build/bsps/m68k/mcf5235/bspmcf5235.yml | 1 +
> > spec/build/bsps/m68k/mcf5329/bspmcf5329.yml | 1 +
> > spec/build/bsps/m68k/mrm332/bspmrm332.yml | 1 +
> > spec/build/bsps/m68k/mvme147/bspmvme147.yml | 1 +
> > spec/build/bsps/m68k/mvme147s/bspmvme147s.yml | 1 +
> > spec/build/bsps/m68k/mvme162/obj.yml | 1 +
> > spec/build/bsps/m68k/mvme167/bspmvme167.yml | 1 +
> > spec/build/bsps/m68k/uC5282/bspuc5282.yml | 1 +
> > spec/build/bsps/mips/csb350/bspcsb350.yml | 1 +
> > .../bsps/mips/hurricane/bsphurricane.yml | 1 +
> > spec/build/bsps/mips/jmr3904/bspjmr3904.yml | 1 +
> > spec/build/bsps/mips/malta/bspmalta.yml | 1 +
> > spec/build/bsps/mips/rbtx4925/bsprbtx4925.yml | 1 +
> > spec/build/bsps/mips/rbtx4938/bsprbtx4938.yml | 1 +
> > .../build/bsps/moxie/moxiesim/bspmoxiesim.yml | 1 +
> > .../bsps/nios2/nios2_iss/bspnios2iss.yml | 1 +
> > .../bsps/or1k/generic_or1k/bspgenericor1k.yml | 1 +
> > .../build/bsps/powerpc/beatnik/bspbeatnik.yml | 1 +
> > spec/build/bsps/powerpc/gen5200/obj.yml | 1 +
> > spec/build/bsps/powerpc/gen83xx/obj.yml | 1 +
> > .../bsps/powerpc/haleakala/bsphaleakala.yml | 1 +
> > .../bsps/powerpc/motorola_powerpc/obj.yml | 1 +
> > spec/build/bsps/powerpc/mpc55xxevb/obj.yml | 1 +
> > .../bsps/powerpc/mpc8260ads/bspmpc8260ads.yml | 1 +
> > .../bsps/powerpc/mvme3100/bspmvme3100.yml | 1 +
> > .../bsps/powerpc/mvme5500/bspmvme5500.yml | 1 +
> > spec/build/bsps/powerpc/psim/bsppsim.yml | 1 +
> > .../build/bsps/powerpc/qemuppc/bspqemuppc.yml | 1 +
> > spec/build/bsps/powerpc/qoriq/obj.yml | 1 +
> > spec/build/bsps/powerpc/ss555/bspss555.yml | 1 +
> > .../build/bsps/powerpc/t32mppc/bspt32mppc.yml | 1 +
> > spec/build/bsps/powerpc/tqm8xx/obj.yml | 1 +
> > spec/build/bsps/powerpc/virtex/bspvirtex.yml | 1 +
> > .../build/bsps/powerpc/virtex4/bspvirtex4.yml | 1 +
> > .../build/bsps/powerpc/virtex5/bspvirtex5.yml | 1 +
> > spec/build/bsps/riscv/griscv/obj.yml | 1 +
> > spec/build/bsps/riscv/riscv/obj.yml | 1 +
> > spec/build/bsps/sh/gensh1/bspgensh1.yml | 1 +
> > spec/build/bsps/sh/gensh2/bspgensh2.yml | 1 +
> > spec/build/bsps/sh/gensh4/bspgensh4.yml | 1 +
> > spec/build/bsps/sh/shsim/obj.yml | 1 +
> > spec/build/bsps/sparc/erc32/bsperc32.yml | 1 +
> > spec/build/bsps/sparc/leon2/obj.yml | 1 +
> > spec/build/bsps/sparc/leon3/obj.yml | 1 +
> > .../build/bsps/sparc64/niagara/bspniagara.yml | 1 +
> > spec/build/bsps/sparc64/usiii/bspusiii.yml | 1 +
> > spec/build/bsps/v850/gdbv850sim/obj.yml | 1 +
> > spec/build/bsps/x86_64/amd64/bspamd64.yml | 1 +
> > spec/build/cpukit/cfgbuildhash.yml | 14 ++
> > spec/build/cpukit/cfghdr.yml | 2 +
> > spec/build/cpukit/librtemscpu.yml | 2 +
> > testsuites/libtests/ttest01/init.c | 8 +-
> > testsuites/sptests/spprintk/init.c | 12 ++
> > testsuites/sptests/spsysinit01/init.c | 16 ++
> > wscript | 27 ++-
> > 192 files changed, 788 insertions(+), 37 deletions(-)
> > create mode 100644 bsps/shared/start/gettargethash-default.c
> > create mode 100644 cpukit/include/rtems/score/hash.h
> > create mode 100644 cpukit/sapi/src/getbuildhash.c
> > create mode 100644 cpukit/score/src/hash.c
> > create mode 100644 spec/build/cpukit/cfgbuildhash.yml
> >
> > --
> > 2.26.2
> >
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
More information about the devel
mailing list