From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on archive.lwn.net X-Spam-Level: X-Spam-Status: No, score=-6.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by archive.lwn.net (Postfix) with ESMTP id 409257D2EF for ; Fri, 17 May 2019 00:35:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726566AbfEQAfY (ORCPT ); Thu, 16 May 2019 20:35:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:47334 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726241AbfEQAfX (ORCPT ); Thu, 16 May 2019 20:35:23 -0400 Received: from kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A48A7206BF; Fri, 17 May 2019 00:35:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558053322; bh=7TW9YRtA+zrn9bZVhm3pRMCNMOGMBXRGC3+aYbhED+Q=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=2IVzgl9AIPO++Ch2lD+HPwvhsbPyCjqMp1srxLDmXKAwP6rd65u7Wus1PDx6ERIac JgIJlEX6orOSTCbWhyMS/r6KVO9ATGZRYWIsOwLBH7NuKkS7fRkhmj+govo4YPjBBW njgrIlohapBLa9e+A8WE0GpgY53wrangCoB5QG44= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20190514221711.248228-2-brendanhiggins@google.com> References: <20190514221711.248228-1-brendanhiggins@google.com> <20190514221711.248228-2-brendanhiggins@google.com> Subject: Re: [PATCH v4 01/18] kunit: test: add KUnit test runner core From: Stephen Boyd Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-nvdimm@lists.01.org, linux-um@lists.infradead.org, Alexander.Levin@microsoft.com, Tim.Bird@sony.com, amir73il@gmail.com, dan.carpenter@oracle.com, daniel@ffwll.ch, jdike@addtoit.com, joel@jms.id.au, julia.lawall@lip6.fr, khilman@baylibre.com, knut.omang@oracle.com, logang@deltatee.com, mpe@ellerman.id.au, pmladek@suse.com, rdunlap@infradead.org, richard@nod.at, rientjes@google.com, rostedt@goodmis.org, wfg@linux.intel.com, Brendan Higgins To: Brendan Higgins , frowand.list@gmail.com, gregkh@linuxfoundation.org, jpoimboe@redhat.com, keescook@google.com, kieran.bingham@ideasonboard.com, mcgrof@kernel.org, peterz@infradead.org, robh@kernel.org, shuah@kernel.org, tytso@mit.edu, yamada.masahiro@socionext.com User-Agent: alot/0.8.1 Date: Thu, 16 May 2019 17:35:21 -0700 Message-Id: <20190517003522.A48A7206BF@mail.kernel.org> Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org Quoting Brendan Higgins (2019-05-14 15:16:54) > diff --git a/include/kunit/test.h b/include/kunit/test.h > new file mode 100644 > index 0000000000000..e682ea0e1f9a5 > --- /dev/null > +++ b/include/kunit/test.h > @@ -0,0 +1,162 @@ [..] > +/** > + * struct kunit - represents a running instance of a test. > + * @priv: for user to store arbitrary data. Commonly used to pass data c= reated > + * in the init function (see &struct kunit_module). > + * > + * Used to store information about the current context under which the t= est is > + * running. Most of this data is private and should only be accessed ind= irectly > + * via public functions; the one exception is @priv which can be used by= the > + * test writer to store arbitrary data. > + */ > +struct kunit { > + void *priv; > + > + /* private: internal use only. */ > + const char *name; /* Read only after initialization! */ > + spinlock_t lock; /* Gaurds all mutable test state. */ > + bool success; /* Protected by lock. */ Is this all the spinlock protects? Doesn't seem useful if it's just protecting access to the variable being set or not because code that reads it will have a stale view of the value. > diff --git a/kunit/test.c b/kunit/test.c > new file mode 100644 > index 0000000000000..86f65ba2bcf92 > --- /dev/null > +++ b/kunit/test.c > @@ -0,0 +1,229 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Base unit test (KUnit) API. > + * > + * Copyright (C) 2019, Google LLC. > + * Author: Brendan Higgins > + */ > + > +#include > +#include > +#include > + [...] > + > +size_t kunit_module_counter =3D 1; static? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]:47334 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726241AbfEQAfX (ORCPT ); Thu, 16 May 2019 20:35:23 -0400 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20190514221711.248228-2-brendanhiggins@google.com> References: <20190514221711.248228-1-brendanhiggins@google.com> <20190514221711.248228-2-brendanhiggins@google.com> Subject: Re: [PATCH v4 01/18] kunit: test: add KUnit test runner core From: Stephen Boyd Date: Thu, 16 May 2019 17:35:21 -0700 Message-Id: <20190517003522.A48A7206BF@mail.kernel.org> Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: frowand.list@gmail.com, gregkh@linuxfoundation.org, jpoimboe@redhat.com, keescook@google.com, kieran.bingham@ideasonboard.com, mcgrof@kernel.org, peterz@infradead.org, robh@kernel.org, shuah@kernel.org, tytso@mit.edu, yamada.masahiro@socionext.com Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-nvdimm@lists.01.org, linux-um@lists.infradead.org, Alexander.Levin@microsoft.com, Tim.Bird@sony.com, amir73il@gmail.com, dan.carpenter@oracle.com, daniel@ffwll.ch, jdike@addtoit.com, joel@jms.id.au, julia.lawall@lip6.fr, khilman@baylibre.com, knut.omang@oracle.com, logang@deltatee.com, mpe@ellerman.id.au, pmladek@suse.com, rdunlap@infradead.org, richard@nod.at, rientjes@google.com, rostedt@goodmis.org, wfg@linux.intel.com, Brendan Higgins Quoting Brendan Higgins (2019-05-14 15:16:54) > diff --git a/include/kunit/test.h b/include/kunit/test.h > new file mode 100644 > index 0000000000000..e682ea0e1f9a5 > --- /dev/null > +++ b/include/kunit/test.h > @@ -0,0 +1,162 @@ [..] > +/** > + * struct kunit - represents a running instance of a test. > + * @priv: for user to store arbitrary data. Commonly used to pass data c= reated > + * in the init function (see &struct kunit_module). > + * > + * Used to store information about the current context under which the t= est is > + * running. Most of this data is private and should only be accessed ind= irectly > + * via public functions; the one exception is @priv which can be used by= the > + * test writer to store arbitrary data. > + */ > +struct kunit { > + void *priv; > + > + /* private: internal use only. */ > + const char *name; /* Read only after initialization! */ > + spinlock_t lock; /* Gaurds all mutable test state. */ > + bool success; /* Protected by lock. */ Is this all the spinlock protects? Doesn't seem useful if it's just protecting access to the variable being set or not because code that reads it will have a stale view of the value. > diff --git a/kunit/test.c b/kunit/test.c > new file mode 100644 > index 0000000000000..86f65ba2bcf92 > --- /dev/null > +++ b/kunit/test.c > @@ -0,0 +1,229 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Base unit test (KUnit) API. > + * > + * Copyright (C) 2019, Google LLC. > + * Author: Brendan Higgins > + */ > + > +#include > +#include > +#include > + [...] > + > +size_t kunit_module_counter =3D 1; static? From mboxrd@z Thu Jan 1 00:00:00 1970 From: sboyd at kernel.org (Stephen Boyd) Date: Thu, 16 May 2019 17:35:21 -0700 Subject: [PATCH v4 01/18] kunit: test: add KUnit test runner core In-Reply-To: <20190514221711.248228-2-brendanhiggins@google.com> References: <20190514221711.248228-1-brendanhiggins@google.com> <20190514221711.248228-2-brendanhiggins@google.com> Message-ID: <20190517003522.A48A7206BF@mail.kernel.org> Quoting Brendan Higgins (2019-05-14 15:16:54) > diff --git a/include/kunit/test.h b/include/kunit/test.h > new file mode 100644 > index 0000000000000..e682ea0e1f9a5 > --- /dev/null > +++ b/include/kunit/test.h > @@ -0,0 +1,162 @@ [..] > +/** > + * struct kunit - represents a running instance of a test. > + * @priv: for user to store arbitrary data. Commonly used to pass data created > + * in the init function (see &struct kunit_module). > + * > + * Used to store information about the current context under which the test is > + * running. Most of this data is private and should only be accessed indirectly > + * via public functions; the one exception is @priv which can be used by the > + * test writer to store arbitrary data. > + */ > +struct kunit { > + void *priv; > + > + /* private: internal use only. */ > + const char *name; /* Read only after initialization! */ > + spinlock_t lock; /* Gaurds all mutable test state. */ > + bool success; /* Protected by lock. */ Is this all the spinlock protects? Doesn't seem useful if it's just protecting access to the variable being set or not because code that reads it will have a stale view of the value. > diff --git a/kunit/test.c b/kunit/test.c > new file mode 100644 > index 0000000000000..86f65ba2bcf92 > --- /dev/null > +++ b/kunit/test.c > @@ -0,0 +1,229 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Base unit test (KUnit) API. > + * > + * Copyright (C) 2019, Google LLC. > + * Author: Brendan Higgins > + */ > + > +#include > +#include > +#include > + [...] > + > +size_t kunit_module_counter = 1; static? From mboxrd@z Thu Jan 1 00:00:00 1970 From: sboyd@kernel.org (Stephen Boyd) Date: Thu, 16 May 2019 17:35:21 -0700 Subject: [PATCH v4 01/18] kunit: test: add KUnit test runner core In-Reply-To: <20190514221711.248228-2-brendanhiggins@google.com> References: <20190514221711.248228-1-brendanhiggins@google.com> <20190514221711.248228-2-brendanhiggins@google.com> Message-ID: <20190517003522.A48A7206BF@mail.kernel.org> Content-Type: text/plain; charset="UTF-8" Message-ID: <20190517003521.2crqZ8BlZjtv6iHOD2KpY1lqY9xw7jVzaTeaqq1vDJw@z> Quoting Brendan Higgins (2019-05-14 15:16:54) > diff --git a/include/kunit/test.h b/include/kunit/test.h > new file mode 100644 > index 0000000000000..e682ea0e1f9a5 > --- /dev/null > +++ b/include/kunit/test.h > @@ -0,0 +1,162 @@ [..] > +/** > + * struct kunit - represents a running instance of a test. > + * @priv: for user to store arbitrary data. Commonly used to pass data created > + * in the init function (see &struct kunit_module). > + * > + * Used to store information about the current context under which the test is > + * running. Most of this data is private and should only be accessed indirectly > + * via public functions; the one exception is @priv which can be used by the > + * test writer to store arbitrary data. > + */ > +struct kunit { > + void *priv; > + > + /* private: internal use only. */ > + const char *name; /* Read only after initialization! */ > + spinlock_t lock; /* Gaurds all mutable test state. */ > + bool success; /* Protected by lock. */ Is this all the spinlock protects? Doesn't seem useful if it's just protecting access to the variable being set or not because code that reads it will have a stale view of the value. > diff --git a/kunit/test.c b/kunit/test.c > new file mode 100644 > index 0000000000000..86f65ba2bcf92 > --- /dev/null > +++ b/kunit/test.c > @@ -0,0 +1,229 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Base unit test (KUnit) API. > + * > + * Copyright (C) 2019, Google LLC. > + * Author: Brendan Higgins > + */ > + > +#include > +#include > +#include > + [...] > + > +size_t kunit_module_counter = 1; static? From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Boyd Subject: Re: [PATCH v4 01/18] kunit: test: add KUnit test runner core Date: Thu, 16 May 2019 17:35:21 -0700 Message-ID: <20190517003522.A48A7206BF@mail.kernel.org> References: <20190514221711.248228-1-brendanhiggins@google.com> <20190514221711.248228-2-brendanhiggins@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190514221711.248228-2-brendanhiggins-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org Sender: "Linux-nvdimm" To: frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, jpoimboe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, keescook-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, kieran.bingham-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org, mcgrof-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, shuah-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, tytso-3s7WtUTddSA@public.gmane.org, yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org Cc: pmladek-IBi9RG/b67k@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, amir73il-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, Brendan Higgins , dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, Alexander.Levin-0li6OtcxBFHby3iVrkZq2A@public.gmane.org, linux-kselftest-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org, khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org, knut.omang-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org, wfg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, joel-U3u1mxZcP9KHXe+LvDLADg@public.gmane.org, rientjes-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, jdike-OPE4K8JWMJJBDgjK7y7TUQ@public.gmane.org, dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kbuild-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Tim.Bird-7U/KSKJipcs@public.gmane.org, linux-um-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, rostedt-nx8X9YLhiw1AfugRpC6u6w@public.gmane.org, julia.lawall-L2FTfq7BK8M@public.gmane.org, kunit-dev-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, richard-/L3Ra7n9ekc@public.gmane.org, rdunlap-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, daniel-/w4YWyX8dFk@public.gmane.org, mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-nvdimm@lists.01.org Quoting Brendan Higgins (2019-05-14 15:16:54) > diff --git a/include/kunit/test.h b/include/kunit/test.h > new file mode 100644 > index 0000000000000..e682ea0e1f9a5 > --- /dev/null > +++ b/include/kunit/test.h > @@ -0,0 +1,162 @@ [..] > +/** > + * struct kunit - represents a running instance of a test. > + * @priv: for user to store arbitrary data. Commonly used to pass data created > + * in the init function (see &struct kunit_module). > + * > + * Used to store information about the current context under which the test is > + * running. Most of this data is private and should only be accessed indirectly > + * via public functions; the one exception is @priv which can be used by the > + * test writer to store arbitrary data. > + */ > +struct kunit { > + void *priv; > + > + /* private: internal use only. */ > + const char *name; /* Read only after initialization! */ > + spinlock_t lock; /* Gaurds all mutable test state. */ > + bool success; /* Protected by lock. */ Is this all the spinlock protects? Doesn't seem useful if it's just protecting access to the variable being set or not because code that reads it will have a stale view of the value. > diff --git a/kunit/test.c b/kunit/test.c > new file mode 100644 > index 0000000000000..86f65ba2bcf92 > --- /dev/null > +++ b/kunit/test.c > @@ -0,0 +1,229 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Base unit test (KUnit) API. > + * > + * Copyright (C) 2019, Google LLC. > + * Author: Brendan Higgins > + */ > + > +#include > +#include > +#include > + [...] > + > +size_t kunit_module_counter = 1; static? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hRQqJ-0003dT-Ow for linux-um@lists.infradead.org; Fri, 17 May 2019 00:35:24 +0000 MIME-Version: 1.0 In-Reply-To: <20190514221711.248228-2-brendanhiggins@google.com> References: <20190514221711.248228-1-brendanhiggins@google.com> <20190514221711.248228-2-brendanhiggins@google.com> Subject: Re: [PATCH v4 01/18] kunit: test: add KUnit test runner core From: Stephen Boyd Date: Thu, 16 May 2019 17:35:21 -0700 Message-Id: <20190517003522.A48A7206BF@mail.kernel.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: Brendan Higgins , frowand.list@gmail.com, gregkh@linuxfoundation.org, jpoimboe@redhat.com, keescook@google.com, kieran.bingham@ideasonboard.com, mcgrof@kernel.org, peterz@infradead.org, robh@kernel.org, shuah@kernel.org, tytso@mit.edu, yamada.masahiro@socionext.com Cc: pmladek@suse.com, linux-doc@vger.kernel.org, amir73il@gmail.com, Brendan Higgins , dri-devel@lists.freedesktop.org, Alexander.Levin@microsoft.com, linux-kselftest@vger.kernel.org, linux-nvdimm@lists.01.org, khilman@baylibre.com, knut.omang@oracle.com, wfg@linux.intel.com, joel@jms.id.au, rientjes@google.com, jdike@addtoit.com, dan.carpenter@oracle.com, devicetree@vger.kernel.org, linux-kbuild@vger.kernel.org, Tim.Bird@sony.com, linux-um@lists.infradead.org, rostedt@goodmis.org, julia.lawall@lip6.fr, kunit-dev@googlegroups.com, richard@nod.at, rdunlap@infradead.org, linux-kernel@vger.kernel.org, daniel@ffwll.ch, mpe@ellerman.id.au, linux-fsdevel@vger.kernel.org, logang@deltatee.com Quoting Brendan Higgins (2019-05-14 15:16:54) > diff --git a/include/kunit/test.h b/include/kunit/test.h > new file mode 100644 > index 0000000000000..e682ea0e1f9a5 > --- /dev/null > +++ b/include/kunit/test.h > @@ -0,0 +1,162 @@ [..] > +/** > + * struct kunit - represents a running instance of a test. > + * @priv: for user to store arbitrary data. Commonly used to pass data created > + * in the init function (see &struct kunit_module). > + * > + * Used to store information about the current context under which the test is > + * running. Most of this data is private and should only be accessed indirectly > + * via public functions; the one exception is @priv which can be used by the > + * test writer to store arbitrary data. > + */ > +struct kunit { > + void *priv; > + > + /* private: internal use only. */ > + const char *name; /* Read only after initialization! */ > + spinlock_t lock; /* Gaurds all mutable test state. */ > + bool success; /* Protected by lock. */ Is this all the spinlock protects? Doesn't seem useful if it's just protecting access to the variable being set or not because code that reads it will have a stale view of the value. > diff --git a/kunit/test.c b/kunit/test.c > new file mode 100644 > index 0000000000000..86f65ba2bcf92 > --- /dev/null > +++ b/kunit/test.c > @@ -0,0 +1,229 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Base unit test (KUnit) API. > + * > + * Copyright (C) 2019, Google LLC. > + * Author: Brendan Higgins > + */ > + > +#include > +#include > +#include > + [...] > + > +size_t kunit_module_counter = 1; static? _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um