[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130912203116.GD32644@gmail.com>
Date: Thu, 12 Sep 2013 22:31:16 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Cc: David Ahern <dsahern@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Thomas Gleixner <tglx@...utronix.de>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [GIT PULL] perf fixes
* Arnaldo Carvalho de Melo <acme@...stprotocols.net> wrote:
> Em Thu, Sep 12, 2013 at 12:58:28PM -0700, David Ahern escreveu:
> > On 9/12/13 11:43 AM, Arnaldo Carvalho de Melo wrote:
> >
> > > Its something that annoys me as well, but not so much as to make me
> > > figure out how to make those be done only if some source file
> > > changed.
> >
> > Jiri and I have both taken stabs at a config-based build rather than
> > probing. Just need to finish it.
>
> But even then it would be nice to have a:
>
> make autoconfig
>
> That is what we have now, but only then we would try to do all that
> probing. Caching it somehow, as Ingo suggested, would get the best of
> both worlds.
Caching should be relatively straightforward: I'd suggest splitting up all
the feature tests current present in tools/perf/config/feature-tests.mak
into separate .c files which build into working binaries.
Instead of having 20 testcases crammed into a single Makefile:
comet:~/tip/tools/perf> git grep -w main config/feature-tests.mak
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(int argc, char *argv[])
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
config/feature-tests.mak:int main(void)
Why not put those into 20x standalone .c files and try to build them as an
explicit make command attempt from within the main Makefile? If the build
fails then the feature flag is set to off, if it succeeds it's defined.
That makes feature tests generally easier to debug, easier to understand
and generally easier to extend as well.
'Feature test binaries' that are already built will be 'cached'
automatically, and the result of their build attempt will be a quick
success.
This is relatively simple, well-known, powerful and I see no reason why it
wouldn't work. No separate config language or special files are needed -
just .c files, binaries and a Makefile.
'make clean' would get rid of the binaries.
[ It could even be made to work against package removal if we really
wanted to: if there's a common, known include file related to the
feature (such as /usr/include/libaudit.h), then that include file
could be added to the feature-test binary's list of dependencies. If the
package is removed and the include file goes away, then the dependency
breaks automatically and the binary is 'rebuilt', auto-detecting the
failed dependency. ]
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists