Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1184098ybl; Thu, 23 Jan 2020 15:23:18 -0800 (PST) X-Google-Smtp-Source: APXvYqwpsoHSVkuSBGNcxL9F+iSo+BCGSpmEdwelM4OhpCDXFgOUBeW5gec+8/HWdT2h+hJLmje9 X-Received: by 2002:a9d:6b89:: with SMTP id b9mr610772otq.298.1579821797834; Thu, 23 Jan 2020 15:23:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579821797; cv=none; d=google.com; s=arc-20160816; b=IXNe7/p/l/llbZPZl8jL2Z1akccjn7CoVRd8fgdiLOAJxJk0j3JT/uZYA6HExVsyB7 sW4CMPaGvxMa/RFVUKhtZcCWky/XKn1+ad2L586U9ABLcwX211u55UGXj0pPKjwXImOK nQmrI7aqpp00Dd5ChZ414enHDuJ7e6uvBItXcC5vzzcFjYvgRnFQZA5pz5dpQeclEM+V Z1kn1ECMoGcLXRRHPW6YXj9o/jqSJsgLN8yPZchSOVsW3nE9JljfJZkC2V1Caa/YQfjS SCwy/ck3HgT0d8Yfx/WechH5IXbBzjwxt06fCjlNW9kNgs5uZftCXtzjfZCScaEw/LPv z3+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=lDS+3WSPujoShC7doDseBAcn2qbrDXuKgW17o9svkCE=; b=S3vQjOduKH3HjB9PHkE96bBmqfjF5frFw09dkL5Ac051cVlxvICh/Be7PG722bHWl9 9Wl0IsT22gKTTU/4M7bKij0zbNHX4GcUac62BLxpisLybljEm5SGPL6fUQTO1toG2jmk mQxh2fXED3sS3z1XHzimp5c4x1EmJLx4YHc352NFxko1YE5cI6rYyY9880Fw16NNQ42t N+v9BdEm5asE2WM08/7e9iusM3srppogX814pgTkcEAHoMun158D+xGJBPoWTFqFcNrk N1cChlRPds2QYfBDzv7nqVZK+k6uPlPYdIgpd1r3bKlOajOEjiyeT7/7NmcuH4e2qyZi 4Uwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cHIAbkji; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id z21si1482837oic.32.2020.01.23.15.23.04; Thu, 23 Jan 2020 15:23:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cHIAbkji; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729471AbgAWWpz (ORCPT + 99 others); Thu, 23 Jan 2020 17:45:55 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:38887 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729413AbgAWWpz (ORCPT ); Thu, 23 Jan 2020 17:45:55 -0500 Received: by mail-pl1-f194.google.com with SMTP id t6so1985573plj.5 for ; Thu, 23 Jan 2020 14:45:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lDS+3WSPujoShC7doDseBAcn2qbrDXuKgW17o9svkCE=; b=cHIAbkjiGYyGWlr3Qz9vajplT0PI/Z+8Fu/987ccE+I6XbK1j4skJ2XgVqKVyg0WCE ExvFumHeQgiYha4XHUjAOLhyreLsvwM4jgACWap39lK/AWGFloVw4Hr5STe9eoFyCWUc I/+yqinWGOTw/eo9zFj3l98TQryNcCi7uFIjGzyqFr3N70b0pQqrLd6TzhugV5MwVXId TYgVR9BKfj5YodqfA9q20jXt0V8aXLDs8mY8TxdF9GpDTG8MsOxUgdFSjrwLlM6GvNO/ sBf/y2aQhew8mrLgtCJYyOsHpz8+lKJkco0uulnwq9ln9kwGFrnE61XkMVvKfbxUedwL slzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lDS+3WSPujoShC7doDseBAcn2qbrDXuKgW17o9svkCE=; b=PzLMTaVCjSr/vIgVkQsT6jxphPKvlTPyuQBW/ncp5lWJ/ety3PtjKvPWitzdplUF2x Fvo9wheb/0typboucOWOrh4JJllkd6yGrAmvWNW9bNbCRKFtt/LPAAEDXD5KYzpG5fw8 23sc0GTqoxf9n7ahufQDfRX9zPr/9jfiEZDLvF2RVnuRU8zDEzHU1dSKJiJte0L23PJ5 A1yHUbolaCuq8GgaW4ccmBc8KRbjWMqUepB0HZ8Nlb5cXKqgfOx6PUkFZIxm678CHfLm qum32nMSOXdZKcG8MZkVOlxQ44cNerHL1J/wS+e0PtgP4T8i5+BA50OI/BL4deNQbVrm clUg== X-Gm-Message-State: APjAAAUfkHWiY9kK6m/m6cEdSpxnAVmK9vG2+fvMgOr9oXBoDwS5CAUD zS1lEd+Pos7LtMUfAbngJ37Y2t3ZNdCG/4J53RywBQ== X-Received: by 2002:a17:902:9f98:: with SMTP id g24mr393688plq.325.1579819554213; Thu, 23 Jan 2020 14:45:54 -0800 (PST) MIME-Version: 1.0 References: <20191216220555.245089-1-brendanhiggins@google.com> <20191216220555.245089-5-brendanhiggins@google.com> <20191217075836.C76942072D@mail.kernel.org> In-Reply-To: <20191217075836.C76942072D@mail.kernel.org> From: Brendan Higgins Date: Thu, 23 Jan 2020 14:45:43 -0800 Message-ID: Subject: Re: [RFC v1 4/6] init: main: add KUnit to kernel init To: Stephen Boyd Cc: Andrew Morton , Alan Maguire , Anton Ivanov , Arnd Bergmann , David Gow , Jeff Dike , Kees Cook , Richard Weinberger , rppt@linux.ibm.com, Shuah Khan , Iurii Zaikin , Greg KH , Logan Gunthorpe , Luis Chamberlain , Knut Omang , linux-um , linux-arch@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , KUnit Development , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry for the late reply. I sent this thinking I would check in over vacation, and then didn't. On Mon, Dec 16, 2019 at 11:58 PM Stephen Boyd wrote: > > Quoting Brendan Higgins (2019-12-16 14:05:53) > > Remove KUnit from init calls entirely, instead call directly from > > kernel_init(). > > Yes, but why? Is it desired to run the unit tests earlier than opening > the console or something? I want to make sure it is called after late_init is done (so that you can test things initialized in late_init). And I want to make sure it runs before init*fs is loaded so that there is a mechanism to run tests without having to put a userland together. > > diff --git a/lib/kunit/executor.c b/lib/kunit/executor.c > > index 978086cfd257d..ca880224c0bab 100644 > > --- a/lib/kunit/executor.c > > +++ b/lib/kunit/executor.c > > @@ -32,12 +32,10 @@ static bool kunit_run_all_tests(void) > > return !has_test_failed; > > } > > > > -static int kunit_executor_init(void) > > +int kunit_executor_init(void) > > Should be marked __init? Even before this patch presumably. Just this function? No strong opinion. If by "before this patch" you mean other stuff in this patchset? > > { > > if (kunit_run_all_tests()) > > return 0; > > else > > return -EFAULT; > > } > > - > > -late_initcall(kunit_executor_init);