All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 0/3] Use Jansson instead of json-c in igt_runner
@ 2022-08-10 13:55 Ryszard Knop
  2022-08-10 13:55 ` [igt-dev] [PATCH i-g-t 1/3] runner: Use Jansson in resultgen instead of json-c Ryszard Knop
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Ryszard Knop @ 2022-08-10 13:55 UTC (permalink / raw)
  To: Development mailing list for IGT GPU Tools

The json-c library has a hard limit of 2GB of its output. While normally
it's not a problem, some very verbose edge cases make the results.json
output go past that limit.

This series converts igt_runner's json-c usage to Jansson.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [igt-dev] [PATCH i-g-t 1/3] runner: Use Jansson in resultgen instead of json-c
  2022-08-10 13:55 [igt-dev] [PATCH i-g-t 0/3] Use Jansson instead of json-c in igt_runner Ryszard Knop
@ 2022-08-10 13:55 ` Ryszard Knop
  2022-08-10 13:55 ` [igt-dev] [PATCH i-g-t 2/3] runner/tests: Fix JSON test data Ryszard Knop
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Ryszard Knop @ 2022-08-10 13:55 UTC (permalink / raw)
  To: Development mailing list for IGT GPU Tools

The json-c library has a hard limit of 2GB of its output. While normally
it's not a problem, some very verbose edge cases make the results.json
output go past that limit.

Jansson has a similar API, can work with files over 2GB and, according
to JSON library and benchmarks, is slightly slower but uses less RAM to
serialize its output. Jansson 2.12+ (released in 2018) is required.

This commit also updates tests to use Jansson, but they need data fixups
to pass (in the next commit).

Signed-off-by: Ryszard Knop <ryszard.knop@intel.com>
---
 runner/meson.build         |  12 +-
 runner/resultgen.c         | 349 +++++++++++++++++--------------------
 runner/resultgen.h         |   2 +-
 runner/runner_json_tests.c | 129 +++++---------
 runner/runner_tests.c      |  60 +++----
 5 files changed, 247 insertions(+), 305 deletions(-)

diff --git a/runner/meson.build b/runner/meson.build
index c3927af5..4e25f70a 100644
--- a/runner/meson.build
+++ b/runner/meson.build
@@ -13,8 +13,8 @@ results_sources = [ 'results.c' ]
 runner_test_sources = [ 'runner_tests.c' ]
 runner_json_test_sources = [ 'runner_json_tests.c' ]
 
-jsonc = dependency('json-c', required: build_runner)
-runner_deps = [jsonc, glib]
+jansson = dependency('jansson', required: build_runner, version: '>=2.12')
+runner_deps = [jansson, glib]
 runner_c_args = []
 
 liboping = dependency('liboping', required: get_option('oping'))
@@ -23,11 +23,11 @@ if liboping.found()
 	runner_c_args += '-DHAVE_OPING=1'
 endif
 
-if not build_tests and jsonc.found()
+if not build_tests and jansson.found()
 	error('Building test runner requires building tests')
 endif
 
-if jsonc.found()
+if jansson.found()
 	subdir('testdata')
 
 	runnerlib = static_library('igt_runner', runnerlib_sources,
@@ -60,14 +60,14 @@ if jsonc.found()
 				 c_args : '-DTESTDATA_DIRECTORY="@0@"'.format(testdata_dir),
 				 link_with : runnerlib,
 				 install : false,
-				 dependencies : [igt_deps, jsonc])
+				 dependencies : [igt_deps, jansson])
 	test('runner', runner_test, timeout : 300)
 
 	runner_json_test = executable('runner_json_test', runner_json_test_sources,
 				      c_args : '-DJSON_TESTS_DIRECTORY="@0@"'.format(join_paths(meson.current_source_dir(), 'json_tests_data')),
 				      link_with : runnerlib,
 				      install : false,
-				      dependencies : [igt_deps, jsonc])
+				      dependencies : [igt_deps, jansson])
 	test('runner_json', runner_json_test, timeout : 300)
 
 	build_info += 'Build test runner: true'
diff --git a/runner/resultgen.c b/runner/resultgen.c
index 479d6d4f..eda31267 100644
--- a/runner/resultgen.c
+++ b/runner/resultgen.c
@@ -5,10 +5,9 @@
 #include <string.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
-#include <sys/types.h>
 #include <unistd.h>
 
-#include <json.h>
+#include <jansson.h>
 
 #include "igt_aux.h"
 #include "igt_core.h"
@@ -40,9 +39,9 @@ struct subtest_list
 
 struct results
 {
-	struct json_object *tests;
-	struct json_object *totals;
-	struct json_object *runtimes;
+	struct json_t *tests;
+	struct json_t *totals;
+	struct json_t *runtimes;
 };
 
 static void add_dynamic_subtest(struct subtest *subtest, char *dynamic)
@@ -257,61 +256,54 @@ static void parse_subtest_result(const char *subtest,
 	parse_result_string(resultstring, linelen - (resultstring - line), result, time);
 }
 
-static struct json_object *get_or_create_json_object(struct json_object *base,
-						     const char *key)
+static struct json_t *get_or_create_json_object(struct json_t *base, const char *key)
 {
-	struct json_object *ret;
+	struct json_t *ret = json_object_get(base, key);
 
-	if (json_object_object_get_ex(base, key, &ret))
+	if (ret)
 		return ret;
 
-	ret = json_object_new_object();
-	json_object_object_add(base, key, ret);
+	ret = json_object();
+	json_object_set_new(base, key, ret);
 
 	return ret;
 }
 
-static void set_result(struct json_object *obj, const char *result)
+static void set_result(struct json_t *obj, const char *result)
 {
-	if (result)
-		json_object_object_add(obj, "result",
-				       json_object_new_string(result));
+	if (!result)
+		return;
+
+	json_object_set_new(obj, "result", json_string(result));
 }
 
-static void add_runtime(struct json_object *obj, double time)
+static void add_runtime(struct json_t *obj, double time)
 {
 	double oldtime;
-	struct json_object *timeobj = get_or_create_json_object(obj, "time");
-	struct json_object *oldend;
+	struct json_t *timeobj = get_or_create_json_object(obj, "time");
+	struct json_t *oldend;
 
-	json_object_object_add(timeobj, "__type__",
-			       json_object_new_string("TimeAttribute"));
-	json_object_object_add(timeobj, "start",
-			       json_object_new_double(0.0));
+	json_object_set_new(timeobj, "__type__", json_string("TimeAttribute"));
+	json_object_set_new(timeobj, "start", json_real(0.0));
 
-	if (!json_object_object_get_ex(timeobj, "end", &oldend)) {
-		json_object_object_add(timeobj, "end",
-				       json_object_new_double(time));
+	if (!(oldend = json_object_get(timeobj, "end"))) {
+		json_object_set_new(timeobj, "end", json_real(time));
 		return;
 	}
 
 	/* Add the runtime to the existing runtime. */
-	oldtime = json_object_get_double(oldend);
+	oldtime = json_real_value(oldend);
 	time += oldtime;
-	json_object_object_add(timeobj, "end",
-			       json_object_new_double(time));
+	json_object_set_new(timeobj, "end", json_real(time));
 }
 
-static void set_runtime(struct json_object *obj, double time)
+static void set_runtime(struct json_t *obj, double time)
 {
-	struct json_object *timeobj = get_or_create_json_object(obj, "time");
-
-	json_object_object_add(timeobj, "__type__",
-			       json_object_new_string("TimeAttribute"));
-	json_object_object_add(timeobj, "start",
-			       json_object_new_double(0.0));
-	json_object_object_add(timeobj, "end",
-			       json_object_new_double(time));
+	struct json_t *timeobj = get_or_create_json_object(obj, "time");
+
+	json_object_set_new(timeobj, "__type__", json_string("TimeAttribute"));
+	json_object_set_new(timeobj, "start", json_real(0.0));
+	json_object_set_new(timeobj, "end", json_real(time));
 }
 
 struct match_item
@@ -396,7 +388,7 @@ static bool is_subtest_result_line(const char *needle, const char *line, const c
 	if (line >= bufend || *line++ != ':')
 		return false;
 
-	if (line >= bufend || *line++ != ' ')
+	if (line >= bufend || *line != ' ')
 		return false;
 
 	return true;
@@ -407,9 +399,9 @@ static void free_matches(struct matches *matches)
 	free(matches->items);
 }
 
-static struct json_object *new_escaped_json_string(const char *buf, size_t len)
+static struct json_t *escaped_json_stringn(const char *buf, size_t len)
 {
-	struct json_object *obj;
+	struct json_t *obj;
 	char *str = NULL;
 	size_t strsize = 0;
 	size_t i;
@@ -435,19 +427,18 @@ static struct json_object *new_escaped_json_string(const char *buf, size_t len)
 		}
 	}
 
-	obj = json_object_new_string_len(str, strsize);
+	obj = json_stringn(str, strsize);
 	free(str);
 
 	return obj;
 }
 
-static void add_igt_version(struct json_object *testobj,
+static void add_igt_version(struct json_t *testobj,
 			    const char *igt_version,
 			    size_t igt_version_len)
 {
 	if (igt_version)
-		json_object_object_add(testobj, "igt-version",
-				       new_escaped_json_string(igt_version, igt_version_len));
+		json_object_set_new(testobj, "igt-version", escaped_json_stringn(igt_version, igt_version_len));
 }
 
 enum subtest_find_pattern {
@@ -603,7 +594,7 @@ static void process_dynamic_subtest_output(const char *piglit_name,
 					   const char *beg,
 					   const char *end,
 					   const char *key,
-					   struct json_object *tests,
+					   struct json_t *tests,
 					   struct subtest *subtest)
 {
 	size_t k;
@@ -620,7 +611,7 @@ static void process_dynamic_subtest_output(const char *piglit_name,
 	}
 
 	for (k = begin_idx + 1; k < result_idx; k++) {
-		struct json_object *current_dynamic_test = NULL;
+		struct json_t *current_dynamic_test = NULL;
 		int dyn_result_idx;
 		char dynamic_name[256];
 		char dynamic_piglit_name[256];
@@ -644,11 +635,10 @@ static void process_dynamic_subtest_output(const char *piglit_name,
 		add_dynamic_subtest(subtest, strdup(dynamic_name));
 		current_dynamic_test = get_or_create_json_object(tests, dynamic_piglit_name);
 
-		json_object_object_add(current_dynamic_test, key,
-				       new_escaped_json_string(dynbeg, dynend - dynbeg));
+		json_object_set_new(current_dynamic_test, key, escaped_json_stringn(dynbeg, dynend - dynbeg));
 		add_igt_version(current_dynamic_test, igt_version, igt_version_len);
 
-		if (!json_object_object_get_ex(current_dynamic_test, "result", NULL)) {
+		if (!json_object_get(current_dynamic_test, "result")) {
 			const char *dynresulttext;
 			double dyntime;
 
@@ -667,11 +657,11 @@ static void process_dynamic_subtest_output(const char *piglit_name,
 			 * attribute this status to our subsubtest.
 			 */
 			if (!strcmp(dynresulttext, "incomplete")) {
-				struct json_object *parent_subtest;
+				struct json_t *parent_subtest;
 
-				if (json_object_object_get_ex(tests, piglit_name, &parent_subtest) &&
-				    json_object_object_get_ex(parent_subtest, "result", &parent_subtest)) {
-					const char *resulttext = json_object_get_string(parent_subtest);
+				if ((parent_subtest = json_object_get(tests, piglit_name)) &&
+				    (parent_subtest = json_object_get(parent_subtest, "result"))) {
+					const char *resulttext = json_string_value(parent_subtest);
 
 					if (!strcmp(resulttext, "abort") ||
 					    !strcmp(resulttext, "notrun"))
@@ -687,14 +677,14 @@ static void process_dynamic_subtest_output(const char *piglit_name,
 
 static bool fill_from_output(int fd, const char *binary, const char *key,
 			     struct subtest_list *subtests,
-			     struct json_object *tests)
+			     struct json_t *tests)
 {
 	char *buf, *bufend, *nullchr;
 	struct stat statbuf;
 	char piglit_name[256];
 	char *igt_version = NULL;
 	size_t igt_version_len = 0;
-	struct json_object *current_test = NULL;
+	struct json_t *current_test = NULL;
 	struct match_needle needles[] = {
 		{ STARTING_SUBTEST, NULL },
 		{ SUBTEST_RESULT, is_subtest_result_line },
@@ -738,8 +728,7 @@ static bool fill_from_output(int fd, const char *binary, const char *key,
 		generate_piglit_name(binary, NULL, piglit_name, sizeof(piglit_name));
 		current_test = get_or_create_json_object(tests, piglit_name);
 
-		json_object_object_add(current_test, key,
-				       new_escaped_json_string(buf, statbuf.st_size));
+		json_object_set_new(current_test, key, escaped_json_stringn(buf, statbuf.st_size));
 		add_igt_version(current_test, igt_version, igt_version_len);
 
 		return true;
@@ -762,12 +751,11 @@ static bool fill_from_output(int fd, const char *binary, const char *key,
 		beg = find_subtest_begin_limit(matches, begin_idx, result_idx, buf, bufend);
 		end = find_subtest_end_limit(matches, begin_idx, result_idx, buf, bufend);
 
-		json_object_object_add(current_test, key,
-				       new_escaped_json_string(beg, end - beg));
+		json_object_set_new(current_test, key, escaped_json_stringn(beg, end - beg));
 
 		add_igt_version(current_test, igt_version, igt_version_len);
 
-		if (!json_object_object_get_ex(current_test, "result", NULL)) {
+		if (!json_object_get(current_test, "result")) {
 			parse_subtest_result(subtests->subs[i].name,
 					     SUBTEST_RESULT,
 					     &resulttext, &time,
@@ -917,24 +905,22 @@ static void generate_formatted_dmesg_line(char *message,
 	*f = '\0';
 }
 
-static void add_dmesg(struct json_object *obj,
+static void add_dmesg(struct json_t *obj,
 		      const char *dmesg, size_t dmesglen,
 		      const char *warnings, size_t warningslen)
 {
-	json_object_object_add(obj, "dmesg",
-			       new_escaped_json_string(dmesg, dmesglen));
+	json_object_set_new(obj, "dmesg", escaped_json_stringn(dmesg, dmesglen));
 
-	if (warnings) {
-		json_object_object_add(obj, "dmesg-warnings",
-				       new_escaped_json_string(warnings, warningslen));
-	}
+	if (warnings)
+		json_object_set_new(obj, "dmesg-warnings",
+				    escaped_json_stringn(warnings, warningslen));
 }
 
-static void add_empty_dmesgs_where_missing(struct json_object *tests,
+static void add_empty_dmesgs_where_missing(struct json_t *tests,
 					   char *binary,
 					   struct subtest_list *subtests)
 {
-	struct json_object *current_test;
+	struct json_t *current_test;
 	char piglit_name[256];
 	char dynamic_piglit_name[256];
 	size_t i, k;
@@ -942,7 +928,7 @@ static void add_empty_dmesgs_where_missing(struct json_object *tests,
 	for (i = 0; i < subtests->size; i++) {
 		generate_piglit_name(binary, subtests->subs[i].name, piglit_name, sizeof(piglit_name));
 		current_test = get_or_create_json_object(tests, piglit_name);
-		if (!json_object_object_get_ex(current_test, "dmesg", NULL)) {
+		if (!json_object_get(current_test, "dmesg")) {
 			add_dmesg(current_test, "", 0, NULL, 0);
 		}
 
@@ -950,7 +936,7 @@ static void add_empty_dmesgs_where_missing(struct json_object *tests,
 			generate_piglit_name_for_dynamic(piglit_name, subtests->subs[i].dynamic_names[k],
 							 dynamic_piglit_name, sizeof(dynamic_piglit_name));
 			current_test = get_or_create_json_object(tests, dynamic_piglit_name);
-			if (!json_object_object_get_ex(current_test, "dmesg", NULL)) {
+			if (!json_object_get(current_test, "dmesg")) {
 				add_dmesg(current_test, "", 0, NULL, 0);
 			}
 		}
@@ -962,7 +948,7 @@ static bool fill_from_dmesg(int fd,
 			    struct settings *settings,
 			    char *binary,
 			    struct subtest_list *subtests,
-			    struct json_object *tests)
+			    struct json_t *tests)
 {
 	char *line = NULL;
 	char *warnings = NULL, *dynamic_warnings = NULL;
@@ -970,8 +956,8 @@ static bool fill_from_dmesg(int fd,
 	size_t linelen = 0;
 	size_t warningslen = 0, dynamic_warnings_len = 0;
 	size_t dmesglen = 0, dynamic_dmesg_len = 0;
-	struct json_object *current_test = NULL;
-	struct json_object *current_dynamic_test = NULL;
+	struct json_t *current_test = NULL;
+	struct json_t *current_dynamic_test = NULL;
 	FILE *f = fdopen(fd, "r");
 	char piglit_name[256];
 	char dynamic_piglit_name[256];
@@ -1135,15 +1121,15 @@ static void fill_from_journal(int fd,
 	char timeoutline[] = "timeout:";
 	int exitcode = INCOMPLETE_EXITCODE;
 	bool has_timeout = false;
-	struct json_object *tests = results->tests;
-	struct json_object *runtimes = results->runtimes;
+	struct json_t *tests = results->tests;
+	struct json_t *runtimes = results->runtimes;
 
 	while ((read = getline(&line, &linelen, f)) > 0) {
 		if (read >= strlen(exitline) && !memcmp(line, exitline, strlen(exitline))) {
 			char *p = strchr(line, '(');
 			char piglit_name[256];
 			double time = 0.0;
-			struct json_object *obj;
+			struct json_t *obj;
 
 			exitcode = atoi(line + strlen(exitline));
 
@@ -1168,7 +1154,7 @@ static void fill_from_journal(int fd,
 				char piglit_name[256];
 				char *p = strchr(line, '(');
 				double time = 0.0;
-				struct json_object *obj;
+				struct json_t *obj;
 
 				generate_piglit_name(entry->binary, last_subtest, piglit_name, sizeof(piglit_name));
 				obj = get_or_create_json_object(tests, piglit_name);
@@ -1194,7 +1180,7 @@ static void fill_from_journal(int fd,
 	if (subtests->size && (exitcode == IGT_EXIT_ABORT || exitcode == GRACEFUL_EXITCODE)) {
 		char *last_subtest = subtests->subs[subtests->size - 1].name;
 		char subtest_piglit_name[256];
-		struct json_object *subtest_obj;
+		struct json_t *subtest_obj;
 
 		generate_piglit_name(entry->binary, last_subtest, subtest_piglit_name, sizeof(subtest_piglit_name));
 		subtest_obj = get_or_create_json_object(tests, subtest_piglit_name);
@@ -1205,7 +1191,7 @@ static void fill_from_journal(int fd,
 	if (subtests->size == 0) {
 		char *subtestname = NULL;
 		char piglit_name[256];
-		struct json_object *obj;
+		struct json_t *obj;
 		const char *result = has_timeout ? "timeout" : result_from_exitcode(exitcode);
 
 		/*
@@ -1251,7 +1237,7 @@ static bool result_is_requested(struct job_list_entry *entry,
 static void prune_subtests(struct settings *settings,
 			   struct job_list_entry *entry,
 			   struct subtest_list *subtests,
-			   struct json_object *tests)
+			   struct json_t *tests)
 {
 	char piglit_name[256];
 	char dynamic_piglit_name[256];
@@ -1265,7 +1251,7 @@ static void prune_subtests(struct settings *settings,
 
 		if (settings->prune_mode == PRUNE_KEEP_DYNAMIC) {
 			if (subtests->subs[i].dynamic_size)
-				json_object_object_del(tests, piglit_name);
+				json_object_del(tests, piglit_name);
 
 			continue;
 		}
@@ -1274,7 +1260,7 @@ static void prune_subtests(struct settings *settings,
 
 		if (settings->prune_mode == PRUNE_KEEP_REQUESTED &&
 		    !result_is_requested(entry, subtests->subs[i].name, NULL)) {
-			json_object_object_del(tests, piglit_name);
+			json_object_del(tests, piglit_name);
 		}
 
 		for (k = 0; k < subtests->subs[i].dynamic_size; k++) {
@@ -1283,7 +1269,7 @@ static void prune_subtests(struct settings *settings,
 			     !result_is_requested(entry, subtests->subs[i].name, subtests->subs[i].dynamic_names[k]))) {
 				generate_piglit_name_for_dynamic(piglit_name, subtests->subs[i].dynamic_names[k],
 								 dynamic_piglit_name, sizeof(dynamic_piglit_name));
-				json_object_object_del(tests, dynamic_piglit_name);
+				json_object_del(tests, dynamic_piglit_name);
 			}
 		}
 	}
@@ -1313,40 +1299,41 @@ static bool stderr_contains_warnings(const char *beg, const char *end)
 	return false;
 }
 
-static bool json_field_has_data(struct json_object *obj, const char *key)
+static bool json_field_has_data(struct json_t *obj, const char *key)
 {
-	struct json_object *field;
+	struct json_t *field;
 
-	if (json_object_object_get_ex(obj, key, &field))
-		return strcmp(json_object_get_string(field), "");
+	if ((field = json_object_get(obj, key)))
+		return strcmp(json_string_value(field), "");
 
 	return false;
 }
 
-static void override_completely_empty_results(struct json_object *obj)
+static void override_completely_empty_results(struct json_t *obj)
 {
 	if (json_field_has_data(obj, "out") ||
 	    json_field_has_data(obj, "err") ||
 	    json_field_has_data(obj, "dmesg"))
 		return;
 
-	json_object_object_add(obj, "out",
-			       json_object_new_string("This test didn't produce any output. "
-						      "The machine probably rebooted ungracefully.\n"));
+	json_object_set_new(obj, "out", json_string("This test didn't produce any output. "
+						    "The machine probably rebooted ungracefully.\n"));
 	set_result(obj, "incomplete");
 }
 
-static void override_result_single(struct json_object *obj)
+static void override_result_single(struct json_t *obj)
 {
 	const char *errtext = "", *result = "";
-	struct json_object *textobj;
+	struct json_t *textobj;
 	bool dmesgwarns = false;
 
-	if (json_object_object_get_ex(obj, "err", &textobj))
-		errtext = json_object_get_string(textobj);
-	if (json_object_object_get_ex(obj, "result", &textobj))
-		result = json_object_get_string(textobj);
-	if (json_object_object_get_ex(obj, "dmesg-warnings", &textobj))
+	if ((textobj = json_object_get(obj, "err")))
+		errtext = json_string_value(textobj);
+
+	if ((textobj = json_object_get(obj, "result")))
+		result = json_string_value(textobj);
+
+	if (json_object_get(obj, "dmesg-warnings"))
 		dmesgwarns = true;
 
 	if (!strcmp(result, "pass") &&
@@ -1368,9 +1355,9 @@ static void override_result_single(struct json_object *obj)
 
 static void override_results(char *binary,
 			     struct subtest_list *subtests,
-			     struct json_object *tests)
+			     struct json_t *tests)
 {
-	struct json_object *obj;
+	struct json_t *obj;
 	char piglit_name[256];
 	char dynamic_piglit_name[256];
 	size_t i, k;
@@ -1396,52 +1383,50 @@ static void override_results(char *binary,
 	}
 }
 
-static struct json_object *get_totals_object(struct json_object *totals,
-					     const char *key)
+static struct json_t *get_totals_object(struct json_t *totals, const char *key)
 {
-	struct json_object *obj = NULL;
+	struct json_t *obj = NULL;
 
-	if (json_object_object_get_ex(totals, key, &obj))
+	if ((obj = json_object_get(totals, key)))
 		return obj;
 
-	obj = json_object_new_object();
-	json_object_object_add(totals, key, obj);
-
-	json_object_object_add(obj, "crash", json_object_new_int(0));
-	json_object_object_add(obj, "pass", json_object_new_int(0));
-	json_object_object_add(obj, "dmesg-fail", json_object_new_int(0));
-	json_object_object_add(obj, "dmesg-warn", json_object_new_int(0));
-	json_object_object_add(obj, "skip", json_object_new_int(0));
-	json_object_object_add(obj, "incomplete", json_object_new_int(0));
-	json_object_object_add(obj, "abort", json_object_new_int(0));
-	json_object_object_add(obj, "timeout", json_object_new_int(0));
-	json_object_object_add(obj, "notrun", json_object_new_int(0));
-	json_object_object_add(obj, "fail", json_object_new_int(0));
-	json_object_object_add(obj, "warn", json_object_new_int(0));
+	obj = json_object();
+	json_object_set_new(totals, key, obj);
+
+	json_object_set_new(obj, "crash", json_integer(0));
+	json_object_set_new(obj, "pass", json_integer(0));
+	json_object_set_new(obj, "dmesg-fail", json_integer(0));
+	json_object_set_new(obj, "dmesg-warn", json_integer(0));
+	json_object_set_new(obj, "skip", json_integer(0));
+	json_object_set_new(obj, "incomplete", json_integer(0));
+	json_object_set_new(obj, "abort", json_integer(0));
+	json_object_set_new(obj, "timeout", json_integer(0));
+	json_object_set_new(obj, "notrun", json_integer(0));
+	json_object_set_new(obj, "fail", json_integer(0));
+	json_object_set_new(obj, "warn", json_integer(0));
 
 	return obj;
 }
 
-static void add_result_to_totals(struct json_object *totals,
-				 const char *result)
+static void add_result_to_totals(struct json_t *totals, const char *result)
 {
-	json_object *numobj = NULL;
-	int old;
+	struct json_t *numobj = NULL;
+	json_int_t old;
 
-	if (!json_object_object_get_ex(totals, result, &numobj)) {
+	if (!(numobj = json_object_get(totals, result))) {
 		fprintf(stderr, "Warning: Totals object without count for %s\n", result);
 		return;
 	}
 
-	old = json_object_get_int(numobj);
-	json_object_object_add(totals, result, json_object_new_int(old + 1));
+	old = json_integer_value(numobj);
+	json_object_set_new(totals, result, json_integer(old + 1));
 }
 
 static void add_to_totals(const char *binary,
 			  struct subtest_list *subtests,
 			  struct results *results)
 {
-	struct json_object *test, *resultobj, *emptystrtotal, *roottotal, *binarytotal;
+	struct json_t *test, *resultobj, *emptystrtotal, *roottotal, *binarytotal;
 	char piglit_name[256];
 	char dynamic_piglit_name[256];
 	const char *result;
@@ -1454,11 +1439,12 @@ static void add_to_totals(const char *binary,
 
 	if (subtests->size == 0) {
 		test = get_or_create_json_object(results->tests, piglit_name);
-		if (!json_object_object_get_ex(test, "result", &resultobj)) {
+		if (!(resultobj = json_object_get(test, "result"))) {
 			fprintf(stderr, "Warning: No results set for %s\n", piglit_name);
 			return;
 		}
-		result = json_object_get_string(resultobj);
+
+		result = json_string_value(resultobj);
 		add_result_to_totals(emptystrtotal, result);
 		add_result_to_totals(roottotal, result);
 		add_result_to_totals(binarytotal, result);
@@ -1468,12 +1454,13 @@ static void add_to_totals(const char *binary,
 	for (i = 0; i < subtests->size; i++) {
 		generate_piglit_name(binary, subtests->subs[i].name, piglit_name, sizeof(piglit_name));
 
-		if (json_object_object_get_ex(results->tests, piglit_name, &test)) {
-			if (!json_object_object_get_ex(test, "result", &resultobj)) {
+		if ((test = json_object_get(results->tests, piglit_name))) {
+			if (!(resultobj = json_object_get(test, "result"))) {
 				fprintf(stderr, "Warning: No results set for %s\n", piglit_name);
 				return;
 			}
-			result = json_object_get_string(resultobj);
+
+			result = json_string_value(resultobj);
 			add_result_to_totals(emptystrtotal, result);
 			add_result_to_totals(roottotal, result);
 			add_result_to_totals(binarytotal, result);
@@ -1483,12 +1470,13 @@ static void add_to_totals(const char *binary,
 			generate_piglit_name_for_dynamic(piglit_name, subtests->subs[i].dynamic_names[k],
 							 dynamic_piglit_name, sizeof(dynamic_piglit_name));
 
-			if (json_object_object_get_ex(results->tests, dynamic_piglit_name, &test)) {
-				if (!json_object_object_get_ex(test, "result", &resultobj)) {
+			if ((test = json_object_get(results->tests, dynamic_piglit_name))) {
+				if (!(resultobj = json_object_get(test, "result"))) {
 					fprintf(stderr, "Warning: No results set for %s\n", dynamic_piglit_name);
 					return;
 				}
-				result = json_object_get_string(resultobj);
+
+				result = json_string_value(resultobj);
 				add_result_to_totals(emptystrtotal, result);
 				add_result_to_totals(roottotal, result);
 				add_result_to_totals(binarytotal, result);
@@ -1542,7 +1530,7 @@ static void try_add_notrun_results(const struct job_list_entry *entry,
 				   struct results *results)
 {
 	struct subtest_list subtests = {};
-	struct json_object *current_test;
+	struct json_t *current_test;
 	size_t i;
 
 	if (entry->subtest_count == 0) {
@@ -1553,10 +1541,10 @@ static void try_add_notrun_results(const struct job_list_entry *entry,
 			return;
 		generate_piglit_name(entry->binary, NULL, piglit_name, sizeof(piglit_name));
 		current_test = get_or_create_json_object(results->tests, piglit_name);
-		json_object_object_add(current_test, "out", json_object_new_string(""));
-		json_object_object_add(current_test, "err", json_object_new_string(""));
-		json_object_object_add(current_test, "dmesg", json_object_new_string(""));
-		json_object_object_add(current_test, "result", json_object_new_string("notrun"));
+		json_object_set_new(current_test, "out", json_string(""));
+		json_object_set_new(current_test, "err", json_string(""));
+		json_object_set_new(current_test, "dmesg", json_string(""));
+		json_object_set_new(current_test, "result", json_string("notrun"));
 	}
 
 	for (i = 0; i < entry->subtest_count; i++) {
@@ -1564,10 +1552,10 @@ static void try_add_notrun_results(const struct job_list_entry *entry,
 
 		generate_piglit_name(entry->binary, entry->subtests[i], piglit_name, sizeof(piglit_name));
 		current_test = get_or_create_json_object(results->tests, piglit_name);
-		json_object_object_add(current_test, "out", json_object_new_string(""));
-		json_object_object_add(current_test, "err", json_object_new_string(""));
-		json_object_object_add(current_test, "dmesg", json_object_new_string(""));
-		json_object_object_add(current_test, "result", json_object_new_string("notrun"));
+		json_object_set_new(current_test, "out", json_string(""));
+		json_object_set_new(current_test, "err", json_string(""));
+		json_object_set_new(current_test, "dmesg", json_string(""));
+		json_object_set_new(current_test, "result", json_string("notrun"));
 		add_subtest(&subtests, strdup(entry->subtests[i]));
 	}
 
@@ -1575,22 +1563,22 @@ static void try_add_notrun_results(const struct job_list_entry *entry,
 	free_subtests(&subtests);
 }
 
-static void create_result_root_nodes(struct json_object *root,
+static void create_result_root_nodes(struct json_t *root,
 				     struct results *results)
 {
-	results->tests = json_object_new_object();
-	json_object_object_add(root, "tests", results->tests);
-	results->totals = json_object_new_object();
-	json_object_object_add(root, "totals", results->totals);
-	results->runtimes = json_object_new_object();
-	json_object_object_add(root, "runtimes", results->runtimes);
+	results->tests = json_object();
+	json_object_set_new(root, "tests", results->tests);
+	results->totals = json_object();
+	json_object_set_new(root, "totals", results->totals);
+	results->runtimes = json_object();
+	json_object_set_new(root, "runtimes", results->runtimes);
 }
 
-struct json_object *generate_results_json(int dirfd)
+struct json_t *generate_results_json(int dirfd)
 {
 	struct settings settings;
 	struct job_list job_list;
-	struct json_object *obj, *elapsed;
+	struct json_t *obj, *elapsed;
 	struct results results;
 	int testdirfd, fd;
 	size_t i;
@@ -1608,13 +1596,12 @@ struct json_object *generate_results_json(int dirfd)
 		return NULL;
 	}
 
-	obj = json_object_new_object();
-	json_object_object_add(obj, "__type__", json_object_new_string("TestrunResult"));
-	json_object_object_add(obj, "results_version", json_object_new_int(10));
-	json_object_object_add(obj, "name",
-			       settings.name ?
-			       json_object_new_string(settings.name) :
-			       json_object_new_string(""));
+	obj = json_object();
+	json_object_set_new(obj, "__type__", json_string("TestrunResult"));
+	json_object_set_new(obj, "results_version", json_integer(10));
+	json_object_set_new(obj, "name", settings.name ?
+					 json_string(settings.name) :
+					 json_string(""));
 
 	if ((fd = openat(dirfd, "uname.txt", O_RDONLY)) >= 0) {
 		char buf[128];
@@ -1623,26 +1610,25 @@ struct json_object *generate_results_json(int dirfd)
 		if (r > 0 && buf[r - 1] == '\n')
 			r--;
 
-		json_object_object_add(obj, "uname",
-				       new_escaped_json_string(buf, r));
+		json_object_set_new(obj, "uname", escaped_json_stringn(buf, r));
 		close(fd);
 	}
 
-	elapsed = json_object_new_object();
-	json_object_object_add(elapsed, "__type__", json_object_new_string("TimeAttribute"));
+	elapsed = json_object();
+	json_object_set_new(elapsed, "__type__", json_string("TimeAttribute"));
 	if ((fd = openat(dirfd, "starttime.txt", O_RDONLY)) >= 0) {
 		char buf[128] = {};
 		read(fd, buf, sizeof(buf));
-		json_object_object_add(elapsed, "start", json_object_new_double(atof(buf)));
+		json_object_set_new(elapsed, "start", json_real(atof(buf)));
 		close(fd);
 	}
 	if ((fd = openat(dirfd, "endtime.txt", O_RDONLY)) >= 0) {
 		char buf[128] = {};
 		read(fd, buf, sizeof(buf));
-		json_object_object_add(elapsed, "end", json_object_new_double(atof(buf)));
+		json_object_set_new(elapsed, "end", json_real(atof(buf)));
 		close(fd);
 	}
-	json_object_object_add(obj, "time_elapsed", elapsed);
+	json_object_set_new(obj, "time_elapsed", elapsed);
 
 	create_result_root_nodes(obj, &results);
 
@@ -1679,21 +1665,17 @@ struct json_object *generate_results_json(int dirfd)
 		char buf[4096];
 		char piglit_name[] = "igt@runner@aborted";
 		struct subtest_list abortsub = {};
-		struct json_object *aborttest = get_or_create_json_object(results.tests, piglit_name);
+		struct json_t *aborttest = get_or_create_json_object(results.tests, piglit_name);
 		ssize_t s;
 
 		add_subtest(&abortsub, strdup("aborted"));
 
 		s = read(fd, buf, sizeof(buf));
 
-		json_object_object_add(aborttest, "out",
-				       new_escaped_json_string(buf, s));
-		json_object_object_add(aborttest, "err",
-				       json_object_new_string(""));
-		json_object_object_add(aborttest, "dmesg",
-				       json_object_new_string(""));
-		json_object_object_add(aborttest, "result",
-				       json_object_new_string("fail"));
+		json_object_set_new(aborttest, "out", escaped_json_stringn(buf, s));
+		json_object_set_new(aborttest, "err", json_string(""));
+		json_object_set_new(aborttest, "dmesg", json_string(""));
+		json_object_set_new(aborttest, "result", json_string("fail"));
 
 		add_to_totals("runner", &abortsub, &results);
 
@@ -1709,9 +1691,8 @@ struct json_object *generate_results_json(int dirfd)
 
 bool generate_results(int dirfd)
 {
-	struct json_object *obj = generate_results_json(dirfd);
-	const char *json_string;
-	int resultsfd;
+	struct json_t *obj = generate_results_json(dirfd);
+	int resultsfd, status;
 
 	if (obj == NULL)
 		return false;
@@ -1722,23 +1703,19 @@ bool generate_results(int dirfd)
 		return false;
 	}
 
-	json_string = json_object_to_json_string_ext(obj, JSON_C_TO_STRING_PRETTY);
+	status = json_dumpfd(obj, resultsfd, JSON_INDENT(4));
 
-	if (json_string == NULL) {
+	if (status != 0) {
 		fprintf(stderr, "resultgen: Failed to create json representation of the results.\n");
 		fprintf(stderr, "           This usually means that the results are too big\n");
 		fprintf(stderr, "           to fit in the memory as the text representation\n");
 		fprintf(stderr, "           is being created.\n\n");
 		fprintf(stderr, "           Either something was spamming the logs or your\n");
 		fprintf(stderr, "           system is very low on free mem.\n");
-
-		close(resultsfd);
-		return false;
 	}
 
-	write(resultsfd, json_string, strlen(json_string));
 	close(resultsfd);
-	return true;
+	return status == 0;
 }
 
 bool generate_results_path(char *resultspath)
diff --git a/runner/resultgen.h b/runner/resultgen.h
index ab0bf108..3bc3bafe 100644
--- a/runner/resultgen.h
+++ b/runner/resultgen.h
@@ -6,6 +6,6 @@
 bool generate_results(int dirfd);
 bool generate_results_path(char *resultspath);
 
-struct json_object *generate_results_json(int dirfd);
+struct json_t *generate_results_json(int dirfd);
 
 #endif
diff --git a/runner/runner_json_tests.c b/runner/runner_json_tests.c
index 7253c906..9f487855 100644
--- a/runner/runner_json_tests.c
+++ b/runner/runner_json_tests.c
@@ -2,122 +2,85 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
-#include <json.h>
+#include <jansson.h>
 
 #include "igt.h"
 #include "resultgen.h"
 
 static char testdatadir[] = JSON_TESTS_DIRECTORY;
 
-static struct json_object *read_json(int fd)
-{
-	struct json_object *obj;
-	struct json_tokener *tok = json_tokener_new();
-	enum json_tokener_error err;
-	char buf[512];
-	ssize_t s;
-
-	do {
-		s = read(fd, buf, sizeof(buf));
-		obj = json_tokener_parse_ex(tok, buf, s);
-	} while ((err = json_tokener_get_error(tok)) == json_tokener_continue);
-
-	igt_assert_eq(err, json_tokener_success);
-
-	json_tokener_free(tok);
-	return obj;
-}
-
-static void compare(struct json_object *one,
-		    struct json_object *two);
+static void compare(struct json_t *one,
+		    struct json_t *two);
 
-static void compare_objects(struct json_object *one,
-			    struct json_object *two)
+static void compare_objects(struct json_t *one, struct json_t *two)
 {
-	json_object_iter iter;
-	struct json_object *subobj;
-
-	json_object_object_foreachC(one, iter) {
-		igt_debug("Key %s\n", iter.key);
-
-		igt_assert(json_object_object_get_ex(two, iter.key, &subobj));
+	const char *key;
+	json_t *one_value, *two_value;
 
-		compare(iter.val, subobj);
+	json_object_foreach(one, key, one_value) {
+		igt_debug("Key %s\n", key);
+		igt_assert(two_value = json_object_get(two, key));
+		compare(one_value, two_value);
 	}
 }
 
-static void compare_arrays(struct json_object *one,
-			   struct json_object *two)
+static void compare_arrays(struct json_t *one, struct json_t *two)
 {
-	size_t i;
-
-	for (i = 0; i < json_object_array_length(one); i++) {
+	for (size_t i = 0; i < json_array_size(one); i++) {
 		igt_debug("Array index %zd\n", i);
-		compare(json_object_array_get_idx(one, i),
-			json_object_array_get_idx(two, i));
+		compare(json_array_get(one, i),
+		        json_array_get(two, i));
 	}
 }
 
-static bool compatible_types(struct json_object *one,
-			     struct json_object *two)
+static bool compatible_types(struct json_t *one, struct json_t *two)
 {
 	/*
-	 * A double of value 0.0 gets written as "0", which gets read
-	 * as an int.
+	 * Numbers should be compatible with each other. A double of
+	 * value 0.0 gets written as "0", which gets read as an int.
 	 */
-	json_type onetype = json_object_get_type(one);
-	json_type twotype = json_object_get_type(two);
-
-	switch (onetype) {
-	case json_type_boolean:
-	case json_type_string:
-	case json_type_object:
-	case json_type_array:
-	case json_type_null:
-		return onetype == twotype;
-		break;
-	case json_type_double:
-	case json_type_int:
-		return twotype == json_type_double || twotype == json_type_int;
-		break;
-	}
+	if (json_is_number(one))
+		return json_is_number(two);
+
+	if (json_is_boolean(one))
+		return json_is_boolean(two);
 
-	igt_assert(!"Cannot be reached");
-	return false;
+	return json_typeof(one) == json_typeof(two);
 }
 
-static void compare(struct json_object *one,
-		    struct json_object *two)
+static void compare(struct json_t *one,
+		    struct json_t *two)
 {
 	igt_assert(compatible_types(one, two));
 
-	switch (json_object_get_type(one)) {
-	case json_type_boolean:
-		igt_assert_eq(json_object_get_boolean(one), json_object_get_boolean(two));
+	switch (json_typeof(one)) {
+	case JSON_NULL:
+	case JSON_TRUE:
+	case JSON_FALSE:
+		/* These values are singletons: */
+		igt_assert(one == two);
 		break;
-	case json_type_double:
-	case json_type_int:
+	case JSON_REAL:
+	case JSON_INTEGER:
 		/*
 		 * A double of value 0.0 gets written as "0", which
 		 * gets read as an int. Both yield 0.0 with
 		 * json_object_get_double(). Comparing doubles with ==
 		 * considered crazy but it's good enough.
 		 */
-		igt_assert(json_object_get_double(one) == json_object_get_double(two));
+		igt_assert_eq_double(json_number_value(one), json_number_value(two));
 		break;
-	case json_type_string:
-		igt_assert(!strcmp(json_object_get_string(one), json_object_get_string(two)));
+	case JSON_STRING:
+		igt_assert(!strcmp(json_string_value(one), json_string_value(two)));
 		break;
-	case json_type_object:
-		igt_assert_eq(json_object_object_length(one), json_object_object_length(two));
+	case JSON_OBJECT:
+		igt_assert_eq(json_object_size(one), json_object_size(two));
 		compare_objects(one, two);
 		break;
-	case json_type_array:
-		igt_assert_eq(json_object_array_length(one), json_object_array_length(two));
+	case JSON_ARRAY:
+		igt_assert_eq(json_array_size(one), json_array_size(two));
 		compare_arrays(one, two);
 		break;
-	case json_type_null:
-		break;
 	default:
 		igt_assert(!"Cannot be reached");
 	}
@@ -127,7 +90,8 @@ static void run_results_and_compare(int dirfd, const char *dirname)
 {
 	int testdirfd = openat(dirfd, dirname, O_RDONLY | O_DIRECTORY);
 	int reference;
-	struct json_object *resultsobj, *referenceobj;
+	struct json_t *resultsobj, *referenceobj;
+	struct json_error_t error;
 
 	igt_assert_fd(testdirfd);
 
@@ -137,14 +101,15 @@ static void run_results_and_compare(int dirfd, const char *dirname)
 	close(testdirfd);
 
 	igt_assert_fd(reference);
-	referenceobj = read_json(reference);
+	referenceobj = json_loadfd(reference, 0, &error);
 	close(reference);
-	igt_assert(referenceobj != NULL);
+	igt_assert_f(referenceobj != NULL, "JSON loading error for %s/%s:%d:%d - %s\n",
+		     dirname, "reference.json", error.line, error.column, error.text);
 
 	igt_debug("Root object\n");
 	compare(resultsobj, referenceobj);
-	igt_assert_eq(json_object_put(resultsobj), 1);
-	igt_assert_eq(json_object_put(referenceobj), 1);
+	json_decref(resultsobj);
+	json_decref(referenceobj);
 }
 
 static const char *dirnames[] = {
diff --git a/runner/runner_tests.c b/runner/runner_tests.c
index 8fe86978..e36ab103 100644
--- a/runner/runner_tests.c
+++ b/runner/runner_tests.c
@@ -4,7 +4,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <json.h>
+#include <jansson.h>
 
 #include "igt.h"
 
@@ -33,20 +33,20 @@ static const char testdatadir[] = TESTDATA_DIRECTORY;
 /* The total number of test binaries in runner/testdata/ */
 #define NUM_TESTDATA_BINARIES 8
 
-static const char *igt_get_result(struct json_object *tests, const char* testname)
+static const char *igt_get_result(struct json_t *tests, const char* testname)
 {
-	struct json_object *obj;
+	struct json_t *obj;
 
-	igt_assert(json_object_object_get_ex(tests, testname, &obj));
-	igt_assert(json_object_object_get_ex(obj, "result", &obj));
+	igt_assert(obj = json_object_get(tests, testname));
+	igt_assert(obj = json_object_get(obj, "result"));
 
-	return json_object_get_string(obj);
+	return json_string_value(obj);
 }
 
-static void igt_assert_no_result_for(struct json_object *tests, const char* testname)
+static void igt_assert_no_result_for(struct json_t *tests, const char* testname)
 {
-	struct json_object *obj;
-	igt_assert(!json_object_object_get_ex(tests, testname, &obj));
+	struct json_t *obj;
+	igt_assert(!(obj = json_object_get(tests, testname)));
 }
 
 
@@ -1552,7 +1552,7 @@ igt_main
 
 		igt_subtest("dynamic-subtests-in-testlist") {
 			struct execute_state state;
-			struct json_object *results, *tests;
+			struct json_t *results, *tests;
 			const char *argv[] = { "runner",
 					       "--allow-non-root",
 					       "--test-list", filename,
@@ -1574,7 +1574,7 @@ igt_main
 			igt_assert_f((results = generate_results_json(dirfd)) != NULL,
 				     "Results parsing failed\n");
 
-			igt_assert(json_object_object_get_ex(results, "tests", &tests));
+			igt_assert(tests = json_object_get(results, "tests"));
 
 			/* Check that the dynamic subtest we didn't request is not reported */
 			igt_assert_no_result_for(tests, "igt@dynamic@dynamic-subtest@failing");
@@ -1582,7 +1582,7 @@ igt_main
 			/* Check that the dynamic subtest we did request is */
 			igt_assert_eqstr(igt_get_result(tests, "igt@dynamic@dynamic-subtest@passing"), "pass");
 
-			igt_assert_eq(json_object_put(results), 1);
+			json_decref(results);
 		}
 
 		igt_fixture {
@@ -1608,7 +1608,7 @@ igt_main
 
 		igt_subtest("dynamic-subtest-failure-should-not-cause-warn") {
 			struct execute_state state;
-			struct json_object *results, *tests;
+			struct json_t *results, *tests;
 			const char *argv[] = { "runner",
 					       "--allow-non-root",
 					       "-t", "^dynamic$",
@@ -1626,11 +1626,11 @@ igt_main
 			igt_assert_f((results = generate_results_json(dirfd)) != NULL,
 				     "Results parsing failed\n");
 
-			igt_assert(json_object_object_get_ex(results, "tests", &tests));
+			igt_assert(tests = json_object_get(results, "tests"));
 
 			igt_assert_eqstr(igt_get_result(tests, "igt@dynamic@dynamic-subtest@passing"), "pass");
 
-			igt_assert_eq(json_object_put(results), 1);
+			json_decref(results);
 		}
 
 		igt_fixture {
@@ -1654,7 +1654,7 @@ igt_main
 
 		igt_subtest("execute-abort-simple") {
 			struct execute_state state;
-			struct json_object *results, *tests;
+			struct json_t *results, *tests;
 			const char *argv[] = { "runner",
 					       "--allow-non-root",
 					       "-t", "^abort-simple$",
@@ -1672,11 +1672,11 @@ igt_main
 			igt_assert_f((results = generate_results_json(dirfd)) != NULL,
 				     "Results parsing failed\n");
 
-			igt_assert(json_object_object_get_ex(results, "tests", &tests));
+			igt_assert(tests = json_object_get(results, "tests"));
 
 			igt_assert_eqstr(igt_get_result(tests, "igt@abort-simple"), "abort");
 
-			igt_assert_eq(json_object_put(results), 1);
+			json_decref(results);
 		}
 
 		igt_fixture {
@@ -1702,7 +1702,7 @@ igt_main
 
 			igt_subtest_f("execute-abort%s", multiple ? "-multiple" : "") {
 				struct execute_state state;
-				struct json_object *results, *tests;
+				struct json_t *results, *tests;
 				const char *argv[] = { "runner",
 						       "--allow-non-root",
 						       "-t", "^abort$",
@@ -1721,7 +1721,7 @@ igt_main
 				igt_assert_f((results = generate_results_json(dirfd)) != NULL,
 					     "Results parsing failed\n");
 
-				igt_assert(json_object_object_get_ex(results, "tests", &tests));
+				igt_assert(tests = json_object_get(results, "tests"));
 
 				igt_assert_eqstr(igt_get_result(tests, "igt@abort@a-subtest"), "pass");
 				igt_assert_eqstr(igt_get_result(tests, "igt@abort@b-subtest"), "abort");
@@ -1731,7 +1731,7 @@ igt_main
 				else
 					igt_assert_eqstr(igt_get_result(tests, "igt@abort@c-subtest"), "notrun");
 
-				igt_assert_eq(json_object_put(results), 1);
+				json_decref(results);
 			}
 
 			igt_fixture {
@@ -1758,7 +1758,7 @@ igt_main
 
 			igt_subtest_f("execute-abort-fixture%s", multiple ? "-multiple" : "") {
 				struct execute_state state;
-				struct json_object *results, *tests;
+				struct json_t *results, *tests;
 				const char *argv[] = { "runner", multiple ? "--multiple-mode" : "--sync",
 						       "--allow-non-root",
 						       "-t", "^abort-fixture$",
@@ -1776,7 +1776,7 @@ igt_main
 				igt_assert_f((results = generate_results_json(dirfd)) != NULL,
 					     "Results parsing failed\n");
 
-				igt_assert(json_object_object_get_ex(results, "tests", &tests));
+				igt_assert(tests = json_object_get(results, "tests"));
 
 				if (multiple) {
 					/*
@@ -1791,7 +1791,7 @@ igt_main
 					igt_assert_eqstr(igt_get_result(tests, "igt@abort-fixture@b-subtest"), "notrun");
 				}
 
-				igt_assert_eq(json_object_put(results), 1);
+				json_decref(results);
 			}
 
 			igt_fixture {
@@ -1825,7 +1825,7 @@ igt_main
 
 			igt_subtest_f("execute-abort-fixture-testlist%s", multiple ? "-multiple" : "") {
 				struct execute_state state;
-				struct json_object *results, *tests;
+				struct json_t *results, *tests;
 				const char *argv[] = { "runner", multiple ? "--multiple-mode" : "--sync",
 						       "--allow-non-root",
 						       "--test-list", filename,
@@ -1843,7 +1843,7 @@ igt_main
 				igt_assert_f((results = generate_results_json(dirfd)) != NULL,
 					     "Results parsing failed\n");
 
-				igt_assert(json_object_object_get_ex(results, "tests", &tests));
+				igt_assert(tests = json_object_get(results, "tests"));
 
 				if (multiple) /* multiple mode = no notruns */
 					igt_assert_no_result_for(tests, "igt@abort-fixture@a-subtest");
@@ -1853,7 +1853,7 @@ igt_main
 
 				igt_assert_eqstr(igt_get_result(tests, "igt@abort-fixture@b-subtest"), "abort");
 
-				igt_assert_eq(json_object_put(results), 1);
+				json_decref(results);
 			}
 
 			igt_fixture {
@@ -1881,7 +1881,7 @@ igt_main
 
 			igt_subtest_f("execute-abort-dynamic%s", multiple ? "-multiple" : "") {
 				struct execute_state state;
-				struct json_object *results, *tests;
+				struct json_t *results, *tests;
 				const char *argv[] = { "runner", multiple ? "--multiple-mode" : "--sync",
 						       "--allow-non-root",
 						       "-t", "^abort-dynamic$",
@@ -1899,7 +1899,7 @@ igt_main
 				igt_assert_f((results = generate_results_json(dirfd)) != NULL,
 					     "Results parsing failed\n");
 
-				igt_assert(json_object_object_get_ex(results, "tests", &tests));
+				igt_assert(tests = json_object_get(results, "tests"));
 
 				igt_assert_eqstr(igt_get_result(tests, "igt@abort-dynamic@a-subtest@dynamic-1"), "pass");
 				igt_assert_eqstr(igt_get_result(tests, "igt@abort-dynamic@b-subtest@dynamic-1"), "pass");
@@ -1912,7 +1912,7 @@ igt_main
 				else
 					igt_assert_eqstr(igt_get_result(tests, "igt@abort-dynamic@c-subtest"), "notrun");
 
-				igt_assert_eq(json_object_put(results), 1);
+				json_decref(results);
 			}
 
 			igt_fixture {
-- 
2.37.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [igt-dev] [PATCH i-g-t 2/3] runner/tests: Fix JSON test data
  2022-08-10 13:55 [igt-dev] [PATCH i-g-t 0/3] Use Jansson instead of json-c in igt_runner Ryszard Knop
  2022-08-10 13:55 ` [igt-dev] [PATCH i-g-t 1/3] runner: Use Jansson in resultgen instead of json-c Ryszard Knop
