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 0A0C63858D35 for ; Thu, 22 Jun 2023 13:31:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A0C63858D35 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=1687440674; 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=luzmVJf8auAa7f/dncsCIT6ltbGDPO5KBMUlwEwqBKc=; b=TdpyJ2xsEkKJ1duIbTP5UCdbA14qrxvUIHrkebrQ0PBqeA8NNvXwDl78J2m60E2oXLLt8H w1HEpHyu13zojhIqKo8oT5BU+UhA1TEN0tnFdG4njwhzG/u9JjbdPmaM2F4Eigul0tyoPB d9mNCb3bToFqBVUDgROLCxlfG9Pi2xM= 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-606-RBAMW6_yMOO8EAFpQOfbJw-1; Thu, 22 Jun 2023 09:31:12 -0400 X-MC-Unique: RBAMW6_yMOO8EAFpQOfbJw-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 413C7104458F; Thu, 22 Jun 2023 13:31:12 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.17.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id A33D5112132C; Thu, 22 Jun 2023 13:31:11 +0000 (UTC) From: Denys Vlasenko To: Mark Wielaard , debugedit@sourceware.org Cc: Denys Vlasenko Subject: [PATCH] find-debuginfo: unless -q -q, print messages what big steps we are at Date: Thu, 22 Jun 2023 15:31:03 +0200 Message-Id: <20230622133103.11551-1-dvlasenk@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=-12.6 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_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: For a reader of rpmbuild's log, it's rather unclear what find-debuginfo is doing. It used to be too verbose, "extracting debug info from FILE" for every file, and while this can be suppressed now, we still end up with something semi-mysterious like this: ... extracting debug info from /builddir/build/BUILDROOT/xyz gdb-add-index: No index was created for /builddir/build/BUILDROOT/xyz gdb-add-index: [Was there no debuginfo? Was there already an index?] symlinked /usr/lib/debug/usr/lib64/libcpupower.so.0.0.1.debug to /usr/lib/debug/usr/lib64/libcpupower.so.debug symlinked /usr/lib/debug/usr/lib64/libcpupower.so.0.0.1.debug to /usr/lib/debug/usr/lib64/libcpupower.so.0.debug cpio: binutils-2.30/bfd: Cannot stat: No such file or directory cpio: binutils-2.30/bfd/aout-target.h: Cannot stat: No such file or directory cpio: binutils-2.30/bfd/aoutx.h: Cannot stat: No such file or directory cpio: binutils-2.30/bfd/archive.c: Cannot stat: No such file or directory cpio: binutils-2.30/bfd/archive64.c: Cannot stat: No such file or directory ... 775655 blocks + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-ldconfig ... The reader is left confused. "What these cpio errors are about? Why those sources are not found?" (Well, because not every source name extracted by 'debugedit -l' has to exist, but this requires considerable digging aroung to understand). We can give a few messages explaining what general steps we go through: Extracting debug info from N files DWARF-compressing N files Creating .debug symlinks for symlinks to ELF files Copying sources found by 'debugedit -l' This is also useful to get a feeling which steps are time consuming. Kernel builds often need to investigate this aspect. To help a bit more, add "find-debuginfo: starting" and "find-debuginfo: done" messages too. This patch adds these messages. Two -q -q options suppress these messages too. Signed-off-by: Denys Vlasenko --- scripts/find-debuginfo.in | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/find-debuginfo.in b/scripts/find-debuginfo.in index e7ac095..b76edaf 100755 --- a/scripts/find-debuginfo.in +++ b/scripts/find-debuginfo.in @@ -94,7 +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. +The -q or --quiet flag silences verbose output from the script. +Given twice, silences all non-error output from the script. All file names in switches are relative to builddir ('.' if not given). EOF @@ -148,8 +149,10 @@ n_jobs=1 # exit early on --version or --help done=false -# silence non-error output +# silence verbose output quiet=false +# silence non-error output +quiet2=false BUILDDIR=. out=debugfiles.list @@ -245,6 +248,7 @@ while [ $# -gt 0 ]; do shift ;; -q|--quiet) + $quiet && quiet2=true quiet=true ;; --version) @@ -289,6 +293,8 @@ if [ "$strip_g" = "true" ] && [ "$strip_glibs" = "true" ]; then exit 2 fi +$quiet2 || echo "find-debuginfo: starting" 2>&1 + i=0 while ((i < nout)); do outs[$i]="$BUILDDIR/${outs[$i]}" @@ -549,6 +555,7 @@ run_job() } n_files=$(wc -l <"$temp/primary") +$quiet2 || echo "Extracting debug info from $n_files files" 2>&1 if [ $n_jobs -gt $n_files ]; then n_jobs=$n_files fi @@ -587,6 +594,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 + $quiet2 || echo "DWARF-compressing ${#dwz_files[@]} files" 2>&1 $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= @@ -625,6 +633,7 @@ fi # For each symlink whose target has a .debug file, # make a .debug symlink to that file. +$quiet2 || echo "Creating .debug symlinks for symlinks to ELF files" 2>&1 find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*" -type l -print | while read f do @@ -646,6 +655,7 @@ if [ -s "$SOURCEFILE" ]; then debug_dest_name="/usr/src/debug/${unique_debug_src_base}" fi + $quiet2 || echo "Copying sources found by 'debugedit -l' to ${debug_dest_name}" 2>&1 mkdir -p "${RPM_BUILD_ROOT}${debug_dest_name}" # Filter out anything compiler generated which isn't a source file. # e.g. , , <__thread_local_inner macros>. @@ -761,3 +771,5 @@ if ((nout > 0)); then cat "$LISTFILE" >> "${LISTFILE}.new" mv "${LISTFILE}.new" "$LISTFILE" fi + +$quiet2 || echo "find-debuginfo: done" 2>&1 -- 2.37.2