commsfwtools/commstools/svg/tracklife.pl
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 # Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 # All rights reserved.
       
     3 # This component and the accompanying materials are made available
       
     4 # under the terms of "Eclipse Public License v1.0"
       
     5 # which accompanies this distribution, and is available
       
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 #
       
     8 # Initial Contributors:
       
     9 # Nokia Corporation - initial contribution.
       
    10 #
       
    11 # Contributors:
       
    12 #
       
    13 # Description:
       
    14 #
       
    15 
       
    16 use strict;
       
    17 open LOG, "log.seq" or die "Failed to open log.seq";
       
    18 my %ob;
       
    19 my $line = 0;
       
    20 while(<LOG>)
       
    21 {
       
    22   chomp;
       
    23   ++$line;
       
    24   if($_ =~ /t .+\(([0-9a-f]+) created\)/i)
       
    25   {
       
    26     if(defined $ob{$1})
       
    27     {
       
    28       print "ERROR[#$line]: double create of $1 - was [ $ob{$1}->[1] ] @ #$ob{$1}->[0], now [ $_ ]\n";
       
    29     }
       
    30     $ob{$1} = [$line, $_];
       
    31   }
       
    32   elsif($_ =~ /t .+\(([0-9a-f]+) destroyed\)/i)
       
    33   {
       
    34     if(!defined $ob{$1})
       
    35     {
       
    36       print "ERROR: destroy of unknown $1 [ $_ ]\n";
       
    37     }
       
    38     delete $ob{$1};
       
    39   }
       
    40   elsif($_ =~ /^l \^Booting$/)
       
    41   {
       
    42   	if(DumpObjs())
       
    43   	{
       
    44 	  print "\nRebooting...\n";
       
    45   	}	
       
    46   	%ob = ();
       
    47   }
       
    48 }
       
    49 DumpObjs();
       
    50 
       
    51 sub DumpObjs()
       
    52 {
       
    53   my @vals = sort { $a->[0] <=> $b->[0] } values %ob;
       
    54   if($#vals >= 0)
       
    55   {
       
    56     print "\nRemaining objs:\n";
       
    57     for (@vals)
       
    58     {
       
    59       print "$_->[1] [#$_->[0]]\n";
       
    60     }
       
    61     return 1;
       
    62   }
       
    63   return 0;
       
    64 }
       
    65