Commit graph

3 commits

Author SHA1 Message Date
Patrick Georgi
450e4bc446 UPSTREAM: util/cbfstool: avoid memleaks and off-by-ones
BUG=none
BRANCH=none
TEST=none

Change-Id: Ib3219e1ecbff9c3ddf74e690daddeb996f72a314
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: dce629b2f8
Original-Change-Id: Iac136a5dfe76f21aa7c0d5ee4e974e50b955403b
Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Found-by: scan-build 3.8
Original-Reviewed-on: https://review.coreboot.org/18134
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://chromium-review.googlesource.com/458339
2017-03-22 10:08:20 -07:00
Patrick Georgi
484e33c460 UPSTREAM: cbfs-compression-tool: catch compression failures
If compression failed, just store the uncompressed data, which is what
cbfstool does as well.

BUG=chrome-os-partner:62235
BRANCH=none
TEST=none

Change-Id: I41f911169f376be3dab1335d93e1b3ff68ad7377
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: b46c4ecaba
Original-Change-Id: I67f51982b332d6ec1bea7c9ba179024fc5344743
Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/18201
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://chromium-review.googlesource.com/430741
2017-01-24 07:14:50 -08:00
Patrick Georgi
f905d67b49 UPSTREAM: util/cbfstool: Add cbfs-compression-tool
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

BUG=chromium:630451
BRANCH=none
TEST=manual execution of the tool works

Change-Id: If2ac452dae4180b5df516a99808008ce41922621
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Change-Id: I40be087e85d09a895b1ed277270350ab65a4d6d4
Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/18099
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://chromium-review.googlesource.com/427702
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
2017-01-13 18:42:05 -08:00