[Tinyos-2-commits] CVS: tinyos-2.x/tools/tinyos/safe tos-ramsize, 1.2, 1.3

John Regehr regehr at users.sourceforge.net
Fri Apr 10 19:36:41 PDT 2009


Update of /cvsroot/tinyos/tinyos-2.x/tools/tinyos/safe
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27969

Modified Files:
	tos-ramsize 
Log Message:
fix bug in recursion reporting

Index: tos-ramsize
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tools/tinyos/safe/tos-ramsize,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** tos-ramsize	10 Apr 2009 23:03:24 -0000	1.2
--- tos-ramsize	11 Apr 2009 02:36:39 -0000	1.3
***************
*** 1486,1497 ****
      my $min_path = $INFINITY;
      my $min_func;
      foreach my $z (@func_list) {
! 	if ($path{$z}{$z} < $min_path) {
! 	    $min_path = $path{$z}{$z};
  	    $min_func = $z;
  	}
      }
      if ($min_path != $INFINITY) {
! 	print "there is a recursive loop of length $min_path\n";
  	my $f = $min_func;
  	for (my $i=$min_path-1; $i>0; $i--) {
--- 1486,1504 ----
      my $min_path = $INFINITY;
      my $min_func;
+     if ($verbosity > 2) {
+ 	print "self-path lengths in the callgraph:\n";
+     }
      foreach my $z (@func_list) {
! 	my $len = $path{$z}{$z};
! 	if ($verbosity > 2) {
! 	    print "  $addr_to_label{$z} $len\n";
! 	}
! 	if ($len < $min_path) {
! 	    $min_path = $len;
  	    $min_func = $z;
  	}
      }
      if ($min_path != $INFINITY) {
! 	print "cannot estimate stack depth due to recursive loop of length $min_path:\n";
  	my $f = $min_func;
  	for (my $i=$min_path-1; $i>0; $i--) {
***************
*** 1499,1511 ****
  	    my $found;
  	    foreach my $n (@next_list) {
! 		if ($path{$n}{$min_func} == $i) {
  		    $found = $n;
  		}
  	    }
  	    die "tos-ramsize FAIL graph algo bug" if (!$found);
! 	    print "  $addr_to_label{$f} $f -> $addr_to_label{$found} $found\n";
  	    $f = $found;
  	}
! 	print "  $addr_to_label{$f} $f -> $addr_to_label{$min_func} $min_func\n";
  	die "tos-ramsize FAIL";
      }
--- 1506,1520 ----
  	    my $found;
  	    foreach my $n (@next_list) {
! 		if ($path{$n}{$min_func} == $i &&
! 		    $path{$n}{$n} == $min_path) {
  		    $found = $n;
  		}
  	    }
  	    die "tos-ramsize FAIL graph algo bug" if (!$found);
! 	    printf "  %s @ %x -> %s @ %x\n", $addr_to_label{$f}, $f, $addr_to_label{$found}, $found;
  	    $f = $found;
  	}
! 	printf "  %s @ %x -> %s @ %x\n", $addr_to_label{$f}, $f, $addr_to_label{$min_func}, $min_func;
! 
  	die "tos-ramsize FAIL";
      }



More information about the Tinyos-2-commits mailing list