summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--elaborate.cxx15
-rw-r--r--elaborate.h4
-rw-r--r--tapsets.cxx17
4 files changed, 40 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 7a332695..b1c971b3 100644
--- 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
diff --git a/elaborate.cxx b/elaborate.cxx
index 05c2be57..ef019016 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -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
}
diff --git a/elaborate.h b/elaborate.h
index aafe0ae1..8c3a6869 100644
--- a/elaborate.h
+++ b/elaborate.h
@@ -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);
diff --git a/tapsets.cxx b/tapsets.cxx
index eaa719d4..55e64942 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -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,