tools/performance/layout/genfromlogs.pl

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 ##########################################################################################
     2 #
     3 # This Source Code Form is subject to the terms of the Mozilla Public
     4 # License, v. 2.0. If a copy of the MPL was not distributed with this
     5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
     7 @ARGV;
     8 $milestone = $ARGV[0];
     9 print ($milestone);
    11 $bldRoot = $ARGV[1];
    12 print(" BuildRoot: $bldRoot\n");
    13 $cnt = 0;
    15 # Backup the history file
    16 system( ("copy", "history.txt", "history.bak" ) );
    18 # Delete the average.txt file so we don;t get old values in the averages
    19 if (-e "average.txt")
    20 {
    21 	system( ("del", "average.txt") );
    22 }
    24 # Run the Header script
    25 system( ("perl", "header.pl", "$bldRoot", "$milestone", "$ARGV[2]" ) );
    27 #
    28 # now run the average2 script for each file in the logs directory
    29 #
    30 while( <Logs\\*.txt> ){
    31   $line = $_;
    32   $cnt++;
    33   if ($line =~ /-log.txt/ ){
    34     print( "File $cnt: $line\t" );
    35     @nameParts = split( /-/, $line );
    36     @nameNoDir = split( /\\/, $nameParts[0] );
    37     print( "Name: $nameNoDir[1]\n" );
    38     if ($nameNoDir[1] eq "") {
    39       print ("Skipping $line\n");
    40     } else {
    41       system( ("perl", "Averagetable2.pl", "$nameNoDir[1]", "$line", "$cnt", "$bldRoot", "$nameNoDir[1]", "$ARGV[2]" ) );
    42     }
    43   } else {
    44     print ("Skipping file $line\n");
    45   }
    46 }
    48 # Run the Footer script
    49 system( ("perl", "footer.pl", "$bldRoot", "$milestone" ) );
    51 print("Processed $cnt logs\n");

mercurial