Skip to content

Commit

Permalink
Report debuginfo size in kilobytes
Browse files Browse the repository at this point in the history
By standard, 'du' defaults to 512 byte units, but this differs between
implementations: GNU du defaults to 1024 unless POSIXLY_CORRECT is set
and also allows overriding via number of environment variables. It also
supports various other ways of controlling the block size, but the
only standard means to control the size is -k, and we really don't
want to break portability for the sake of FYI statistics.

Inspired by Marxim Liska's patch at in #554.
  • Loading branch information
pmatilai committed Oct 1, 2018
1 parent 7ffc4d1 commit 62d901a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/find-debuginfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ if $run_dwz \
&& [ -d "${RPM_BUILD_ROOT}/usr/lib/debug" ]; then
readarray dwz_files < <(cd "${RPM_BUILD_ROOT}/usr/lib/debug"; find -type f -name \*.debug | LC_ALL=C sort)
if [ ${#dwz_files[@]} -gt 0 ]; then
size_before=$(du -s ${RPM_BUILD_ROOT}/usr/lib/debug | cut -f1)
size_before=$(du -sk ${RPM_BUILD_ROOT}/usr/lib/debug | cut -f1)
dwz_multifile_name="${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION}-${RPM_PACKAGE_RELEASE}.${RPM_ARCH}"
dwz_multifile_suffix=
dwz_multifile_idx=0
Expand All @@ -509,8 +509,8 @@ if $run_dwz \
echo >&2 "*** ERROR: DWARF compression requested, but no dwz installed"
exit 2
fi
size_after=$(du -s ${RPM_BUILD_ROOT}/usr/lib/debug | cut -f1)
echo "original debug info size: ${size_before}, size after compression: ${size_after}"
size_after=$(du -sk ${RPM_BUILD_ROOT}/usr/lib/debug | cut -f1)
echo "original debug info size: ${size_before}kB, size after compression: ${size_after}kB"
# Remove .dwz directory if empty
rmdir "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz" 2>/dev/null
if [ -f "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz/${dwz_multifile_name}" ]; then
Expand Down

0 comments on commit 62d901a

Please sign in to comment.