Skip to contentSkip to conversation

lib/core: Use igt_info instead of printf

PATCH In review Daniel Vetter 3 participants 3 messages Aug 23, 2017 – Aug 24, 2017 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/core: Use igt_info instead of printf

igt_info doesn't add anything when printing to stdout, but so looks the same. But it has the upside of appending the lines also to the igt crashdump log, where I especially want the backtraces. Atm they're the only thing that doesn't end up in there, which is a bit confusing.

While at it also convert the other lines - the test summary usually doesn't make it since the test fails before that, and the version line tends to scroll off the crashdump.

---
 lib/igt_core.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
lib/igt_core.c +10 -10
index 9eb99eda0244..58d64dc2d466 100644
@@ -588,9 +588,9 @@ static void print_version(void)
 
 	uname(&uts);
 
-	fprintf(stdout, "IGT-Version: %s-%s (%s) (%s: %s %s)\n", PACKAGE_VERSION,
-		IGT_GIT_SHA1, TARGET_CPU_PLATFORM,
-		uts.sysname, uts.release, uts.machine);
+	igt_info("IGT-Version: %s-%s (%s) (%s: %s %s)\n", PACKAGE_VERSION,
+		 IGT_GIT_SHA1, TARGET_CPU_PLATFORM,
+		 uts.sysname, uts.release, uts.machine);
 }
 
 static void print_usage(const char *help_str, bool output_on_stderr)
@@ -1028,10 +1028,10 @@ static void exit_subtest(const char *result)
 	struct timespec now;
 
 	gettime(&now);
-	printf("%sSubtest %s: %s (%.3fs)%s\n",
-	       (!__igt_plain_output) ? "\x1b[1m" : "",
-	       in_subtest, result, time_elapsed(&subtest_time, &now),
-	       (!__igt_plain_output) ? "\x1b[0m" : "");
+	igt_info("%sSubtest %s: %s (%.3fs)%s\n",
+		 (!__igt_plain_output) ? "\x1b[1m" : "",
+		 in_subtest, result, time_elapsed(&subtest_time, &now),
+		 (!__igt_plain_output) ? "\x1b[0m" : "");
 	fflush(stdout);
 
 	in_subtest = NULL;
@@ -1216,7 +1216,7 @@ static void print_backtrace(void)
 	unw_context_t uc;
 	int stack_num = 0;
 
-	printf("Stack trace:\n");
+	igt_info("Stack trace:\n");
 
 	unw_getcontext(&uc);
 	unw_init_local(&cursor, &uc);
@@ -1227,8 +1227,8 @@ static void print_backtrace(void)
 		if (unw_get_proc_name(&cursor, name, 255, &off) < 0)
 			strcpy(name, "<unknown>");
 
-		printf("  #%d [%s+0x%x]\n", stack_num++, name,
-		       (unsigned int) off);
+		igt_info("  #%d [%s+0x%x]\n", stack_num++, name,
+			 (unsigned int) off);
 	}
 }
 
Signature · 6 lines
2.5.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✓ Fi.CI.BAT: success for lib/core: Use igt_info instead of printf

== Series Details ==

== Series Details ==

Series: lib/core: Use igt_info instead of printf
URL : https://patchwork.freedesktop.org/series/29210/
State : success

== Summary ==

IGT patchset tested on top of latest successful build 42b42c99cd9d1b890807ae97cbd1c593396ae051 tests/Makefile.am: Wrap audio test with dedicated conditional

with latest DRM-Tip kernel build CI_DRM_2995
2964b2f40295 drm-tip: 2017y-08m-23d-13h-11m-32s UTC integration manifest

Test kms_flip:

        Subgroup basic-flip-vs-modeset:
                pass       -> SKIP       (fi-skl-x1585l) fdo#101781

fdo#101781 https://bugs.freedesktop.org/show_bug.cgi?id=101781

fi-bdw-5557u     total:279  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:457s
fi-bdw-gvtdvm    total:279  pass:265  dwarn:0   dfail:0   fail:0   skip:14  time:437s
fi-blb-e6850     total:279  pass:224  dwarn:1   dfail:0   fail:0   skip:54  time:360s
fi-bsw-n3050     total:279  pass:243  dwarn:0   dfail:0   fail:0   skip:36  time:553s
fi-bwr-2160      total:279  pass:184  dwarn:0   dfail:0   fail:0   skip:95  time:253s
fi-bxt-j4205     total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:524s
fi-byt-j1900     total:279  pass:254  dwarn:1   dfail:0   fail:0   skip:24  time:530s
fi-byt-n2820     total:279  pass:250  dwarn:1   dfail:0   fail:0   skip:28  time:521s
fi-elk-e7500     total:279  pass:230  dwarn:0   dfail:0   fail:0   skip:49  time:437s
fi-glk-2a        total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:616s
fi-hsw-4770      total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:451s
fi-hsw-4770r     total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:429s
fi-ilk-650       total:279  pass:229  dwarn:0   dfail:0   fail:0   skip:50  time:423s
fi-ivb-3520m     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:498s
fi-ivb-3770      total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:479s
fi-kbl-7500u     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:480s
fi-kbl-7560u     total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:602s
fi-kbl-r         total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:604s
fi-pnv-d510      total:279  pass:223  dwarn:1   dfail:0   fail:0   skip:55  time:528s
fi-skl-6260u     total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:476s
fi-skl-6700k     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:475s
fi-skl-6770hq    total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:486s
fi-skl-gvtdvm    total:279  pass:266  dwarn:0   dfail:0   fail:0   skip:13  time:447s
fi-skl-x1585l    total:279  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:487s
fi-snb-2520m     total:279  pass:251  dwarn:0   dfail:0   fail:0   skip:28  time:546s
fi-snb-2600      total:279  pass:250  dwarn:0   dfail:0   fail:0   skip:29  time:412s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_86/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by
#2 lore raw

Re: ✓ Fi.CI.BAT: success for lib/core: Use igt_info instead of printf

Quoted 5 lines · Patchwork

== Series Details ==

Series: lib/core: Use igt_info instead of printf
URL : https://patchwork.freedesktop.org/series/29210/
State : success

For anyone else wondering, the difference with this series can be seen comparing e.g. these results from the Fi.CI.IGT results:

https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_2995/shard-kbl3/igt@[email protected]

vs

https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_86/shard-kbl1/igt@[email protected]

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx