Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp782165ybz; Wed, 15 Apr 2020 18:57:36 -0700 (PDT) X-Google-Smtp-Source: APiQypLBK1pjeKKa7ytjQy3fV4FvAhp11+lJbKsSbB8m7SC44Psi4U6LpuaeVkPjcA7l3b0DQYT/ X-Received: by 2002:a17:906:f90e:: with SMTP id lc14mr7307328ejb.156.1587002256735; Wed, 15 Apr 2020 18:57:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587002256; cv=none; d=google.com; s=arc-20160816; b=kH6D9DDgySg7+3oQmWGeXdL0U4P1Vfef3xdiTYOPc6vshJPOrcesOJHcY8MxfQQ+J6 eK6PjRDkMZ6YCvj2/VA12kEZ60eqtnC5KPKfurZjjr2WSNnEyzw6d9mHjddck8bnHDtE fDABxn9ZfA7wYIGAFmXQ8JRB3ijW6VTGJiNt9B/L2YNcx6gEWKddY6Qzz/f4IYBAzRmQ I8kYM6OnQIWh528RakgMcUdrRBH4cxj0XcVevDbi3gBJMxiLskSXMN6PZLdMSKohkCcq 3fBpXJH7ndtnOevnUUjmQFdt/lB9IkjgznttRVzgQ1opX/n04PYp8oXYTa3+EfbZciHm /y0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=eFD9x/dSIEUfzCFoJjNZCqEIi04lcE4fTMcXRLYjFdQ=; b=Pz7+j075H79E2AStm28z5Sfj0iT/7mS0WqaviSlVq0AuqLEUNKcGrgIHCDovfM2e6f shSbcCEVZQw2nWbOVbZgCI2N3SXG3rTntWIdPEqOg39SnEO3yDXvvYftfKlV31By13S2 X1Uiw4ExFrcKtkOw3ZYPUJLoLQ8JJEwPR9TsMucP1rmE30k3fsxcl6wFuVWTlHycldBT ypYRe++HZl+u1tdlw77Y1L+GVJvUcgwDPdI3yJrKoKuvHF4j30Wa9rhRDU6yU8gyGV4A i4n2IKVZbuEc9kFbJfaihcaJwtpMQO6qep6hlCFlP3yNkOqKitzCRNuz69IoC0O4s79J MMIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jDEpO4Og; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m10si10292117ejb.93.2020.04.15.18.57.13; Wed, 15 Apr 2020 18:57:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jDEpO4Og; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2411588AbgDOR6m (ORCPT + 99 others); Wed, 15 Apr 2020 13:58:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2411585AbgDOR6h (ORCPT ); Wed, 15 Apr 2020 13:58:37 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8BBEC061A0F for ; Wed, 15 Apr 2020 10:58:35 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id b11so990825wrs.6 for ; Wed, 15 Apr 2020 10:58:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=eFD9x/dSIEUfzCFoJjNZCqEIi04lcE4fTMcXRLYjFdQ=; b=jDEpO4Og/WRkRTpK1nmwq1px2vFNMlBEtptiPkL96YTLJ050YqOkFOPf9usax5ANAh xV6KeqcFaQNlqslIEYoTxVae8J0WndPH2ei++qxgBOp4kQ8ToTUfu0uJl4CnPUkWYr6V zAKaiuJjM/9pHxrWdtsaRMYUTQJp+VrXTedMgIjG6Vc8OEZH9LOm3UAitO9HK6d1BaKb gmtVZ6oyd2SH10s3IPcBygZDd21frfRvOL0g0CS4Y1tuoGQsWRB8Vm6OfM1vk1pSpPni VQbWex0Hj/oiGB1J+/LLGJaGmIWYBL+n1zRL1DcwbjIgfARa52/tnDZSkMmu6nhYX8vr RtuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=eFD9x/dSIEUfzCFoJjNZCqEIi04lcE4fTMcXRLYjFdQ=; b=M7d8eemzOWDWks7ftMnXy80WICLvAj2nLLHnfLlwEh/ZJWbeY5TIVEdbUAItPN38H/ VlIEm/Ev7xJmzwGKjh0W9iGgeJRMXl1XGv6CyCQ7XJh6qXznpM2F6tu8ruz0Uk8VUx+o 3XNIVaMBlhWrbzSyd/Uolw5NZ3q1NbC7XGJvU7KJh6Ep5p+SnA+Ji13NcZmtqvzUfE6i EbB1owN7CGehcvMVyEEIPFRjGVCHKU61ONkSaBT4M4mLkFwkxKyKQWqwqQXuDE4DOXST 96nEi7Acvd9wDaVnDf+TqbdcagrIPb5Xyxv8+/WRYyuBoMxejA2e5pHPOBDUQ7LTFCS/ uqGg== X-Gm-Message-State: AGi0PuYo44cIoTKrdVOJ6vekv0+bW/fcwanedzyt8gNl9diqeTUyhhxc Fg+1ox2a6HxVutiM2XQYtHCZHg== X-Received: by 2002:adf:fa03:: with SMTP id m3mr18227322wrr.68.1586973514021; Wed, 15 Apr 2020 10:58:34 -0700 (PDT) Received: from google.com ([100.105.32.75]) by smtp.gmail.com with ESMTPSA id v16sm354492wml.30.2020.04.15.10.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2020 10:58:32 -0700 (PDT) Date: Wed, 15 Apr 2020 19:58:25 +0200 From: Marco Elver To: Alan Maguire Cc: brendanhiggins@google.com, frowand.list@gmail.com, gregkh@linuxfoundation.org, shuah@kernel.org, linux-kselftest@vger.kernel.org, corbet@lwn.net, linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org Subject: Re: [PATCH v8 kunit-next 1/4] kunit: add debugfs /sys/kernel/debug/kunit//results display Message-ID: <20200415175825.GA79987@google.com> References: <1585232710-322-1-git-send-email-alan.maguire@oracle.com> <1585232710-322-2-git-send-email-alan.maguire@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1585232710-322-2-git-send-email-alan.maguire@oracle.com> User-Agent: Mutt/1.13.2 (2019-12-18) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Thu, 26 Mar 2020, Alan Maguire wrote: > add debugfs support for displaying kunit test suite results; this is > especially useful for module-loaded tests to allow disentangling of > test result display from other dmesg events. debugfs support is > provided if CONFIG_KUNIT_DEBUGFS=y. > > As well as printk()ing messages, we append them to a per-test log. > > Signed-off-by: Alan Maguire > Reviewed-by: Brendan Higgins > Reviewed-by: Frank Rowand > --- > include/kunit/test.h | 54 +++++++++++++++--- > lib/kunit/Kconfig | 8 +++ > lib/kunit/Makefile | 4 ++ > lib/kunit/debugfs.c | 116 ++++++++++++++++++++++++++++++++++++++ > lib/kunit/debugfs.h | 30 ++++++++++ > lib/kunit/kunit-test.c | 4 +- > lib/kunit/test.c | 147 ++++++++++++++++++++++++++++++++++++++----------- > 7 files changed, 322 insertions(+), 41 deletions(-) > create mode 100644 lib/kunit/debugfs.c > create mode 100644 lib/kunit/debugfs.h > [...] > diff --git a/lib/kunit/test.c b/lib/kunit/test.c > index 9242f93..a3fa21f 100644 > --- a/lib/kunit/test.c > +++ b/lib/kunit/test.c [...] > -static void kunit_print_ok_not_ok(bool should_indent, > +static void kunit_print_ok_not_ok(void *test_or_suite, > + bool is_test, > bool is_ok, > size_t test_number, > const char *description) > { > - const char *indent, *ok_not_ok; > - > - if (should_indent) > - indent = "\t"; > - else > - indent = ""; > + struct kunit_suite *suite = is_test ? NULL : test_or_suite; > + struct kunit *test = is_test ? test_or_suite : NULL; > > - if (is_ok) > - ok_not_ok = "ok"; > + /* > + * We do not log the test suite results as doing so would > + * mean debugfs display would consist of the test suite > + * description and status prior to individual test results. > + * Hence directly printk the suite status, and we will > + * separately seq_printf() the suite status for the debugfs > + * representation. > + */ > + if (suite) > + pr_info("%s %zd - %s", I think this is missing '\n' -- is this intentional? With v5.7-rc1, when I run a test via module, the final "ok" is only printed once another message is printed to the kernel log (which can take a while). Thanks, -- Marco > + kunit_status_to_string(is_ok), > + test_number, description); > else > - ok_not_ok = "not ok"; > - > - pr_info("%s%s %zd - %s\n", indent, ok_not_ok, test_number, description); > + kunit_log(KERN_INFO, test, "\t%s %zd - %s", > + kunit_status_to_string(is_ok), > + test_number, description); > } [...]