@ 2022-08-10 13:55 ` Ryszard Knop
  2022-08-10 13:55 ` [igt-dev] [PATCH i-g-t 3/3] runner: Add an on-demand test for large files Ryszard Knop
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Ryszard Knop @ 2022-08-10 13:55 UTC (permalink / raw)
  To: Development mailing list for IGT GPU Tools

JSON files contained extra (invalid) commas which json-c was able to
handle, but Jansson, Firefox and Python parsers are unhappy with.

Signed-off-by: Ryszard Knop <ryszard.knop@intel.com>
---
 .../json_tests_data/aborted-after-a-test/reference.json   | 6 +++---
 runner/json_tests_data/aborted-on-boot/reference.json     | 4 ++--
 runner/json_tests_data/dmesg-escapes/reference.json       | 8 ++++----
 runner/json_tests_data/empty-result-files/reference.json  | 4 ++--
 runner/json_tests_data/graceful-notrun/reference.json     | 6 +++---
 .../incomplete-before-any-subtests/reference.json         | 2 +-
 .../notrun-results-multiple-mode/reference.json           | 2 +-
 runner/json_tests_data/notrun-results/reference.json      | 2 +-
 8 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/runner/json_tests_data/aborted-after-a-test/reference.json b/runner/json_tests_data/aborted-after-a-test/reference.json
