public inbox for debugedit@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] scripts/find-debuginfo.in: Add --no-per-file-msg
@ 2023-01-23 20:27 Prarit Bhargava
  2023-01-26 15:02 ` Mark Wielaard
  0 siblings, 1 reply; 3+ messages in thread
From: Prarit Bhargava @ 2023-01-23 20:27 UTC (permalink / raw)
  To: debugedit; +Cc: Prarit Bhargava

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-26 15:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-23 20:27 [PATCH] scripts/find-debuginfo.in: Add --no-per-file-msg Prarit Bhargava
2023-01-26 15:02 ` Mark Wielaard
2023-01-26 15:21   ` Prarit Bhargava

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).