[igt-dev] [PATCH i-g-t] runner: Reset disk usage tracking on subtest change

Petri Latvala petri.latvala at intel.com
Tue Nov 29 08:34:27 UTC 2022


Disk space usage tracking is supposed to be per (dynamic)
subtest. Remember to reset the usage tracker when subtest changes.

Signed-off-by: Petri Latvala <petri.latvala at intel.com>
Cc: Arkadiusz Hiler <arek at hiler.eu>
Cc: Kamil Konieczny <kamil.konieczny at linux.intel.com>
Cc: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 runner/executor.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/runner/executor.c b/runner/executor.c
index 2feef2c9..d2253082 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -1101,7 +1101,6 @@ static int monitor_output(pid_t child,
 				}
 
 				write_packet_with_canary(outputs[_F_SOCKET], packet, settings->sync);
-				disk_usage += packet->size;
 
 				/*
 				 * runner sends EXEC itself before executing
@@ -1112,8 +1111,12 @@ static int monitor_output(pid_t child,
 					socket_comms_used = true;
 
 				if (packet->type == PACKETTYPE_SUBTEST_START ||
-				    packet->type == PACKETTYPE_DYNAMIC_SUBTEST_START)
+				    packet->type == PACKETTYPE_DYNAMIC_SUBTEST_START) {
 					time_last_subtest = time_now;
+					disk_usage = 0;
+				}
+
+				disk_usage += packet->size;
 
 				if (settings->log_level >= LOG_LEVEL_VERBOSE) {
 					runnerpacket_read_helper helper = {};
-- 
2.30.2



More information about the igt-dev mailing list