index 0776f758..3f4a3fc0 100644
--- a/runner/json_tests_data/aborted-after-a-test/reference.json
+++ b/runner/json_tests_data/aborted-after-a-test/reference.json
@@ -49,7 +49,7 @@
 	"out":"Aborted after: successtest (first-subtest)\n\nKernel tainted (0x200)\n",
 	"result":"fail",
 	"err":"",
-	"dmesg":"",
+	"dmesg":""
     }
   },
   "totals":{
@@ -130,7 +130,7 @@
       "notrun":0,
       "fail":1,
       "warn":0
-    },
+    }
   },
   "runtimes":{
     "igt@successtest":{
@@ -139,6 +139,6 @@
         "start":0,
         "end":0.014
       }
-    },
+    }
   }
 }
diff --git a/runner/json_tests_data/aborted-on-boot/reference.json b/runner/json_tests_data/aborted-on-boot/reference.json
index 75f19466..5e9b905a 100644
--- a/runner/json_tests_data/aborted-on-boot/reference.json
+++ b/runner/json_tests_data/aborted-on-boot/reference.json
@@ -43,7 +43,7 @@
 	"out":"Aborted after: startup\n\nKernel tainted (0x200)\n",
 	"result":"fail",
 	"err":"",
-	"dmesg":"",
+	"dmesg":""
     }
   },
   "totals":{
@@ -124,7 +124,7 @@
       "notrun":0,
       "fail":1,
       "warn":0
-    },
+    }
   },
   "runtimes":{
   }
