Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Piotr Kira <piotr.kira@intel.com>
Subject: [igt-dev] [PATCH i-g-t] runner/resultgen: Fix subtest runtimes
Date: Thu, 30 Nov 2023 16:09:23 +0100	[thread overview]
Message-ID: <20231130150923.17707-1-kamil.konieczny@linux.intel.com> (raw)

From: Piotr Kira <piotr.kira@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@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@intel.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny@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

             reply	other threads:[~2023-11-30 15:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-30 15:09 Kamil Konieczny [this message]
2023-11-30 17:22 ` [igt-dev] ✓ Fi.CI.BAT: success for runner/resultgen: Fix subtest runtimes Patchwork
2023-11-30 19:04 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-12-01 20:04 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-12-06 11:02 ` [igt-dev] [PATCH i-g-t] " Mauro Carvalho Chehab
2023-12-06 11:06 ` Kira, Piotr
2023-12-08 10:20 ` [i-g-t] " Kira, Piotr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231130150923.17707-1-kamil.konieczny@linux.intel.com \
    --to=kamil.konieczny@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=piotr.kira@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox