[PATCH i-g-t 03/24] No level in log

Petri Latvala petri.latvala at intel.com
Thu Mar 4 09:05:59 UTC 2021


---
 lib/runnercomms.c                   |  8 ++------
 lib/runnercomms.h                   |  4 +---
 lib/tests/igt_runnercomms_packets.c | 15 ++++++---------
 3 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/lib/runnercomms.c b/lib/runnercomms.c
index c0716fc7..d300fe7f 100644
--- a/lib/runnercomms.c
+++ b/lib/runnercomms.c
@@ -148,7 +148,6 @@ union runnerpacket_read_helper read_runnerpacket(const struct runnerpacket *pack
 	switch (packet->type) {
 	case PACKETTYPE_LOG:
 		read_integer(&ret.log.stream, sizeof(ret.log.stream), &p, &sizeleft);
-		read_integer(&ret.log.level, sizeof(ret.log.level), &p, &sizeleft);
 		read_cstring(&ret.log.text, &p, &sizeleft);
 
 		if (ret.log.text == NULL)
@@ -218,13 +217,13 @@ union runnerpacket_read_helper read_runnerpacket(const struct runnerpacket *pack
 	return ret;
 }
 
-struct runnerpacket *runnerpacket_log(uint8_t stream, uint8_t level, const char *text)
+struct runnerpacket *runnerpacket_log(uint8_t stream, const char *text)
 {
 	struct runnerpacket *packet;
 	uint32_t size;
 	char *p;
 
-	size = sizeof(struct runnerpacket) + sizeof(stream) + sizeof(level) + strlen(text) + 1;
+	size = sizeof(struct runnerpacket) + sizeof(stream) + strlen(text) + 1;
 	packet = malloc(size);
 
 	packet->size = size;
@@ -237,9 +236,6 @@ struct runnerpacket *runnerpacket_log(uint8_t stream, uint8_t level, const char
 	memcpy(p, &stream, sizeof(stream));
 	p += sizeof(stream);
 
-	memcpy(p, &level, sizeof(level));
-	p += sizeof(level);
-
 	strcpy(p, text);
 	p += strlen(text) + 1;
 
diff --git a/lib/runnercomms.h b/lib/runnercomms.h
index 87d8c771..41e92f17 100644
--- a/lib/runnercomms.h
+++ b/lib/runnercomms.h
@@ -61,7 +61,6 @@ union runnerpacket_read_helper {
 		uint32_t type;
 
 		uint8_t stream;
-		uint8_t level;
 		const char *text;
 	} log;
 
@@ -141,7 +140,6 @@ typedef enum runnerpacket_type {
       /*
        * Normal log message.
        * uint8_t: 1 = stdout, 2 = stderr
-       * uint8_t: Log level
        * cstring: Log text
        */
 
@@ -196,7 +194,7 @@ typedef enum runnerpacket_type {
 
 } runnerpacket_type_t;
 
-struct runnerpacket *runnerpacket_log(uint8_t stream, uint8_t level, const char *text);
+struct runnerpacket *runnerpacket_log(uint8_t stream, const char *text);
 struct runnerpacket *runnerpacket_exec(char **argv);
 struct runnerpacket *runnerpacket_exit(int32_t exitcode, const char *timeused);
 struct runnerpacket *runnerpacket_subtest_start(const char *name);
diff --git a/lib/tests/igt_runnercomms_packets.c b/lib/tests/igt_runnercomms_packets.c
index 3ae21005..1550c485 100644
--- a/lib/tests/igt_runnercomms_packets.c
+++ b/lib/tests/igt_runnercomms_packets.c
@@ -42,18 +42,16 @@ igt_main
 		struct runnerpacket *packet;
 		union runnerpacket_read_helper helper;
 
-		uint8_t num1 = 1;
-		uint8_t num2 = 2;
+		uint8_t num = 1;
 		const char *text = "This is a text";
 
-		packet = runnerpacket_log(num1, num2, text);
+		packet = runnerpacket_log(num, text);
 		igt_assert(packet != NULL);
 		igt_assert_eq(packet->type, PACKETTYPE_LOG);
 		helper = read_runnerpacket(packet);
 
 		igt_assert_eq(helper.type, PACKETTYPE_LOG);
-		igt_assert_eq(helper.log.stream, num1);
-		igt_assert_eq(helper.log.level, num2);
+		igt_assert_eq(helper.log.stream, num);
 		igt_assert_eqstr(helper.log.text, text);
 
 		free(packet);
@@ -87,7 +85,7 @@ igt_main
 		struct runnerpacket *packet;
 		union runnerpacket_read_helper helper;
 
-		packet = runnerpacket_log(1, 2, "Hello");
+		packet = runnerpacket_log(1, "Hello");
 		igt_assert(packet != NULL);
 		igt_assert_eq(packet->type, PACKETTYPE_LOG);
 
@@ -103,10 +101,9 @@ igt_main
 		struct runnerpacket *packet;
 		union runnerpacket_read_helper helper;
 
-		uint8_t num1 = 1;
-		uint8_t num2 = 2;
+		uint8_t num = 1;
 		const char *text = "This is text";
-		packet = runnerpacket_log(num1, num2, text);
+		packet = runnerpacket_log(num, text);
 		igt_assert(packet != NULL);
 		igt_assert_eq(packet->type, PACKETTYPE_LOG);
 
-- 
2.29.2



More information about the Intel-gfx-trybot mailing list