diff --git a/runner/json_tests_data/dmesg-escapes/reference.json b/runner/json_tests_data/dmesg-escapes/reference.json
index 91c57310..4798db52 100644
--- a/runner/json_tests_data/dmesg-escapes/reference.json
+++ b/runner/json_tests_data/dmesg-escapes/reference.json
@@ -19,8 +19,8 @@
         "end":0
       },
       "err":"Starting subtest: first-subtest\nSubtest first-subtest: SUCCESS (0.000s)\n",
-	"dmesg":"<6> [3216186.095083] Console: switching to colour dummy device 80x25\n<6> [3216186.095097] [IGT] successtest: executing\n<6> [3216186.101115] [IGT] successtest: starting subtest first-subtest\n<6> [3216186.101159] String with a\nnewline\n<6> [3216186.101159] String with a\ttab\n<6> [3216186.101159] String with an explicit\\x00NUL\n<6> [3216186.101159] The character \\x13 should be nonprintable\n<6> [3216186.101159] Escaped backslash is \\\n<6> [3216186.101159] Kernel shouldn't output this but cutoff escape \\x1\n<6> [3216186.101159] More cutoff \\x\n<6> [3216186.101159] One more \\\n<6> [3216186.101160] [IGT] successtest: exiting, ret=0\n<6> [3216186.101299] Console: switching to colour frame buffer device 240x75\n",
-    },
+	"dmesg":"<6> [3216186.095083] Console: switching to colour dummy device 80x25\n<6> [3216186.095097] [IGT] successtest: executing\n<6> [3216186.101115] [IGT] successtest: starting subtest first-subtest\n<6> [3216186.101159] String with a\nnewline\n<6> [3216186.101159] String with a\ttab\n<6> [3216186.101159] String with an explicit\\x00NUL\n<6> [3216186.101159] The character \\x13 should be nonprintable\n<6> [3216186.101159] Escaped backslash is \\\n<6> [3216186.101159] Kernel shouldn't output this but cutoff escape \\x1\n<6> [3216186.101159] More cutoff \\x\n<6> [3216186.101159] One more \\\n<6> [3216186.101160] [IGT] successtest: exiting, ret=0\n<6> [3216186.101299] Console: switching to colour frame buffer device 240x75\n"
+    }
   },
   "totals":{
     "":{
@@ -61,7 +61,7 @@
       "notrun":0,
       "fail":0,
       "warn":0
-    },
+    }
   },
   "runtimes":{
     "igt@successtest":{
@@ -70,6 +70,6 @@
         "start":0,
         "end":0.014
       }
-    },
+    }
   }
 }
