From 81c3e40d5459c4fc20c58d6e9fb4ec60e78703b6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Aug 2026 00:21:54 +0000 Subject: [PATCH 1/2] Initial plan From 58af7ceb06d548612087035ff18f26c6e1a8de9a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Aug 2026 00:23:54 +0000 Subject: [PATCH 2/2] Collect system info in consecutive tests mode with test_label association - Add test_label column to system_info table and system_info_view - Update SQL_SYS_INFO constant to include test_label - Collect system info before each command in consecutive (non-parallel) mode - Pass test label to associate system snapshots with individual commands - Update parallel mode to pass empty test_label for compatibility - Update insert.sql test data with test_label values Co-authored-by: christiam <736979+christiam@users.noreply.github.com> --- bin/driver.pl | 14 ++++++++++++-- ddl/create.sql | 5 ++++- ddl/insert.sql | 4 ++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/bin/driver.pl b/bin/driver.pl index 6a631ba..d5c2537 100755 --- a/bin/driver.pl +++ b/bin/driver.pl @@ -18,7 +18,7 @@ use constant SQL_HOST_INFO => "INSERT INTO host_info(name,platform,num_cpus,cpu_speed,ram) VALUES(?,?,?,?,?)"; use constant SQL_GET_HOST_ID => "SELECT rowid from host_info where name = ?"; use constant SQL_RUNTIME => "INSERT INTO runtime(label,elapsed_time,user_time,system_time,pcpu,mrss,arss,avg_mem_usage,exit_status,host_id,setup_exit_status,teardown_exit_status) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)"; -use constant SQL_SYS_INFO => "INSERT INTO system_info(host_id, used_memory, free_memory, shared_memory, cached_memory, available_memory, pmem_usage, pcpu_usage) VALUES(?,?,?,?,?,?,?,?)"; +use constant SQL_SYS_INFO => "INSERT INTO system_info(host_id, used_memory, free_memory, shared_memory, cached_memory, available_memory, pmem_usage, pcpu_usage, test_label) VALUES(?,?,?,?,?,?,?,?,?)"; use constant INVALID_SYSINFO => -1.0; my $dbname = "data/timings.db"; @@ -138,7 +138,7 @@ sub main return if ($$mem{PMEM_USED} == INVALID_SYSINFO or $pcpu == INVALID_SYSINFO); TRACE("system_info: mem: $$mem{PMEM_USED}%, CPU=$pcpu%"); my @data = ($$mem{USED}, $$mem{FREE}, $$mem{SHARED}, - $$mem{CACHED}, $$mem{AVAILABLE}, $$mem{PMEM_USED}, $pcpu); + $$mem{CACHED}, $$mem{AVAILABLE}, $$mem{PMEM_USED}, $pcpu, ''); &save2db($sth_sysinfo, $host_id, @data) unless $dry_run; }, $sampling_freq); } @@ -173,6 +173,16 @@ sub main &configure_setting_environment(\%config, $label); my $tmp_fh = File::Temp->new(); my $cmd = "/usr/bin/time -o $tmp_fh $cmd2time"; + unless ($dry_run) { + my $mem = &collect_mem_info(); + my $pcpu = &collect_cpu_usage(); + if ($$mem{PMEM_USED} != INVALID_SYSINFO and $pcpu != INVALID_SYSINFO) { + TRACE("system_info before $label4run: mem: $$mem{PMEM_USED}%, CPU=$pcpu%"); + my @sysdata = ($$mem{USED}, $$mem{FREE}, $$mem{SHARED}, + $$mem{CACHED}, $$mem{AVAILABLE}, $$mem{PMEM_USED}, $pcpu, $label4run); + &save2db($sth_sysinfo, $host_id, @sysdata); + } + } if ($skip_failures) { try { run($cmd); } catch { $run_number = $num_repeats; } finally { $exit_code = $IPC::System::Simple::EXITVAL; }; diff --git a/ddl/create.sql b/ddl/create.sql index c05b8f2..e6dea43 100644 --- a/ddl/create.sql +++ b/ddl/create.sql @@ -52,6 +52,8 @@ CREATE TABLE IF NOT EXISTS system_info ( /* pmem_usage computed in bin/driver.pl */ pmem_usage FLOAT CHECK(pmem_usage > 0.0), pcpu_usage FLOAT CHECK(pcpu_usage > 0.0), + /* label of the test being run when this snapshot was taken */ + test_label VARCHAR(255) DEFAULT '', PRIMARY KEY(timestamp, host_id), FOREIGN KEY(host_id) REFERENCES host_info(rowid) ON DELETE CASCADE ); @@ -91,5 +93,6 @@ SELECT cached_memory, available_memory, pmem_usage, - pcpu_usage + pcpu_usage, + test_label FROM host_info HI join system_info SI on HI.rowid = SI.host_id; diff --git a/ddl/insert.sql b/ddl/insert.sql index e3b72e3..d1ee21f 100644 --- a/ddl/insert.sql +++ b/ddl/insert.sql @@ -8,7 +8,7 @@ INSERT INTO runtime VALUES("foo", "1", "2", "3", "80", 0, 0, 0, 1, '', '', (sele INSERT INTO runtime(label, elapsed_time, system_time, user_time, pcpu,host_id) VALUES("bar", 3, 2, 1, 90, (select rowid from host_info where name='blastdev5')); INSERT INTO runtime(label, elapsed_time, system_time, user_time, pcpu, finished_at, host_id) VALUES("bar", 3, 2, 1, 90, "2020-01-01 15:00:00", (select rowid from host_info where name='blastdev6')); -INSERT INTO system_info(host_id, pmem_usage, pcpu_usage) VALUES((select rowid from host_info where name = "blastdev5"), 55.8, 99.3); -INSERT INTO system_info(host_id, timestamp, pmem_usage, pcpu_usage) VALUES((select rowid from host_info where name = "blastdev5"), "2021-02-18", 57.8, 39.3); +INSERT INTO system_info(host_id, pmem_usage, pcpu_usage, test_label) VALUES((select rowid from host_info where name = "blastdev5"), 55.8, 99.3, 'foo'); +INSERT INTO system_info(host_id, timestamp, pmem_usage, pcpu_usage, test_label) VALUES((select rowid from host_info where name = "blastdev5"), "2021-02-18", 57.8, 39.3, 'bar'); /*INSERT INTO runtime VALUES("bar", "-1", "2", "3", "99");*/ -- INSERT INTO export(label) VALUES("foo");