From 253adc083aed58ee34200da9e8dac111926a7092 Mon Sep 17 00:00:00 2001 From: alegrand Date: Mon, 3 Oct 2005 11:54:26 +0000 Subject: [PATCH] Add the ability to print the message location in the code. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1744 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- tools/MSG_visualization/colorize.pl | 33 ++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/tools/MSG_visualization/colorize.pl b/tools/MSG_visualization/colorize.pl index 586b4792d8..a412484439 100755 --- a/tools/MSG_visualization/colorize.pl +++ b/tools/MSG_visualization/colorize.pl @@ -32,6 +32,30 @@ my (@coltab) = ( my %pid; +# Get options +# +while (($_ = $ARGV[0]) =~ /^-/) { + shift; + if (/-location/i) { + $opt_print_location = 1; shift; + } elsif (/-h(elp)?$|-u(sage)?$/i) { + print< + + where is a text file of values or '-' for STDIN + +Options: () denote short version + + -location Print the location in the code of the message. +EOH +; + exit; + } +} + sub pidcolor { my $pid = shift; @@ -42,6 +66,7 @@ sub pidcolor { return $coltab[$pid{$pid}]; } +# Read the messages and do the job while (<>) { $orgline = $thisline = $_; @@ -54,11 +79,17 @@ while (<>) { $xbt_channel=$6; $message=$7; + $location =~ s/:$//; + print $col_norm; printf "[% 10.3f]",$date; print pidcolor($pid); - printf "[%10s:%-10s]",$host,$procname; + if($opt_print_location) { + printf "[%10s:%-10s %s ]",$host,$procname,$location; + } else { + printf "[%10s:%-10s]",$host,$procname; + } print " $message"; print $col_norm."\n"; } elsif ( $thisline =~ /^==(\d+)== (.*)$/) { -- 2.20.1