Compare commits

..

3 Commits

3 changed files with 47 additions and 31 deletions

View File

@ -34,6 +34,7 @@ my $remote_root = '/home/lab/smchurla/Documents/failnix';
my $remote_db_conf = "$remote_root/db.conf"; my $remote_db_conf = "$remote_root/db.conf";
my $remote_builds_dir = "$remote_root/builds"; my $remote_builds_dir = "$remote_root/builds";
my $remote_runner = "$remote_root/scripts/runner.pl"; my $remote_runner = "$remote_root/scripts/runner.pl";
my $remote_log = "$remote_root/runner.log";
# The mars db is bound to local port 3306 over SSH. # The mars db is bound to local port 3306 over SSH.
# - This requires using the configured 'mars' # - This requires using the configured 'mars'
@ -111,15 +112,22 @@ foreach (@experiments) {
} }
# Kill old screen session (don't check success as a session might not exist) # Kill old screen session (don't check success as a session might not exist)
say "Killing previous screen session with name $screen_name"; # say "Killing previous screen session with name $screen_name";
$ssh->system( "screen", "-XS", $screen_name, "quit" ); # $ssh->system( "screen", "-XS", $screen_name, "quit" );
# Start new screen session # Start new screen session
my $invoke_runner = "perl " . shell_quote($remote_runner); # my $invoke_runner =
say # "cd " . shell_quote($remote_root) . " && perl " . shell_quote($remote_runner);
"Starting new screen session with name $screen_name and command $invoke_runner"; # say
remote( $ssh, "screen", "-dmS", $screen_name, "sh", "-lc", # "Starting new screen session with name $screen_name and command $invoke_runner";
"exec $invoke_runner" ); # remote( $ssh, "screen", "-dmS", $screen_name, "sh", "-lc",
# "exec $invoke_runner" );
remote( $ssh,
"nohup sh -c "
. shell_quote("cd $remote_root && perl $remote_runner") . " >"
. shell_quote($remote_log)
. " 2>&1 < /dev/null &" );
say "Started remote runner for ", scalar(@experiments), " experiments"; say "Started remote runner for ", scalar(@experiments), " experiments";

View File

@ -46,6 +46,7 @@ my $dbh = DBI->connect( "DBI:MariaDB:host=$db_host;port=$db_port",
or die 'Failed to connect to database: ' . $DBI::errstr; or die 'Failed to connect to database: ' . $DBI::errstr;
say 'Connected to database'; say 'Connected to database';
while (1) {
say 'Existing databases:'; say 'Existing databases:';
my @db_names = my @db_names =
sort sort
@ -53,10 +54,15 @@ my @db_names =
grep { !/information_schema|smchurla_ll/ } $dbh->data_sources(); grep { !/information_schema|smchurla_ll/ } $dbh->data_sources();
foreach (@db_names) { say " - $_"; } foreach (@db_names) { say " - $_"; }
print 'Enter name to delete: '; print 'Enter single name or comma-separated list to delete: ';
my $db_sel = <STDIN>; my $db_sel = <STDIN>;
chomp $db_sel; chomp $db_sel;
$dbh->do("drop database `$db_sel`") my @selected_dbs = $db_sel eq "all" ? @db_names : split( ',', $db_sel );
foreach (@selected_dbs) {
$dbh->do("drop database `$_`")
or die "Failed to drop database: " . $dbh->errstr; or die "Failed to drop database: " . $dbh->errstr;
}
}
$dbh->disconnect or warn $dbh->errstr; $dbh->disconnect or warn $dbh->errstr;

View File

@ -115,7 +115,9 @@ sub import_trace {
system( system(
"$fail_import --database-option-file $remote_db_conf -t $remote_builds_dir/$experiment/trace.pb -i ElfImporter --objdump objdump -e $remote_builds_dir/$experiment/system.elf -v $experiment -b regs" "$fail_import --database-option-file $remote_db_conf -t $remote_builds_dir/$experiment/trace.pb -i ElfImporter --objdump objdump -e $remote_builds_dir/$experiment/system.elf -v $experiment -b regs"
); );
system( "$fail_prune --database-option-file $remote_db_conf -v $experiment -b %% --overwrite" ); system(
"$fail_prune --database-option-file $remote_db_conf -v $experiment -b %% --overwrite"
);
# notify("Importing $experiment trace complete."); # notify("Importing $experiment trace complete.");
} }
@ -137,8 +139,8 @@ sub inject {
} }
# parent -> client # parent -> client
# my $count = cpu_count(); # my $count = 1;
my $count = 1; my $count = cpu_count();
# "-Wf,--catch-write-textsegment", # "-Wf,--catch-write-textsegment",
system( system(