[padb] r420 committed - Reduce the amout of data sent over the network for tree-based stack tr...

padb at googlecode.com padb at googlecode.com
Sun Nov 28 21:44:13 GMT 2010


Revision: 420
Author: apittman at gmail.com
Date: Sun Nov 28 13:43:33 2010
Log: Reduce the amout of data sent over the network for tree-based stack  
traces.
I spotted that each stack trace was being sent over the network twice
for this case, once as namespace data which is used for the tree and once
as ordinary output.  Other than the outer process checking for it's
existance as a shortcut to know if it can exit early the ordinary output
wasn't used for anything.  This commit improves the check in the outer
to check for ordinary or namespace output and also stops the inner from
sending the un-necessairy data over the network.

http://code.google.com/p/padb/source/detail?r=420

Modified:
  /trunk/src/padb

=======================================
--- /trunk/src/padb	Thu Nov 25 10:33:54 2010
+++ /trunk/src/padb	Sun Nov 28 13:43:33 2010
@@ -4107,8 +4107,15 @@

      my $cargs = $req->{cargs};

-    # Warn on missing output here...
-    return unless exists $d->{target_output};
+    # Warn on missing output here, be sure to check both standard output  
and
+    # namespace output because if we are using a tree then there won't be  
any
+    # standard output.
+    if ( not exists $d->{target_output} and not exists  
$d->{target_ns_output} )
+    {
+        return;
+    }
+
+    #return unless exists $d->{target_output};

      my $lines = $d->{target_output};
      my $mode  = $req->{mode};
@@ -8664,8 +8671,6 @@
                ( $frame->{file} || '?' ),
                ( $frame->{line} || '?' );

-            output( $vp, $l );
-
              if ( $carg->{out_format} eq 'tree' ) {

                  output_namespace( $vp, $thread->{id}, $l );
@@ -8719,6 +8724,8 @@
                      }
                  }
              } else {
+                output( $vp, $l );
+
                  if ( $carg->{stack_shows_params} ) {
                      show_stack_vars( $vp, $frame, 'params' );
                  }




More information about the padb-devel mailing list