public inbox for debugedit@sourceware.org
 help / color / mirror / Atom feed
From: Prarit Bhargava <prarit@redhat.com>
To: debugedit@sourceware.org
Cc: Prarit Bhargava <prarit@redhat.com>
Subject: [PATCH] scripts/find-debuginfo.in: Add --no-per-file-msg
Date: Mon, 23 Jan 2023 15:27:37 -0500	[thread overview]
Message-ID: <20230123202737.3632441-1-prarit@redhat.com> (raw)

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 --no-per-file-msg which allows users to disable the per file
scanning message and in its place output a single general message in the
log.

[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 <prarit@redhat.com>
---
 scripts/find-debuginfo.in | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/scripts/find-debuginfo.in b/scripts/find-debuginfo.in
index b07a52fe4b98..f262b00cfcb1 100755
--- a/scripts/find-debuginfo.in
+++ b/scripts/find-debuginfo.in
@@ -38,6 +38,7 @@ Options:
 [--build-id-seed SEED]
 [--unique-debug-suffix SUFFIX]
 [--unique-debug-src-base BASE]
+[--no-per-file-msg]
 [[-l filelist]... [-p 'pattern'] -o debuginfo.list]
 [builddir]
 
@@ -94,6 +95,9 @@ will be called /usr/debug/src/<BASE>.  This makes sure the debug source
 dirs are unique between package version, release and achitecture (Use
 --unique-debug-src-base "%{name}-%{VERSION}-%{RELEASE}.%{_arch}")
 
+If --no-per-file-msg is given then the 'extract debuginfo from ...'
+message is not output for each file.
+
 All file names in switches are relative to builddir ('.' if not given).
 EOF
 }
@@ -146,6 +150,9 @@ n_jobs=1
 # exit early on --version or --help
 done=false
 
+# Output the "extracting debug info from" message for each file.
+per_file_msg=true
+
 BUILDDIR=.
 out=debugfiles.list
 srcout=
@@ -239,6 +246,9 @@ while [ $# -gt 0 ]; do
     srcout=$2
     shift
     ;;
+  --no-per-file-msg)
+    per_file_msg=false
+    ;;
   --version)
     echo "find-debuginfo @VERSION@"
     done=true;
@@ -437,7 +447,7 @@ do_file()
   get_debugfn "$f"
   [ -f "${debugfn}" ] && return
 
-  echo "extracting debug info from $f"
+  $per_file_msg && 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"
@@ -544,6 +554,7 @@ n_files=$(wc -l <"$temp/primary")
 if [ $n_jobs -gt $n_files ]; then
   n_jobs=$n_files
 fi
+$per_file_msg || echo "Extracting debuginfo from files ..."
 if [ $n_jobs -le 1 ]; then
   while read nlinks inum f; do
     do_file "$nlinks" "$inum" "$f"
-- 
2.39.1


             reply	other threads:[~2023-01-23 20:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 20:27 Prarit Bhargava [this message]
2023-01-26 15:02 ` Mark Wielaard
2023-01-26 15:21   ` Prarit Bhargava

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230123202737.3632441-1-prarit@redhat.com \
    --to=prarit@redhat.com \
    --cc=debugedit@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).