All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: [PATCH i-g-t] lib/core: Use igt_info instead of printf
Date: Wed, 23 Aug 2017 15:30:44 +0200	[thread overview]
Message-ID: <1503495044-1191-1-git-send-email-daniel.vetter@ffwll.ch> (raw)

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.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 lib/igt_core.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 9eb99eda0244..58d64dc2d466 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -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);
 	}
 }
 
-- 
2.5.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2017-08-23 13:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23 13:30 Daniel Vetter [this message]
2017-08-23 13:50 ` ✓ Fi.CI.BAT: success for lib/core: Use igt_info instead of printf Patchwork
2017-08-24  8:34   ` Petri Latvala

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=1503495044-1191-1-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 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.