]> sourceware.org Git - systemtap.git/commitdiff
Only collect and emit unwind data in translator if the session needs it.
authorMark Wielaard <mjw@redhat.com>
Thu, 11 Aug 2011 10:34:01 +0000 (12:34 +0200)
committerMark Wielaard <mjw@redhat.com>
Thu, 11 Aug 2011 10:34:01 +0000 (12:34 +0200)
When we hit the translator the session already knows whether or not it
will possibly need the unwind data. Only collect and emit it, if the
session does. This can save writing out tens of MB to stap-symbols.h
for simple scripts that never call any backtrace() function.

translate.cxx

index 8b7127b1d1f866cddccb3732703103b46db09250..85c697c53dde3023851108915c0ea405b2b690fd 100644 (file)
@@ -5096,10 +5096,13 @@ dump_unwindsyms (Dwfl_Module *m,
   size_t eh_frame_hdr_len = 0;
   Dwarf_Addr eh_addr = 0;
   Dwarf_Addr eh_frame_hdr_addr = 0;
-  get_unwind_data (m, &debug_frame, &eh_frame, &debug_len, &eh_len, &eh_addr,
-                   &eh_frame_hdr, &eh_frame_hdr_len, &debug_frame_hdr,
-                   &debug_frame_hdr_len, &debug_frame_off, &eh_frame_hdr_addr,
-                   c->session, m);
+
+  if (c->session.need_unwind)
+    get_unwind_data (m, &debug_frame, &eh_frame, &debug_len, &eh_len, &eh_addr,
+                     &eh_frame_hdr, &eh_frame_hdr_len, &debug_frame_hdr,
+                     &debug_frame_hdr_len, &debug_frame_off, &eh_frame_hdr_addr,
+                     c->session, m);
+
   if (debug_frame != NULL && debug_len > 0)
     {
       c->output << "#if defined(STP_USE_DWARF_UNWINDER) && defined(STP_NEED_UNWIND_DATA)\n";
@@ -5173,7 +5176,7 @@ dump_unwindsyms (Dwfl_Module *m,
       c->output << "#endif /* STP_USE_DWARF_UNWINDER && STP_NEED_UNWIND_DATA */\n";
     }
   
-  if (debug_frame == NULL && eh_frame == NULL)
+  if (c->session.need_unwind && debug_frame == NULL && eh_frame == NULL)
     {
       // There would be only a small benefit to warning.  A user
       // likely can't do anything about this; backtraces for the
This page took 0.040506 seconds and 5 git commands to generate.