From patchwork Wed Aug 23 13:30:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9917375 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EB3E2603FA for ; Wed, 23 Aug 2017 13:30:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD6D228990 for ; Wed, 23 Aug 2017 13:30:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D164F2898B; Wed, 23 Aug 2017 13:30:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5AF3628990 for ; Wed, 23 Aug 2017 13:30:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BA1316E591; Wed, 23 Aug 2017 13:30:56 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 71BE16E591 for ; Wed, 23 Aug 2017 13:30:55 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id r187so139757wma.1 for ; Wed, 23 Aug 2017 06:30:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=JrZe0gIZMMw4FWg5PDBQsmng1b5EWWqoH52EuucsQyY=; b=a+RkX9dIsnQkGsVmshAAj5onfAhbY/WdRdRkOyIF48SHreV8q2jAy8blnBDrhxMX8q SLy8VAq2+RcYf4KoNUaBifL3ODp4nCws5S/S8v2DDhDb8hqVfIme25PpC3smVxIxyrjl CSn/C5qNnBeYJMPQB9OAcoHrJb67k8VGjJ8E0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JrZe0gIZMMw4FWg5PDBQsmng1b5EWWqoH52EuucsQyY=; b=GYUgturIHt7lw0m1/srZKzMRpni1JLLzZPmjA2q/MXROifpRzhBsrT6HWwvPYpgp0X jKPkLr8c5PIe0IMLO5BVogJpUasSkihK5Jgd70Yr0lmEVVD0B9czTd+7de8AZU+jToPC v6xbtUgFdqYT7p5xdyZoqBnX0SnQMhjOmyzuEXxfTxaM39Ong5rMQpMzl+qe2Y938uwm l8ybg3xeHX/51d3wf+sqNSRouucK6rekXsAQJ5qUNf3sXKaPYt5RVUhdJ7sfZjnOWmIJ IsnIqhoBrp+4EY2q1BAxNM2i92eie/xgz1+5/g+xf8xMzYtuR2bHRUW4m4gLBUXXNv7B sJbg== X-Gm-Message-State: AHYfb5i+2bGgQ5agIXrI/QDxDaGIzeM3LcU+m1lKqHjgL69hyO04CoDl dtzsvxdy/R7GvZXMp9I= X-Received: by 10.80.179.12 with SMTP id q12mr3275801edd.151.1503495053627; Wed, 23 Aug 2017 06:30:53 -0700 (PDT) Received: from wespe.ffwll.local ([2a02:168:56e6:0:6631:50ff:fe8d:fd2e]) by smtp.gmail.com with ESMTPSA id a11sm797537edb.8.2017.08.23.06.30.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Aug 2017 06:30:52 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Wed, 23 Aug 2017 15:30:44 +0200 Message-Id: <1503495044-1191-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.5.5 Cc: Daniel Vetter , Daniel Vetter Subject: [Intel-gfx] [PATCH i-g-t] lib/core: Use igt_info instead of printf X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Petri Latvala --- 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, ""); - 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); } }