[16/27] tools-utils: Improve logging while reading a Linux kernel

Message ID 87cylrl3fv.fsf@seketeli.org
State New
Headers
Series Implement type hashing & fix self-comparing gcc-gnat in fc37 |

Commit Message

Dodji Seketeli Aug. 29, 2024, 4:05 p.m. UTC
  Hello,

This patch improves time logging while reading a Linux kernel, to help
see where time is spent.

	* src/abg-tools-utils.cc (load_vmlinux_corpus)
	(build_corpus_group_from_kernel_dist_under): Improve time logging.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 src/abg-tools-utils.cc | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
  

Patch

diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc
index c42073cb..9660fcfc 100644
--- a/src/abg-tools-utils.cc
+++ b/src/abg-tools-utils.cc
@@ -3028,7 +3028,7 @@  load_vmlinux_corpus(elf_based_reader_sptr rdr,
 
   if (verbose)
     std::cerr << vmlinux
-     << " reading DONE:"
+     << " reading DONE in:"
      << t << "\n";
 
   if (group->is_empty())
@@ -3046,7 +3046,7 @@  load_vmlinux_corpus(elf_based_reader_sptr rdr,
          << *m << "' ("
          << cur_module_index
          << "/" << total_nb_modules
-         << ") ... " << std::flush;
+         << ") ...\n" << std::flush;
 
       rdr->initialize(*m, di_roots,
                       /*read_all_types=*/false,
@@ -3061,10 +3061,10 @@  load_vmlinux_corpus(elf_based_reader_sptr rdr,
       rdr->read_and_add_corpus_to_group(*group, status);
       t.stop();
       if (verbose)
-        std::cerr << "module '"
-         << *m
-         << "' reading DONE: "
-         << t << "\n";
+	std::cerr << "Module reading DONE in: "
+		  << t << " for '" << *m
+		  << "' (" << cur_module_index << "/" << total_nb_modules << ")"
+		  << "'\n";
     }
 }
 
@@ -3125,7 +3125,7 @@  build_corpus_group_from_kernel_dist_under(const string&	root,
 	      << root
 	      << "' with vmlinux path: '"
 	      << vmlinux_path
-	      << "' ... " << std::flush;
+	      << "' ... \n" << std::flush;
 
   timer t;
 
@@ -3135,7 +3135,7 @@  build_corpus_group_from_kernel_dist_under(const string&	root,
   t.stop();
 
   if (verbose)
-    std::cerr << "DONE: " << t << "\n";
+    std::cerr << "Kernel tree binary paths analysis DONE in: " << t << "\n";
 
   if (got_binary_paths)
     {