From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id D8B6E3858D28 for ; Thu, 26 Jan 2023 21:08:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D8B6E3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674767339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nTp0eb9x1CeQclFyERxYm/JH7EFIFZKGcjyquG23l7k=; b=ROdCOkNjmR5FcyeKQFMf0wGtkJO0ZMaqpAsH4aAvLNf1XP1LEVw7wZ2gXdMeu8BykHpDBb AYCPO05H4S5lvfLwxKlWGn6TBF0u6DJlK/NLKTFOEGOI+8nmBDbRLa2z/37M6BwMn4v+GZ /T/lW5caFiaDWtbKUfvoOaDTdczTOTw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-228--OgN755jP_i9DpCdxPJEBg-1; Thu, 26 Jan 2023 16:08:58 -0500 X-MC-Unique: -OgN755jP_i9DpCdxPJEBg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 08AE9185A794 for ; Thu, 26 Jan 2023 21:08:58 +0000 (UTC) Received: from prarit.7a2m.lab.eng.bos.redhat.com (prarit-guest.7a2m.lab.eng.bos.redhat.com [10.16.222.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id E4A4F1121330; Thu, 26 Jan 2023 21:08:57 +0000 (UTC) From: Prarit Bhargava To: debugedit@sourceware.org Cc: Prarit Bhargava Subject: [PATCH] scripts/find-debuginfo.in: Add -q|--quiet Date: Thu, 26 Jan 2023 16:08:57 -0500 Message-Id: <20230126210857.3867040-1-prarit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Projects with a large number of compiled files end up with a large number of 'extracting debug info from' messages in the build log. In the case of the Fedora kernel these messages account for 8504 lines in the log, or 61% of the entire log [1]. Removing these lines make the log easier to view and comprehend for some projects, however, not all projects will want to silence these messages so suppressing them must be optional. Add a -q|--quiet which allows users to silence the non-error output from the script. [1] https://kojipkgs.fedoraproject.org//packages/kernel/6.2.0/0.rc5.20230123git2475bf0250de.38.fc38/data/logs/x86_64/build.log Signed-off-by: Prarit Bhargava --- scripts/find-debuginfo.in | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/scripts/find-debuginfo.in b/scripts/find-debuginfo.in index b07a52fe4b98..e55a62cc78f1 100755 --- a/scripts/find-debuginfo.in +++ b/scripts/find-debuginfo.in @@ -26,7 +26,7 @@ Usage: find-debuginfo [OPTION]... [builddir] automagically generates debug info and file lists Options: -[--strict-build-id] [-g] [-r] [-m] [-i] [-n] +[--strict-build-id] [-g] [-r] [-m] [-i] [-n] [-q] [--keep-section SECTION] [--remove-section SECTION] [--g-libs] [-j N] [--jobs N] @@ -94,6 +94,8 @@ will be called /usr/debug/src/. This makes sure the debug source dirs are unique between package version, release and achitecture (Use --unique-debug-src-base "%{name}-%{VERSION}-%{RELEASE}.%{_arch}") +The -q or --quiet flag silences non-error output from the script. + All file names in switches are relative to builddir ('.' if not given). EOF } @@ -146,6 +148,9 @@ n_jobs=1 # exit early on --version or --help done=false +# silence non-error output +quiet=false + BUILDDIR=. out=debugfiles.list srcout= @@ -239,6 +244,9 @@ while [ $# -gt 0 ]; do srcout=$2 shift ;; + -q|--quiet) + quiet=true + ;; --version) echo "find-debuginfo @VERSION@" done=true; @@ -437,7 +445,7 @@ do_file() get_debugfn "$f" [ -f "${debugfn}" ] && return - echo "extracting debug info from $f" + $quiet || echo "extracting debug info from $f" # See also cpio SOURCEFILE copy. Directories must match up. debug_base_name="$RPM_BUILD_DIR" debug_dest_name="/usr/src/debug" @@ -513,7 +521,7 @@ do_file() grep "^$inum " "$temp/linked" | while read inum linked; do link=$debugfn get_debugfn "$linked" - echo "hard linked $link to $debugfn" + $quiet || echo "hard linked $link to $debugfn" mkdir -p "$(dirname "$debugfn")" && ln -nf "$link" "$debugfn" done fi @@ -576,7 +584,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 -sk ${RPM_BUILD_ROOT}/usr/lib/debug | cut -f1) + $quiet || 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 @@ -599,8 +607,8 @@ if $run_dwz \ echo >&2 "*** ERROR: DWARF compression requested, but no dwz installed" exit 2 fi - 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" + $quiet || size_after=$(du -sk ${RPM_BUILD_ROOT}/usr/lib/debug | cut -f1) + $quiet || 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 @@ -620,7 +628,7 @@ do f=${f#$RPM_BUILD_ROOT} t=${t#$RPM_BUILD_ROOT} if [ -f "$debugdir$t" ]; then - echo "symlinked /usr/lib/debug$t to /usr/lib/debug${f}.debug" + $quiet || echo "symlinked /usr/lib/debug$t to /usr/lib/debug${f}.debug" debug_link "/usr/lib/debug$t" "${f}.debug" fi done -- 2.39.1