diff --git a/runner/json_tests_data/empty-result-files/reference.json b/runner/json_tests_data/empty-result-files/reference.json
index f81ffb81..7c3a052a 100644
--- a/runner/json_tests_data/empty-result-files/reference.json
+++ b/runner/json_tests_data/empty-result-files/reference.json
@@ -14,7 +14,7 @@
 	"err":"",
 	"dmesg":"",
 	"result":"incomplete"
-    },
+    }
   },
   "totals":{
     "":{
@@ -55,7 +55,7 @@
       "notrun":0,
       "fail":0,
       "warn":0
-    },
+    }
   },
   "runtimes":{
   }
diff --git a/runner/json_tests_data/graceful-notrun/reference.json b/runner/json_tests_data/graceful-notrun/reference.json
index c95bdfec..2c9888e4 100644
--- a/runner/json_tests_data/graceful-notrun/reference.json
+++ b/runner/json_tests_data/graceful-notrun/reference.json
@@ -39,7 +39,7 @@
 	"err":"",
 	"dmesg":"",
 	"result":"notrun"
-    },
+    }
   },
   "totals":{
     "":{
@@ -106,7 +106,7 @@
       "notrun":2,
       "fail":0,
       "warn":0
-    },
+    }
   },
   "runtimes":{
     "igt@successtest":{
@@ -115,6 +115,6 @@
         "start":0,
         "end":0.014
       }
-    },
+    }
   }
 }
