From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753564AbbICJeE (ORCPT ); Thu, 3 Sep 2015 05:34:04 -0400 Received: from ozlabs.org ([103.22.144.67]:55603 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753254AbbICJeB (ORCPT ); Thu, 3 Sep 2015 05:34:01 -0400 Message-ID: <1441272839.26379.2.camel@ellerman.id.au> Subject: Re: [PATCH 2/3] selftests: add membarrier syscall test From: Michael Ellerman To: Andy Lutomirski Cc: Mathieu Desnoyers , Andrew Morton , "linux-kernel@vger.kernel.org" , linux-api , Pranith Kumar Date: Thu, 03 Sep 2015 19:33:59 +1000 In-Reply-To: References: <1436561912-24365-1-git-send-email-mathieu.desnoyers@efficios.com> <1436561912-24365-3-git-send-email-mathieu.desnoyers@efficios.com> <1441004040.5735.7.camel@ellerman.id.au> <1071313434.33305.1441127478843.JavaMail.zimbra@efficios.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2015-09-01 at 11:32 -0700, Andy Lutomirski wrote: > On Tue, Sep 1, 2015 at 10:11 AM, Mathieu Desnoyers > wrote: > > Just to make sure I understand: should we expect that > > everyone will issue "make headers_install" on their system > > before doing a make kselftest ? > > > > I see that a few selftests (e.g. memfd) are adding the > > source tree include paths to the compiler include paths, > > which I guess is to ensure that the kselftest will > > work even if the system headers are not up to date. > > It would be really nice if there were a clean way for selftests to > include the kernel headers. What's wrong with make headers_install? Or do you mean when writing the tests? That we could fix by adding the ../../../../usr/include path to CFLAGS in lib.mk. And fixing all the tests that overwrite CFLAGS to append to CFLAGS. > Perhaps make should build the exportable headers somewhere as a dependency of > kselftests. Yeah the top-level kselftest target could do that I think. Folks who don't want the headers installed can just run the selftests Makefile directly. Does this work for you? diff --git a/Makefile b/Makefile index c361593..c8841d3 100644 --- a/Makefile +++ b/Makefile @@ -1080,7 +1080,7 @@ headers_check: headers_install # Kernel selftest PHONY += kselftest -kselftest: +kselftest: headers_install $(Q)$(MAKE) -C tools/testing/selftests run_tests # --------------------------------------------------------------------------- cheers