[llvm-commits] CVS: llvm/test/DSGraphs/Makefile generate_report.pl

Chris Lattner lattner at cs.uiuc.edu
Thu Nov 7 01:17:00 PST 2002


Changes in directory llvm/test/DSGraphs:

Makefile updated: 1.5 -> 1.6
generate_report.pl updated: 1.4 -> 1.5

---
Log message:

Add option to make files without timing information in them so that I can
diff the output of two different runs to see if anything changes due to a
change of mine.


---
Diffs of the changes:

Index: llvm/test/DSGraphs/Makefile
diff -u llvm/test/DSGraphs/Makefile:1.5 llvm/test/DSGraphs/Makefile:1.6
--- llvm/test/DSGraphs/Makefile:1.5	Wed Nov  6 19:56:50 2002
+++ llvm/test/DSGraphs/Makefile	Thu Nov  7 01:16:05 2002
@@ -58,5 +58,7 @@
 	gmake all 2>&1 | tee report.raw.out	
 
 report: report.raw.out
+	-mv -f report.no-times.txt report.no-times.old.txt
 	-mv -f report.txt report.old.txt
+	./generate_report.pl -no-times report.raw.out > report.no-times.txt
 	./generate_report.pl report.raw.out 2>&1 | tee report.txt


Index: llvm/test/DSGraphs/generate_report.pl
diff -u llvm/test/DSGraphs/generate_report.pl:1.4 llvm/test/DSGraphs/generate_report.pl:1.5
--- llvm/test/DSGraphs/generate_report.pl:1.4	Wed Nov  6 20:19:04 2002
+++ llvm/test/DSGraphs/generate_report.pl	Thu Nov  7 01:16:05 2002
@@ -1,7 +1,20 @@
 #!/usr/dcs/software/supported/bin/perl -w
 
-my $InputFN = $ARGV[0];
+# Default values for arguments
+$SHOW_TIMES = 1;
+
+# Parse arguments...
+while ($_ = $ARGV[0], /^[-+]/) {
+  shift;
+  last if /^--$/;  # Stop processing arguments on --
+
+  # List command line options here...
+  if (/^-no-times$/) { $SHOW_TIMES = 0; next; }
+
+  print "Unknown option: $_ : ignoring!\n";
+}
 
+my $InputFN = $ARGV[0];
 #print "Reading input from $InputFN\n";
 
 open(INPUT, $InputFN) or die "Couldn't open '$InputFN'!";
@@ -21,11 +34,13 @@
 # first test.
 shift @Records;
 
-printf("%-30s%-10s%-10s%-10s%-10s%-10s     " .
-       "%-10s%-10s%-10s%-10s  " . 
-       "%-8s%-10s%-8s%-8s\n",
-       "Name:",
-       "LocTime:", "BUTime:", "TDTime:", "TotTime:", "AnlzTime:",
+printf("%-30s", "Name:");
+if ($SHOW_TIMES) {
+  printf("%-10s%-10s%-10s%-10s%-10s     ",
+         "LocTime:", "BUTime:", "TDTime:", "TotTime:", "AnlzTime:");
+}
+
+printf("%-10s%-10s%-10s%-10s  " . "%-8s%-10s%-8s%-8s\n",
        "LocSize:", "BUSize:", "TDSize:", "TotSize:",
        "NumFold", "NumNodes", "main", "__main");
 
@@ -37,14 +52,17 @@
     # If an assertion failure occured, print it out.
     print (grep /Assertion/, (split "\n", $Record));
   } else {
-    # Print Times
-    printField('([0-9.]+) \([^)]+\)[ ]*[0-9]+  Local', $Record, 10);
-    printField('([0-9.]+) \([^)]+\)[ ]*[0-9]+  Bottom-up', $Record, 10);
-    printField('([0-9.]+) \([^)]+\)[ ]*[0-9]+  Top-down', $Record, 10);
-    printField('([0-9.]+) \([^)]+\)[ ]*[0-9]+  TOTAL', $Record, 10);
-    printField('real\s+([ms0-9.]+)', $Record, 10);
+    if ($SHOW_TIMES) {
+      # Print Times
+      printField('([0-9.]+) \([^)]+\)[ ]*[0-9]+  Local', $Record, 10);
+      printField('([0-9.]+) \([^)]+\)[ ]*[0-9]+  Bottom-up', $Record, 10);
+      printField('([0-9.]+) \([^)]+\)[ ]*[0-9]+  Top-down', $Record, 10);
+      printField('([0-9.]+) \([^)]+\)[ ]*[0-9]+  TOTAL', $Record, 10);
+      printField('real\s+([ms0-9.]+)', $Record, 10);
+
+      print "|    ";
+    }
 
-    print "|    ";
     # Print Sizes
     printField("([0-9]+)  Local", $Record, 10);
     printField("([0-9]+)  Bottom-up", $Record, 10);





More information about the llvm-commits mailing list