diff --git a/runner/json_tests_data/incomplete-before-any-subtests/reference.json b/runner/json_tests_data/incomplete-before-any-subtests/reference.json
index 2a4bd456..ed2a3753 100644
--- a/runner/json_tests_data/incomplete-before-any-subtests/reference.json
+++ b/runner/json_tests_data/incomplete-before-any-subtests/reference.json
@@ -39,7 +39,7 @@
 	"err":"",
 	"dmesg":"",
 	"result":"notrun"
-    },
+    }
   },
   "totals":{
     "":{
diff --git a/runner/json_tests_data/notrun-results-multiple-mode/reference.json b/runner/json_tests_data/notrun-results-multiple-mode/reference.json
index 3f8b7fb0..9820ecae 100644
--- a/runner/json_tests_data/notrun-results-multiple-mode/reference.json
+++ b/runner/json_tests_data/notrun-results-multiple-mode/reference.json
@@ -101,6 +101,6 @@
         "start":0,
         "end":0.014
       }
-    },
+    }
   }
 }
diff --git a/runner/json_tests_data/notrun-results/reference.json b/runner/json_tests_data/notrun-results/reference.json
index 800de38c..f419f7a1 100644
--- a/runner/json_tests_data/notrun-results/reference.json
+++ b/runner/json_tests_data/notrun-results/reference.json
@@ -120,6 +120,6 @@
         "start":0,
         "end":0.014
       }
