diff options
-rw-r--r-- | TYDAL-CHANGE-LOG | 1 | ||||
-rw-r--r-- | pts-core/functions/pts-functions-run.php | 4 | ||||
-rw-r--r-- | pts-core/functions/pts-functions.php | 22 | ||||
-rw-r--r-- | pts-core/functions/pts-init.php | 1 | ||||
-rw-r--r-- | pts-core/modules/system_monitor.php | 5 |
5 files changed, 27 insertions, 6 deletions
diff --git a/TYDAL-CHANGE-LOG b/TYDAL-CHANGE-LOG index 8194ba8..82e752e 100644 --- a/TYDAL-CHANGE-LOG +++ b/TYDAL-CHANGE-LOG @@ -36,5 +36,6 @@ Phoronix Test Suite (Git) - pts-core: Standardize all pts-core official functions with pts_, sw_, hw_, or read_ prefix - pts-core: Fix graphics constant warnings generated in pts_extended_init() - pts-core: PTS_START_TIME -> PTS_INIT_TIME and add pts_elapsed_time() function to return the time (in seconds) that the option or pts-core has been running +- pts-core: Eliminate THIS_RUN_TIME constant and add preferred way of using pts_unique_runtime_identifier() - tandem_XmlReader: Switch caching from using a GLOBALS variable to using a static variable within the XML reading class - system_monitor: Update it to work with new APIs diff --git a/pts-core/functions/pts-functions-run.php b/pts-core/functions/pts-functions-run.php index 03e8d7b..fafc556 100644 --- a/pts-core/functions/pts-functions-run.php +++ b/pts-core/functions/pts-functions-run.php @@ -493,9 +493,11 @@ function pts_run_test($test_identifier, $extra_arguments = "", $arguments_descri pts_user_message($pre_run_message); + $runtime_identifier = pts_unique_runtime_identifier(); + for($i = 0; $i < $times_to_run; $i++) { - $benchmark_log_file = TEST_ENV_DIR . $test_identifier . "/" . $test_identifier . "-" . THIS_RUN_TIME . "-" . ($i + 1) . ".log"; + $benchmark_log_file = TEST_ENV_DIR . $test_identifier . "/" . $test_identifier . "-" . $runtime_identifier . "-" . ($i + 1) . ".log"; $start_timer = TEST_LIBRARIES_DIR . "timer-start.sh"; $stop_timer = TEST_LIBRARIES_DIR . "timer-stop.sh"; $timed_kill = TEST_LIBRARIES_DIR . "timed-kill.sh"; diff --git a/pts-core/functions/pts-functions.php b/pts-core/functions/pts-functions.php index 9c0aea3..e20b189 100644 --- a/pts-core/functions/pts-functions.php +++ b/pts-core/functions/pts-functions.php @@ -80,7 +80,7 @@ function pts_run_option_command($command, $pass_args = null, $command_descriptor $command = strtolower($command); pts_clear_assignments(); - pts_set_assignment("START_TIME", time()); + pts_set_assignment(array("START_TIME", "THIS_OPTION_IDENTIFIER"), time()); // For now THIS_OPTION_IDENTIFIER is also time pts_set_assignment("COMMAND", $command_descriptor); if(is_file("pts-core/options/" . $command . ".php")) @@ -186,7 +186,7 @@ function pts_env_variables() "OS_VERSION" => sw_os_version(), "OS_ARCH" => sw_os_architecture(), "OS_TYPE" => OPERATING_SYSTEM, - "THIS_RUN_TIME" => THIS_RUN_TIME + "THIS_RUN_TIME" => PTS_INIT_TIME ); } @@ -402,6 +402,19 @@ function pts_bool_question($question, $default = true, $question_id = "UNKNOWN") return $answer; } +function pts_unique_runtime_identifier() +{ + if(pts_is_assignment("THIS_OPTION_IDENTIFIER")) + { + $identifier = pts_read_assignment("THIS_OPTION_IDENTIFIER"); + } + else + { + $identifier = PTS_INIT_TIME; + } + + return $identifier; +} function pts_clean_information_string($str) { // Clean a string containing hardware information of some common things to change/strip out @@ -758,10 +771,15 @@ function pts_user_message($message) } function pts_set_assignment_once($assignment, $value) { + $set_assignment = false; + if(!pts_is_assignment($assignment)) { pts_set_assignment($assignment, $value); + $set_assignment = true; } + + return $set_assignment; } function pts_set_assignment($assignment, $value) { diff --git a/pts-core/functions/pts-init.php b/pts-core/functions/pts-init.php index 46ae5e9..1397732 100644 --- a/pts-core/functions/pts-init.php +++ b/pts-core/functions/pts-init.php @@ -61,7 +61,6 @@ function pts_basic_init() // PTS Defines define("PTS_TEMP_DIR", "/tmp/phoronix-test-suite/"); define("PHP_BIN", getenv("PHP_BIN")); - define("THIS_RUN_TIME", time()); define("PTS_INIT_TIME", time()); // Run in debug mode? diff --git a/pts-core/modules/system_monitor.php b/pts-core/modules/system_monitor.php index 157f337..b548880 100644 --- a/pts-core/modules/system_monitor.php +++ b/pts-core/modules/system_monitor.php @@ -459,11 +459,12 @@ class system_monitor extends pts_module_interface $first_run = false; } } + $save_filename = pts_unique_runtime_identifier() . '-' . $image_count . "." . strtolower($t->getRenderer()); $t->loadGraphVersion(PTS_VERSION); - $t->save_graph(pts_module::save_dir() . THIS_RUN_TIME . '-' . $image_count . "." . strtolower($t->getRenderer())); + $t->save_graph(pts_module::save_dir() . $save_filename); $t->renderGraph(); - array_push($image_list, THIS_RUN_TIME . '-' . $image_count . "." . strtolower($t->getRenderer())); + array_push($image_list, $save_filename); $image_count++; } } |