From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933135AbcCIQJx (ORCPT ); Wed, 9 Mar 2016 11:09:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41089 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932401AbcCIQJq (ORCPT ); Wed, 9 Mar 2016 11:09:46 -0500 Date: Wed, 9 Mar 2016 10:09:41 -0600 From: Josh Poimboeuf To: Ingo Molnar Cc: Arnaldo Carvalho de Melo , Thomas Gleixner , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Michal Marek , Peter Zijlstra , Andy Lutomirski , Borislav Petkov , Linus Torvalds , Andi Kleen , Pedro Alves , Namhyung Kim , Bernd Petrovitsch , Chris J Arges , Andrew Morton , Jiri Slaby , Arnaldo Carvalho de Melo Subject: Re: [PATCH 09/11] tools/objtool: Copy hashtable.h into tools directory Message-ID: <20160309160941.GA21308@treble.redhat.com> References: <20160308154909.GA20956@gmail.com> <20160309094759.GA11911@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160309094759.GA11911@gmail.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 09, 2016 at 10:47:59AM +0100, Ingo Molnar wrote: > > * Josh Poimboeuf wrote: > > > Copy hashtable.h from include/linux/tools.h. It's needed by objtool in > > the next patch in the series. > > > > Add some includes that it needs, and remove references to > > kernel-specific features like RCU and __read_mostly. > > > > Also change some if its dependency headers' includes to use quotes > > instead of brackets so gcc can find them. > > > > Signed-off-by: Josh Poimboeuf > > --- > > tools/include/asm-generic/bitops/__fls.h | 2 +- > > tools/include/asm-generic/bitops/fls.h | 2 +- > > tools/include/asm-generic/bitops/fls64.h | 2 +- > > tools/include/linux/hashtable.h | 152 +++++++++++++++++++++++++++++++ > > 4 files changed, 155 insertions(+), 3 deletions(-) > > So it would be nice to also add a build time warning if the 'upstream' copy of > hashtable.h deviates from the tooling file. > > Just like you are already doing it for other files: > > objtool/Makefile: diff -I'^#include' arch/x86/insn/insn.c ../../arch/x86/lib/insn.c >/dev/null && \ > > Btw., eventually we might want to factor out such duplication into a single place > in tools/lib/ or so, to only have a 'master copy' (upstream kernel source), and > the tooling copy. Yeah, since we already have at least two instances of this type of diffing in the tools tree, it would be good to generalize these diffs in a common place with a common kernel build target. I'll add it to my TODOs. BTW, do you know why the policy is to copy them instead of just including the kernel versions? If the goal is to make it easier to package the tools separately, wouldn't something like the perf MANIFEST file make that possible without copying? Or if the goal is only to make it possible to compile kernel headers in user space, then we may only need to copy or recreate some headers and I may have been overzealous with my copying. -- Josh