[PATCH i-g-t] runner/resultgen: Fix subtest runtimes

Kira, Piotr piotr.kira at intel.com
Wed Dec 6 11:06:14 UTC 2023


I've tested it manually, it works.

Tested-by: Piotr Kira <piotr.kira at intel.com>


________________________________
From: Kamil Konieczny <kamil.konieczny at linux.intel.com>
Sent: Thursday, November 30, 2023 4:09 PM
To: igt-dev at lists.freedesktop.org <igt-dev at lists.freedesktop.org>
Cc: Kira, Piotr <piotr.kira at intel.com>; Petri Latvala <adrinael at adrinael.net>; Kamil Konieczny <kamil.konieczny at linux.intel.com>
Subject: [PATCH i-g-t] runner/resultgen: Fix subtest runtimes

From: Piotr Kira <piotr.kira at intel.com>

Runtimes for single subtest are not included in results json object
after switching to socket communication. Make times for both subtests
and dynamic subtests when using comms.

v2: added GitLab issue number, added Petri to Cc (Kamil)
  reformat so it could be applied (Kamil)

Cc: Petri Latvala <adrinael at adrinael.net>
Fixes: 9d889fa6b8f0 ("runner: Use socket communications")
Closes: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/132
Signed-off-by: Piotr Kira <piotr.kira at intel.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
---
 runner/resultgen.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/runner/resultgen.c b/runner/resultgen.c
index b00bb6ba5..63f5b26d7 100644
--- a/runner/resultgen.c
+++ b/runner/resultgen.c
@@ -1262,6 +1262,9 @@ struct comms_context
         char *subtestresult;
         char *dynamicsubtestresult;

+       double subtest_execution_time;
+       double dynamic_subtest_execution_time;
+
         char *cmdline;
         int exitcode;

@@ -1321,6 +1324,7 @@ static void comms_finish_subtest(struct comms_context *context)
         if (context->subtestresult == NULL)
                 context->subtestresult = strdup("incomplete");
         set_result(context->current_test, context->subtestresult);
+       add_runtime(context->current_test, context->subtest_execution_time);

         free(context->subtestresult);
         context->subtestresult = NULL;
@@ -1343,6 +1347,7 @@ static void comms_finish_dynamic_subtest(struct comms_context *context)
         if (context->dynamicsubtestresult == NULL)
                 context->dynamicsubtestresult = strdup("incomplete");
         set_result(context->current_dynamic_subtest, context->dynamicsubtestresult);
+       add_runtime(context->current_dynamic_subtest, context->dynamic_subtest_execution_time);

         free(context->dynamicsubtestresult);
         context->dynamicsubtestresult = NULL;
@@ -1617,6 +1622,7 @@ static bool comms_handle_subtest_result(const struct runnerpacket *packet,
                                     strlen(helper.subtestresult.result),
                                     &mappedresult, NULL);
                 context->subtestresult = strdup(mappedresult);
+               context->subtest_execution_time = strtod(helper.subtestresult.timeused, NULL);
         }

         context->state = STATE_BETWEEN_SUBTESTS;
@@ -1757,6 +1763,7 @@ static bool comms_handle_dynamic_subtest_result(const struct runnerpacket *packe
                                     strlen(helper.dynamicsubtestresult.result),
                                     &mappedresult, NULL);
                 context->dynamicsubtestresult = strdup(mappedresult);
+               context->dynamic_subtest_execution_time = strtod(helper.dynamicsubtestresult.timeused, NULL);
         }

         context->state = STATE_BETWEEN_DYNAMIC_SUBTESTS;
--
2.42.0

---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/igt-dev/attachments/20231206/8bbe898b/attachment-0001.htm>


More information about the igt-dev mailing list