-    },
+    }
   }
 }
-- 
2.37.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [igt-dev] [PATCH i-g-t 3/3] runner: Add an on-demand test for large files
  2022-08-10 13:55 [igt-dev] [PATCH i-g-t 0/3] Use Jansson instead of json-c in igt_runner Ryszard Knop
  2022-08-10 13:55 ` [igt-dev] [PATCH i-g-t 1/3] runner: Use Jansson in resultgen instead of json-c Ryszard Knop
  2022-08-10 13:55 ` [igt-dev] [PATCH i-g-t 2/3] runner/tests: Fix JSON test data Ryszard Knop
@ 2022-08-10 13:55 ` Ryszard Knop
  2022-08-10 15:23 ` [igt-dev] ✗ Fi.CI.BUILD: failure for Use Jansson instead of json-c in igt_runner Patchwork
  2022-08-11  9:14 ` [igt-dev] [PATCH i-g-t 0/3] " Petri Latvala
  4 siblings, 0 replies; 6+ messages in thread
From: Ryszard Knop @ 2022-08-10 13:55 UTC (permalink / raw)
  To: Development mailing list for IGT GPU Tools

The test in question does not carry large files, as that would require
adding massive files to Git. The tested logic is not any different for
large files, it's just a check if the JSON library can handle them.

To run this test, use generate_data.py. You'll need around 13GB of free
space and 10+ minutes to run this test successfully. The test will be
skipped by default if the SKIP_ME marker exists.

Signed-off-by: Ryszard Knop <ryszard.knop@intel.com>
---
 .../really-large-files/.gitignore             |  3 +
 .../really-large-files/0/dmesg.txt            |  0
 .../really-large-files/0/err.txt              |  0
 .../really-large-files/0/journal.txt          |  0
 .../really-large-files/0/out.txt              |  1 +
 .../really-large-files/README.txt             |  7 +++
 .../really-large-files/SKIP_ME                |  1 +
 .../really-large-files/endtime.txt            |  1 +
 .../really-large-files/generate_data.py       | 20 ++++++
 .../really-large-files/joblist.txt            |  1 +
 .../really-large-files/metadata.txt           | 12 ++++
 .../really-large-files/reference.json         | 62 +++++++++++++++++++
 .../really-large-files/starttime.txt          |  1 +
 .../really-large-files/uname.txt              |  1 +
 runner/runner_json_tests.c                    |  8 ++-
 15 files changed, 117 insertions(+), 1 deletion(-)
 create mode 100644 runner/json_tests_data/really-large-files/.gitignore
 create mode 100644 runner/json_tests_data/really-large-files/0/dmesg.txt
 create mode 100644 runner/json_tests_data/really-large-files/0/err.txt
 create mode 100644 runner/json_tests_data/really-large-files/0/journal.txt
 create mode 100644 runner/json_tests_data/really-large-files/0/out.txt
 create mode 100644 runner/json_tests_data/really-large-files/README.txt
 create mode 100644 runner/json_tests_data/really-large-files/SKIP_ME
 create mode 100644 runner/json_tests_data/really-large-files/endtime.txt
 create mode 100644 runner/json_tests_data/really-large-files/generate_data.py
 create mode 100644 runner/json_tests_data/really-large-files/joblist.txt
 create mode 100644 runner/json_tests_data/really-large-files/metadata.txt
 create mode 100644 runner/json_tests_data/really-large-files/reference.json
 create mode 100644 runner/json_tests_data/really-large-files/starttime.txt
 create mode 100644 runner/json_tests_data/really-large-files/uname.txt

diff --git a/runner/json_tests_data/really-large-files/.gitignore b/runner/json_tests_data/really-large-files/.gitignore
new file mode 100644
index 00000000..6a445ba9
--- /dev/null
+++ b/runner/json_tests_data/really-large-files/.gitignore
@@ -0,0 +1,3 @@
+reference.json
+0/out.txt
+SKIP_ME
\ No newline at end of file
diff --git a/runner/json_tests_data/really-large-files/0/dmesg.txt b/runner/json_tests_data/really-large-files/0/dmesg.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/runner/json_tests_data/really-large-files/0/err.txt b/runner/json_tests_data/really-large-files/0/err.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/runner/json_tests_data/really-large-files/0/journal.txt b/runner/json_tests_data/really-large-files/0/journal.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/runner/json_tests_data/really-large-files/0/out.txt b/runner/json_tests_data/really-large-files/0/out.txt
new file mode 100644
index 00000000..e85778cd
--- /dev/null
+++ b/runner/json_tests_data/really-large-files/0/out.txt
@@ -0,0 +1 @@
+This test requires massive files generated with generate_data.py to actually test stuff.
\ No newline at end of file
diff --git a/runner/json_tests_data/really-large-files/README.txt b/runner/json_tests_data/really-large-files/README.txt
new file mode 100644
index 00000000..20f6f3b2
--- /dev/null
+++ b/runner/json_tests_data/really-large-files/README.txt
@@ -0,0 +1,7 @@
+Check if an incredibly large JSON is generated and tested properly.
+This requires a large out.txt file to be available - it's not in
+the repo directly, run generate_data.py to test that properly.
+The SKIP_ME marker file exists to skip this test by default.
+
+The logic for small/large files does not change, testing this for each
+commit takes a long time and does not really check anything special.
diff --git a/runner/json_tests_data/really-large-files/SKIP_ME b/runner/json_tests_data/really-large-files/SKIP_ME
new file mode 100644
index 00000000..c76d0b57
--- /dev/null
+++ b/runner/json_tests_data/really-large-files/SKIP_ME
@@ -0,0 +1 @@
+This marker file exists to skip this test by default.
\ No newline at end of file
diff --git a/runner/json_tests_data/really-large-files/endtime.txt b/runner/json_tests_data/really-large-files/endtime.txt
new file mode 100644
index 00000000..635f6ae9
--- /dev/null
+++ b/runner/json_tests_data/really-large-files/endtime.txt
@@ -0,0 +1 @@
+1539953735.172373
diff --git a/runner/json_tests_data/really-large-files/generate_data.py b/runner/json_tests_data/really-large-files/generate_data.py
new file mode 100644
index 00000000..d3852c6b
--- /dev/null
+++ b/runner/json_tests_data/really-large-files/generate_data.py
@@ -0,0 +1,20 @@
+import json
+
+print("Hope you've got enough memory for this! Generating text...")
+PREFIX = "it's time for " + ("A" * 1024 * 1024 * 1024 * 4)
+
+print("Writing to out.txt...")
+with open('0/out.txt', 'w') as f:
+	f.write(PREFIX)
+
+print("Loading reference.json...")
+with open('reference.json', 'r') as f:
+	data = json.load(f)
+
+print("Writing new reference.json...")
+with open('reference.json', 'w') as f:
+	data['tests']['igt@successtest@first-subtest']['out'] = PREFIX
+	json.dump(data, f)
+
+print("Removing SKIP_ME...")
+os.unlink("SKIP_ME")
diff --git a/runner/json_tests_data/really-large-files/joblist.txt b/runner/json_tests_data/really-large-files/joblist.txt
new file mode 100644
index 00000000..81f914a7
--- /dev/null
+++ b/runner/json_tests_data/really-large-files/joblist.txt
@@ -0,0 +1 @@
+successtest first-subtest
diff --git a/runner/json_tests_data/really-large-files/metadata.txt b/runner/json_tests_data/really-large-files/metadata.txt
new file mode 100644
index 00000000..08db4cc0
--- /dev/null
+++ b/runner/json_tests_data/really-large-files/metadata.txt
@@ -0,0 +1,12 @@
+abort_mask : 0
+name : really-large-files
+dry_run : 0
+sync : 0
+log_level : 0
+overwrite : 0
+multiple_mode : 0
+inactivity_timeout : 0
+use_watchdog : 0
+piglit_style_dmesg : 0
+test_root : /path/does/not/exist
+results_path : /path/does/not/exist
diff --git a/runner/json_tests_data/really-large-files/reference.json b/runner/json_tests_data/really-large-files/reference.json
new file mode 100644
index 00000000..5e662938
--- /dev/null
+++ b/runner/json_tests_data/really-large-files/reference.json
@@ -0,0 +1,62 @@
+{
+  "__type__":"TestrunResult",
+  "results_version":10,
+  "name":"really-large-files",
+  "uname":"Linux hostname 4.18.0-1-amd64 #1 SMP Debian 4.18.6-1 (2018-09-06) x86_64",
+  "time_elapsed":{
+    "__type__":"TimeAttribute",
+    "start":1539953735.1110389,
+    "end":1539953735.1723731
+  },
+  "tests":{
+    "igt@successtest@first-subtest":{
+	"out":"This test requires massive files generated with generate_data.py to actually test stuff.",
+	"err":"",
+	"dmesg":"",
+	"result":"incomplete"
+    }
+  },
+  "totals":{
+    "":{
+      "crash":0,
+      "pass":0,
+      "dmesg-fail":0,
+      "dmesg-warn":0,
+      "skip":0,
+      "incomplete":1,
+      "abort":0,
+      "timeout":0,
+      "notrun":0,
+      "fail":0,
+      "warn":0
+    },
+    "root":{
+      "crash":0,
+      "pass":0,
+      "dmesg-fail":0,
+      "dmesg-warn":0,
+      "skip":0,
+      "incomplete":1,
+      "abort":0,
+      "timeout":0,
+      "notrun":0,
+      "fail":0,
+      "warn":0
+    },
+    "igt@successtest":{
+      "crash":0,
+      "pass":0,
+      "dmesg-fail":0,
+      "dmesg-warn":0,
+      "skip":0,
+      "incomplete":1,
+      "abort":0,
+      "timeout":0,
+      "notrun":0,
+      "fail":0,
+      "warn":0
+    }
+  },
+  "runtimes":{
+  }
+}
diff --git a/runner/json_tests_data/really-large-files/starttime.txt b/runner/json_tests_data/really-large-files/starttime.txt
new file mode 100644
index 00000000..ae038f18
--- /dev/null
+++ b/runner/json_tests_data/really-large-files/starttime.txt
@@ -0,0 +1 @@
+1539953735.111039
diff --git a/runner/json_tests_data/really-large-files/uname.txt b/runner/json_tests_data/really-large-files/uname.txt
new file mode 100644
index 00000000..a7aef6f7
--- /dev/null
+++ b/runner/json_tests_data/really-large-files/uname.txt
@@ -0,0 +1 @@
+Linux hostname 4.18.0-1-amd64 #1 SMP Debian 4.18.6-1 (2018-09-06) x86_64
diff --git a/runner/runner_json_tests.c b/runner/runner_json_tests.c
index 9f487855..6bb1eb9f 100644
--- a/runner/runner_json_tests.c
+++ b/runner/runner_json_tests.c
@@ -89,12 +89,17 @@ static void compare(struct json_t *one,
 static void run_results_and_compare(int dirfd, const char *dirname)
 {
 	int testdirfd = openat(dirfd, dirname, O_RDONLY | O_DIRECTORY);
-	int reference;
+	int skipfd, reference;
 	struct json_t *resultsobj, *referenceobj;
 	struct json_error_t error;
 
 	igt_assert_fd(testdirfd);
 
+	skipfd = openat(testdirfd, "SKIP_ME", O_RDONLY);
+	igt_skip_on_f(skipfd != -1, "SKIP_ME marker exists - see the README "
+				    "for this test for more information.\n");
+	close(skipfd);
+
 	igt_assert((resultsobj = generate_results_json(testdirfd)) != NULL);
 
 	reference = openat(testdirfd, "reference.json", O_RDONLY);
@@ -134,6 +139,7 @@ static const char *dirnames[] = {
 	"dynamic-subtest-name-in-multiple-subtests",
 	"unprintable-characters",
 	"empty-result-files",
+	"really-large-files",
 	"graceful-notrun",
 };
 
-- 
2.37.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [igt-dev] ✗ Fi.CI.BUILD: failure for Use Jansson instead of json-c in igt_runner
  2022-08-10 13:55 [igt-dev] [PATCH i-g-t 0/3] Use Jansson instead of json-c in igt_runner Ryszard Knop
                   ` (2 preceding siblings ...)
  2022-08-10 13:55 ` [igt-dev] [PATCH i-g-t 3/3] runner: Add an on-demand test for large files Ryszard Knop
@ 2022-08-10 15:23 ` Patchwork
  2022-08-11  9:14 ` [igt-dev] [PATCH i-g-t 0/3] " Petri Latvala
  4 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2022-08-10 15:23 UTC (permalink / raw)
  To: Ryszard Knop; +Cc: igt-dev

== Series Details ==

Series: Use Jansson instead of json-c in igt_runner
URL   : https://patchwork.freedesktop.org/series/107123/
State : failure

== Summary ==

Applying: runner: Use Jansson in resultgen instead of json-c
Using index info to reconstruct a base tree...
M	runner/resultgen.c
Falling back to patching base and 3-way merge...
Auto-merging runner/resultgen.c
CONFLICT (content): Merge conflict in runner/resultgen.c
Patch failed at 0001 runner: Use Jansson in resultgen instead of json-c
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 0/3] Use Jansson instead of json-c in igt_runner
  2022-08-10 13:55 [igt-dev] [PATCH i-g-t 0/3] Use Jansson instead of json-c in igt_runner Ryszard Knop
                   ` (3 preceding siblings ...)
  2022-08-10 15:23 ` [igt-dev] ✗ Fi.CI.BUILD: failure for Use Jansson instead of json-c in igt_runner Patchwork
@ 2022-08-11  9:14 ` Petri Latvala
  4 siblings, 0 replies; 6+ messages in thread
