]> sourceware.org Git - systemtap.git/commitdiff
2007-02-25 Frank Ch. Eigler <fche@redhat.com>
authorfche <fche>
Sun, 25 Feb 2007 23:03:49 +0000 (23:03 +0000)
committerfche <fche>
Sun, 25 Feb 2007 23:03:49 +0000 (23:03 +0000)
* elaborate.h (match_node, derived_probe_builder): Add
build_no_more member function.
* elaborate.cxx (semantic_pass_symbols): Call it.
* tapsets.cxx (dwarf_builder): Implement it by releasing dwflpp
instance after pass 2, freeing mucho memory.

ChangeLog
elaborate.cxx
elaborate.h
tapsets.cxx

index 7a3326955fd9f712e7f13021ac0972f8ff3d5d17..b1c971b3f5286fd5e3b19ec5ce6e0b1c469e2cf4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-02-25  Frank Ch. Eigler  <fche@redhat.com>
+
+       * elaborate.h (match_node, derived_probe_builder): Add
+       build_no_more member function.
+       * elaborate.cxx (semantic_pass_symbols): Call it.
+       * tapsets.cxx (dwarf_builder): Implement it by releasing dwflpp
+       instance after pass 2, freeing mucho memory.
+
 2007-02-23  Josh Stone  <joshua.i.stone@intel.com>
 
        PR 4096
index 05c2be57a7f01ad24e12b71bcf9e11dd71e09674..ef019016afdeb0a7c1facfec038f0de8ed2f81bc 100644 (file)
@@ -1,5 +1,5 @@
 // elaboration functions
-// Copyright (C) 2005, 2006 Red Hat Inc.
+// Copyright (C) 2005-2007 Red Hat Inc.
 //
 // This file is part of systemtap, and is free software.  You can
 // redistribute it and/or modify it under the terms of the GNU General
@@ -326,6 +326,15 @@ match_node::find_and_build (systemtap_session& s,
 }
 
 
+void
+match_node::build_no_more (systemtap_session& s)
+{
+  for (sub_map_iterator_t i = sub.begin(); i != sub.end(); i++)
+    i->second->build_no_more (s);
+  if (end) end->build_no_more (s);
+}
+
+
 // ------------------------------------------------------------------------
 // Alias probes
 // ------------------------------------------------------------------------
@@ -914,6 +923,10 @@ semantic_pass_symbols (systemtap_session& s)
             }
         }
     }
+
+  // Inform all derived_probe builders that we're done with
+  // all resolution, so it's time to release caches.
+  s.pattern_root->build_no_more (s);
   
   return s.num_errors(); // all those print_error calls
 }
index aafe0ae1f494ff185ef9ec15acc23f4d3f6ac45c..8c3a686976953b16f7fe948c7c71b38ceaf65f19 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// Copyright (C) 2005, 2006 Red Hat Inc.
+// Copyright (C) 2005-2007 Red Hat Inc.
 //
 // This file is part of systemtap, and is free software.  You can
 // redistribute it and/or modify it under the terms of the GNU General
@@ -170,6 +170,7 @@ struct derived_probe_builder
                     std::map<std::string, literal*> const & parameters,
                     std::vector<derived_probe*> & finished_results) = 0;
   virtual ~derived_probe_builder() {}
+  virtual void build_no_more (systemtap_session &) {}
 
   static bool get_param (std::map<std::string, literal*> const & parameters,
                          const std::string& key, std::string& value);
@@ -210,6 +211,7 @@ match_node
   void find_and_build (systemtap_session& s,
                        probe* p, probe_point *loc, unsigned pos,
                        std::vector<derived_probe *>& results);
+  void build_no_more (systemtap_session &s);
 
   match_node* bind(match_key const & k);
   match_node* bind(std::string const & k);
index eaa719d422253b3c372cfc73bfa7a44518d16f6c..55e64942d5c9b424982908274e2860d434534dda 100644 (file)
@@ -1,6 +1,6 @@
 // tapset resolution
-// Copyright (C) 2005, 2006 Red Hat Inc.
-// Copyright (C) 2005, 2006 Intel Corporation.
+// Copyright (C) 2005-2007 Red Hat Inc.
+// Copyright (C) 2005-2007 Intel Corporation.
 //
 // This file is part of systemtap, and is free software.  You can
 // redistribute it and/or modify it under the terms of the GNU General
@@ -1990,6 +1990,18 @@ struct dwarf_builder: public derived_probe_builder
   dwarf_builder()
     : kern_dw(NULL), user_dw(NULL)
   {}
+
+  void build_no_more (systemtap_session &s)
+  {
+    if (kern_dw)
+      {
+        if (s.verbose > 3)
+          clog << "dwarf_builder releasing dwflpp" << endl;
+        delete kern_dw;
+        kern_dw = 0;
+      }
+  }
+
   ~dwarf_builder()
   {
     if (kern_dw)
@@ -1997,6 +2009,7 @@ struct dwarf_builder: public derived_probe_builder
     if (user_dw)
       delete user_dw;
   }
+
   virtual void build(systemtap_session & sess,
                     probe * base,
                     probe_point * location,
This page took 0.055 seconds and 5 git commands to generate.