[applied] btf-reader: Add logging methods

Message ID 87ikvjo7c5.fsf@redhat.com
State New
Headers
Series [applied] btf-reader: Add logging methods |

Commit Message

Dodji Seketeli Aug. 29, 2024, 12:13 p.m. UTC
  Hello,

	* src/abg-btf-reader.cc (reader::{do_log, show_stats}): Add new
	methods.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 src/abg-btf-reader.cc | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
  

Patch

diff --git a/src/abg-btf-reader.cc b/src/abg-btf-reader.cc
index ad610410..1f087a38 100644
--- a/src/abg-btf-reader.cc
+++ b/src/abg-btf-reader.cc
@@ -92,6 +92,45 @@  class reader : public elf_based_reader
   vector<type_base_sptr>		types_to_canonicalize_;
   btf_type_to_abi_artifact_map_type	btf_type_to_artifacts_;
 
+  /// Getter of the "do_log" flag.
+  ///
+  /// This flag tells if we should log about various internal
+  /// details.
+  ///
+  /// return the "do_log" flag.
+  bool
+  do_log() const
+  {return options().do_log;}
+
+  /// Setter of the "do_log" flag.
+  ///
+  /// This flag tells if we should log about various internal details.
+  ///
+  /// @param f the new value of the flag.
+  void
+  do_log(bool f)
+  {options().do_log = f;}
+
+  /// Getter of the "show_stats" flag.
+  ///
+  /// This flag tells if we should emit statistics about various
+  /// internal stuff.
+  ///
+  /// @return the value of the flag.
+  bool
+  show_stats() const
+  {return options().show_stats;}
+
+  /// Setter of the "show_stats" flag.
+  ///
+  /// This flag tells if we should emit statistics about various
+  /// internal stuff.
+  ///
+  /// @param f the value of the flag.
+  void
+  show_stats(bool f)
+  {options().show_stats = f;}
+
   /// Getter of the handle to the base BTF object of the current
   /// binary being analyzed.
   ///