diff mbox series

[OSSTEST,5/6] timing traces: Executive: Provide processing timestamp facilities

Message ID 20200810112047.30285-5-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series [OSSTEST,1/6] cr-publish-flight-logs: Make a proper option parser | expand

Commit Message

Ian Jackson Aug. 10, 2020, 11:20 a.m. UTC
Nothing uses these yet.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/Executive.pm | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm
index c46a979d..1e94b282 100644
--- a/Osstest/Executive.pm
+++ b/Osstest/Executive.pm
@@ -51,6 +51,7 @@  BEGIN {
                       report_run_getinfo report_altcolour
                       report_altchangecolour opendb_tests
                       report_blessingscond report_find_push_age_info
+		      log_stderr_timestamped
                       tcpconnect_queuedaemon plan_search
                       manual_allocation_base_jobinfo
                       alloc_resources alloc_resources_rollback_begin_work
@@ -293,11 +294,23 @@  sub restrictflight_arg ($) {
         $restrictflight_cond .= " AND flights.flight != $_"
 	    foreach split /,/, $1;
 	return 1;
+    } elsif ($arg =~ m/^--report-processing-start-time$/) {
+	# This functionality is wanted by all the callers of
+	# restrictflight_arg and is here for convenience, rather than
+	# out of principle.
+	log_stderr_timestamped("starting...");
+	return 1;
     } else {
 	return 0;
     }
 }
 
+sub log_stderr_timestamped ($) {
+    my $us = $0;
+    $us =~ s{.*/}{};
+    print STDERR (show_abs_time time)." $us: @_\n";
+}
+
 sub restrictflight_cond () {
     return "($restrictflight_cond)";
 }