summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoretienne2006-09-27 15:57:06 +0000
committeretienne2006-09-27 15:57:06 +0000
commitea2a08ccf308e6f3974350076f5515315f27cde8 (patch)
treeb4f4576b48726e8f16adfa9d1e7a821ee718c182
parente607d0461bb9aa024360831eaac12ce727750a2f (diff)
downloadivymon-ea2a08ccf308e6f3974350076f5515315f27cde8.zip
ivymon-ea2a08ccf308e6f3974350076f5515315f27cde8.tar.gz
ivymon-ea2a08ccf308e6f3974350076f5515315f27cde8.tar.bz2
ivymon-ea2a08ccf308e6f3974350076f5515315f27cde8.tar.xz
added a -debug option.
-rwxr-xr-xsrc/ivymon16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/ivymon b/src/ivymon
index 4bb967a..c21d9c1 100755
--- a/src/ivymon
+++ b/src/ivymon
@@ -90,7 +90,7 @@ use Getopt::Long;
use Tk::CmdLine;
use vars qw/$VERSION $opt_help $opt_b $opt_bus $opt_history @opt_bind @opt_send $opt_size
$opt_undersize $opt_out $opt_loadingmode $opt_replayrepeat $opt_replaystartregexp
- $opt_replaystopregexp $opt_replaytimegranularity/;
+ $opt_replaystopregexp $opt_replaytimegranularity $opt_debug/;
# **** VERSION ***
$VERSION = '1.16';
@@ -218,14 +218,14 @@ Tk::CmdLine::SetArguments();
if (not GetOptions('-help', '-history=s', '-b=s', '-bus=s', '-bind=s@',
'-send=s@', '-size=s', '-undersize', '-loadingmode=s',
- '-replayrepeat', '-replaystartregexp=s',
+ '-replayrepeat', '-replaystartregexp=s', '-debug',
'-replaytimegranularity=s',
'-replaystopregexp=s', '-out=s') or $opt_help) {
print "\n";
print "IvyMon version $VERSION\n";
print "\n";
print "Usage: ivymon [-b[us] bus] [-help] [-history length]\n";
- print " [-size size] [-undersize]\n";
+ print " [-size size] [-undersize] [-debug]\n";
print " [-bind regexp1] ... [-bind regexpN] \n";
print " [-send message1] ... [-send messageN] \n";
print " [-loadingmode mode] [-replayrepeat]\n";
@@ -2703,21 +2703,23 @@ sub replayStart {
# if speed rate != 1, time regulation is deactivated
if ($replay_speed != 1) {
$replay_current_factor = $replay_factor;
- #print "replay_speed=$replay_speed => time regulation deactivated\n";
+ print "replay_speed=$replay_speed => time regulation deactivated\n" if $opt_debug;
# if replay is running behind schedule
} elsif ($dt > $data_dt + $replay_maxgap and $replay_current_factor <= $replay_factor) {
$replay_current_factor *= (1 - $replay_regulpct->[0]/100);
- #print "data_dt=$data_dt dt=$dt2 delay=$d [--] replay_factor=$replay_current_factor\n";
+ print "data_dt=$data_dt dt=$dt2 delay=$d [--] replay_factor=$replay_current_factor\n"
+ if $opt_debug;
# if replay is getting ahead of schedule
} elsif ($dt < $data_dt - $replay_maxgap and $replay_current_factor >= $replay_factor) {
$replay_current_factor *= (1 + $replay_regulpct->[1]/100);
- #print "data_dt=$data_dt dt=$dt2 delay=$d [++] replay_factor=$replay_current_factor\n";
+ print "data_dt=$data_dt dt=$dt2 delay=$d [++] replay_factor=$replay_current_factor\n"
+ if $opt_debug;
# if replay is on time
} else {
- #print "data_dt=$data_dt dt=$dt2 delay=$d\n";
+ print "data_dt=$data_dt dt=$dt2 delay=$d\n" if $opt_debug;
$replay_current_factor = $replay_factor;
}