[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130912204313.GA3259@gmail.com>
Date: Thu, 12 Sep 2013 22:43:13 +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
* Ingo Molnar <mingo@...nel.org> wrote:
> 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.
A successfull 'make' attempt of a target file within a separate, simple
Makefile is very, very fast:
comet:~/tip/tools/power/x86/turbostat> perf stat --null --sync --repeat 10
make turbostat
make: `turbostat' is up to date.
make: `turbostat' is up to date.
make: `turbostat' is up to date.
make: `turbostat' is up to date.
make: `turbostat' is up to date.
make: `turbostat' is up to date.
make: `turbostat' is up to date.
make: `turbostat' is up to date.
make: `turbostat' is up to date.
make: `turbostat' is up to date.
Performance counter stats for 'make turbostat' (10 runs):
0.002146182 seconds time elapsed ( +- 0.35% )
That's 2 msecs only. 20 such tests will take less than 50 msecs in the
'cached' case.
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