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

* Re: [PATCH] scripts/find-debuginfo.in: Add --no-per-file-msg
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Wielaard @ 2023-01-26 15:02 UTC (permalink / raw)
  To: Prarit Bhargava, debugedit

Hi Prarit,

On Mon, 2023-01-23 at 15:27 -0500, Prarit Bhargava wrote:
> 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.

I appreciate the idea, but I think it is better to have a more standard
-q, --quiet option that simply suppresses all none error/warnings. 
find-debuginfo already has too many specialized options IMHO.

Besides this "per file" output that is just these three extra output
lines:

  echo "symlinked /usr/lib/debug$t to /usr/lib/debug${f}.debug"
  echo "hard linked $link to $debugfn"
  echo "original debug info size: ${size_before}kB, size after
compression: ${size_after}kB"

(For that last one, you can then also hide the size_before
 and size_after calculations behind $quiet &&)

Cheers,

Mark

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

* Re: [PATCH] scripts/find-debuginfo.in: Add --no-per-file-msg
  2023-01-26 15:02 ` Mark Wielaard
@ 2023-01-26 15:21   ` Prarit Bhargava
  0 siblings, 0 replies; 3+ messages in thread
From: Prarit Bhargava @ 2023-01-26 15:21 UTC (permalink / raw)
  To: Mark Wielaard, debugedit

On 1/26/23 10:02, Mark Wielaard wrote:
> Hi Prarit,
> 
> On Mon, 2023-01-23 at 15:27 -0500, Prarit Bhargava wrote:
>> 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.
> 
> I appreciate the idea, but I think it is better to have a more standard
> -q, --quiet option that simply suppresses all none error/warnings.
> find-debuginfo already has too many specialized options IMHO.
> 

Heh, I thought about doing this but wasn't sure if there needed to be a 
quiet option.  It's good to know you're open to this idea.

> Besides this "per file" output that is just these three extra output
> lines:
> 
>    echo "symlinked /usr/lib/debug$t to /usr/lib/debug${f}.debug"
>    echo "hard linked $link to $debugfn"
>    echo "original debug info size: ${size_before}kB, size after
> compression: ${size_after}kB"
> 

> (For that last one, you can then also hide the size_before
>   and size_after calculations behind $quiet &&)

I'll look at this and post a --quiet option.

Thanks,

P.


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