c88d16baaf
cbfs-compression-tool provides a way to benchmark the compression algorithms as used by cbfstool (and coreboot) and allows to pre-compress data for later consumption by cbfstool (once it supports the format). For an impression, the benchmark's results on my machine: measuring 'none' compressing 10485760 bytes to 10485760 took 0 seconds measuring 'LZMA' compressing 10485760 bytes to 1736 took 2 seconds measuring 'LZ4' compressing 10485760 bytes to 41880 took 0 seconds And a possible use for external compression, parallel and non-parallel (60MB in 53 files compressed to 650KB on a machine with 40 threads): $ time (ls -1 *.* |xargs -n 1 -P $(nproc) -I '{}' cbfs-compression-tool compress '{}' out/'{}' LZMA) real 0m0.786s user 0m11.440s sys 0m0.044s $ time (ls -1 *.* |xargs -n 1 -P 1 -I '{}' cbfs-compression-tool compress '{}' out/'{}' LZMA) real 0m10.444s user 0m10.280s sys 0m0.064s Change-Id: I40be087e85d09a895b1ed277270350ab65a4d6d4 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: https://review.coreboot.org/18099 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
44 lines
1.3 KiB
Makefile
44 lines
1.3 KiB
Makefile
top ?= $(abspath ../..)
|
|
objutil ?= $(top)/util
|
|
|
|
CONFIG_FMD_GENPARSER ?= n
|
|
|
|
HOSTCC ?= $(CC)
|
|
OBJCOPY ?= objcopy
|
|
|
|
VBOOT_SOURCE ?= $(top)/3rdparty/vboot
|
|
|
|
.PHONY: all
|
|
all: cbfstool fmaptool rmodtool ifwitool cbfs-compression-tool
|
|
|
|
cbfstool: $(objutil)/cbfstool/cbfstool
|
|
|
|
fmaptool: $(objutil)/cbfstool/fmaptool
|
|
|
|
rmodtool: $(objutil)/cbfstool/rmodtool
|
|
|
|
ifwitool: $(objutil)/cbfstool/ifwitool
|
|
|
|
cbfs-compression-tool: $(objutil)/cbfstool/cbfs-compression-tool
|
|
|
|
.PHONY: clean cbfstool fmaptool rmodtool ifwitool cbfs-compression-tool
|
|
clean:
|
|
$(RM) fmd_parser.c fmd_parser.h fmd_scanner.c fmd_scanner.h
|
|
$(RM) $(objutil)/cbfstool/cbfstool $(cbfsobj)
|
|
$(RM) $(objutil)/cbfstool/fmaptool $(fmapobj)
|
|
$(RM) $(objutil)/cbfstool/rmodtool $(rmodobj)
|
|
$(RM) $(objutil)/cbfstool/ifwitool $(ifwiobj)
|
|
$(RM) $(objutil)/cbfstool/cbfs-compression-tool $(cbfscompobj)
|
|
|
|
linux_trampoline.c: linux_trampoline.S
|
|
rm -f linux_trampoline.c
|
|
$(CC) -m32 -o linux_trampoline linux_trampoline.S -ffreestanding -nostdlib -nostdinc -Wl,--defsym=_start=0
|
|
$(OBJCOPY) -Obinary -j .data linux_trampoline trampoline
|
|
echo "/* This file is automatically generated. Do not manually change */" > trampoline.c
|
|
xxd -c 16 -i trampoline >> trampoline.c
|
|
mv trampoline.c linux_trampoline.c
|
|
rm linux_trampoline trampoline
|
|
|
|
.SILENT:
|
|
|
|
include Makefile.inc
|