From patchwork Fri Dec 12 16:06:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 5483681 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BA2ED9F30B for ; Fri, 12 Dec 2014 16:06:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 05F1D2017D for ; Fri, 12 Dec 2014 16:06:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A532201D3 for ; Fri, 12 Dec 2014 16:06:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935064AbaLLQGd (ORCPT ); Fri, 12 Dec 2014 11:06:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43504 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935018AbaLLQGc (ORCPT ); Fri, 12 Dec 2014 11:06:32 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBCG6VaI008093 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 12 Dec 2014 11:06:31 -0500 Received: from hawk.usersys.redhat.com (dhcp-1-108.brq.redhat.com [10.34.1.108]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sBCG6Kmo007006; Fri, 12 Dec 2014 11:06:30 -0500 From: Andrew Jones To: kvm@vger.kernel.org Subject: [PATCH 10/10] arm: use report prefixes Date: Fri, 12 Dec 2014 17:06:17 +0100 Message-Id: <1418400377-17388-11-git-send-email-drjones@redhat.com> In-Reply-To: <1418400377-17388-1-git-send-email-drjones@redhat.com> References: <1418400377-17388-1-git-send-email-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP arm/selftest was already making use of prefixes, managing them itself. Use the prefix support now built into report. Signed-off-by: Andrew Jones --- arm/selftest.c | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/arm/selftest.c b/arm/selftest.c index 0f70e1dcb3b0e..4f23d7d3ae1f9 100644 --- a/arm/selftest.c +++ b/arm/selftest.c @@ -13,23 +13,10 @@ #include "asm/processor.h" #include "asm/page.h" -#define TESTGRP "selftest" - -static char testname[64]; - -static void testname_set(const char *subtest) -{ - strcpy(testname, TESTGRP); - if (subtest) { - strcat(testname, "::"); - strcat(testname, subtest); - } -} - static void assert_args(int num_args, int needed_args) { if (num_args < needed_args) { - printf("%s: not enough arguments\n", testname); + printf("selftest: not enough arguments\n"); abort(); } } @@ -60,19 +47,24 @@ static void check_setup(int argc, char **argv) if (!var) continue; + report_prefix_push(var); + if (strcmp(var, "mem") == 0) { phys_addr_t memsize = PHYS_END - PHYS_OFFSET; phys_addr_t expected = ((phys_addr_t)val)*1024*1024; - report("%s[%s]", memsize == expected, testname, "mem"); + report("size = %d MB", memsize == expected, + memsize/1024/1024); ++nr_tests; } else if (strcmp(var, "smp") == 0) { - report("%s[%s]", nr_cpus == (int)val, testname, "smp"); + report("nr_cpus = %d", nr_cpus == (int)val, nr_cpus); ++nr_tests; } + + report_prefix_pop(); } assert_args(nr_tests, 2); @@ -181,15 +173,16 @@ static bool check_svc(void) static void check_vectors(void *arg __unused) { - report("%s", check_und() && check_svc(), testname); + report("und", check_und()); + report("svc", check_svc()); exit(report_summary()); } int main(int argc, char **argv) { - testname_set(NULL); + report_prefix_push("selftest"); assert_args(argc, 1); - testname_set(argv[0]); + report_prefix_push(argv[0]); if (strcmp(argv[0], "setup") == 0) {