From: alegrand Date: Fri, 11 May 2007 11:07:49 +0000 (+0000) Subject: keeping up with last xbt_log modifications. X-Git-Tag: v3.3~1846 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/156e136f01b023610253de9a5ce4e38c1a1ad0b9 keeping up with last xbt_log modifications. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3514 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/tools/MSG_visualization/colorize.pl b/tools/MSG_visualization/colorize.pl index 366f1cbc00..2c7cc4e048 100755 --- a/tools/MSG_visualization/colorize.pl +++ b/tools/MSG_visualization/colorize.pl @@ -66,32 +66,52 @@ sub pidcolor { return $coltab[$pid{$pid}]; } +sub print_line { + my($host,$procname,$pid,$date,$location,$xbt_channel,$message)=@_; + + print $col_norm; + printf "[% 10.3f]",$date; + + print pidcolor($pid); + + if(defined($location)) { + printf "[%10s:%-10s %s ]",$host,$procname,$location; + } else { + printf "[%10s:%-10s]",$host,$procname; + } + print " $message"; + print $col_norm."\n"; +} + # Read the messages and do the job while (<>) { $orgline = $thisline = $_; - if ( $thisline =~ /^\[([^:]+):([^:]+):\((\d+)\) ([\d\.]*)\] ([^\[]*) \[([^\[]*)\] (.*)$/ ) { + # Typical line [Gatien:slave:(9) 11.243148] msg/gos.c:137: [msg_gos/DEBUG] Action terminated + if ($thisline =~ /^\[([^:]+):([^:]+):\((\d+)\) ([\d\.]*)\] ([^\[]*) \[([^\[]*)\] (.*)$/) { $host=$1; $procname=$2; $pid=$3; $date=$4; - $location=$5; - $xbt_channel=$6; - $message=$7; - - $location =~ s/:$//; - - print $col_norm; - printf "[% 10.3f]",$date; - - print pidcolor($pid); if($opt_print_location) { - printf "[%10s:%-10s %s ]",$host,$procname,$location; + $location=$5; + $location =~ s/:$//; } else { - printf "[%10s:%-10s]",$host,$procname; + $location = undef; } - print " $message"; - print $col_norm."\n"; + $xbt_channel=$6; + $message=$7; + + print_line($host,$procname,$pid,$date,$location,$xbt_channel,$message); + # Typical line [Boivin:slave:(2) 9.269357] [pmm/INFO] ROW: step(2)<>myrow(0). Receive data from TeX + } elsif ($thisline =~ /^\[([^:]+):([^:]+):\((\d+)\) ([\d\.]*)\] \[([^\[]*)\] (.*)$/) { + $host=$1; + $procname=$2; + $pid=$3; + $date=$4; + $xbt_channel=$5; + $message=$6; + print_line($host,$procname,$pid,$date,undef,$xbt_channel,$message); } elsif ( $thisline =~ /^==(\d+)== (.*)$/) { # take care of valgrind outputs print pidcolor($1)."$2\n";