From: Petri Latvala @ 2022-08-11  9:14 UTC (permalink / raw)
  To: Ryszard Knop; +Cc: Development mailing list for IGT GPU Tools

On Wed, Aug 10, 2022 at 03:55:27PM +0200, Ryszard Knop wrote:
> The json-c library has a hard limit of 2GB of its output. While normally
> it's not a problem, some very verbose edge cases make the results.json
> output go past that limit.
> 
> This series converts igt_runner's json-c usage to Jansson.
> 
> 

I haven't been able to review this thoroughly yet, but an initial
comment can be made:

Absolute blockers for this series are having gitlab CI correctly set
up so it builds there (should be just a matter of adding the packages
to the dockerfiles), and having the required libs installed in our
CI. Latter we're able to see fully done by having a successful
premerge on this series.


-- 
Petri Latvala

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-11  9:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-10 13:55 [igt-dev] [PATCH i-g-t 0/3] Use Jansson instead of json-c in igt_runner Ryszard Knop
2022-08-10 13:55 ` [igt-dev] [PATCH i-g-t 1/3] runner: Use Jansson in resultgen instead of json-c Ryszard Knop
2022-08-10 13:55 ` [igt-dev] [PATCH i-g-t 2/3] runner/tests: Fix JSON test data Ryszard Knop
2022-08-10 13:55 ` [igt-dev] [PATCH i-g-t 3/3] runner: Add an on-demand test for large files Ryszard Knop
2022-08-10 15:23 ` [igt-dev] ✗ Fi.CI.BUILD: failure for Use Jansson instead of json-c in igt_runner Patchwork
2022-08-11  9:14 ` [igt-dev] [PATCH i-g-t 0/3] " Petri Latvala

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.