[test-suite] r262306 - lit: Add simple codesize module
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 1 12:00:15 PST 2016
patches welcome (sorry I couldn't resist).
This commit was meant to demonstrate how additional metrics can be collected and that the infrastructure is there. I hope that fine grained metrics will be added over time. I have no plans myself yet at the moment to figure out what metrics are actually useful, testing it on different targets making sure we don't fail when llvm-size is not in the PATH...
- Matthias
> On Mar 1, 2016, at 11:47 AM, Sean Silva via llvm-commits <llvm-commits at lists.llvm.org> wrote:
>
> Do you have llvm-size available? You could get some more fine-grained text/data/etc. information which might be more useful to track.
>
> -- Sean Silva
>
> On Mon, Feb 29, 2016 at 10:05 PM, Matthias Braun via llvm-commits <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
> Author: matze
> Date: Tue Mar 1 00:05:27 2016
> New Revision: 262306
>
> URL: http://llvm.org/viewvc/llvm-project?rev=262306&view=rev <http://llvm.org/viewvc/llvm-project?rev=262306&view=rev>
> Log:
> lit: Add simple codesize module
>
> This simply records the filesize of the executable.
>
> Added:
> test-suite/trunk/litsupport/codesize.py
> Modified:
> test-suite/trunk/litsupport/test.py
>
> Added: test-suite/trunk/litsupport/codesize.py
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/codesize.py?rev=262306&view=auto <http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/codesize.py?rev=262306&view=auto>
> ==============================================================================
> --- test-suite/trunk/litsupport/codesize.py (added)
> +++ test-suite/trunk/litsupport/codesize.py Tue Mar 1 00:05:27 2016
> @@ -0,0 +1,13 @@
> +import lit.Test
> +import logging
> +import shellcommand
> +import os.path
> +
> +
> +def collect(context, result):
> + try:
> + size = os.path.getsize(context.executable)
> + result.addMetric('size', lit.Test.toMetricValue(size))
> + except:
> + logging.info <http://logging.info/>('Could not calculate filesize for %s' %
> + context.executable)
>
> Modified: test-suite/trunk/litsupport/test.py
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/test.py?rev=262306&r1=262305&r2=262306&view=diff <http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/test.py?rev=262306&r1=262305&r2=262306&view=diff>
> ==============================================================================
> --- test-suite/trunk/litsupport/test.py (original)
> +++ test-suite/trunk/litsupport/test.py Tue Mar 1 00:05:27 2016
> @@ -8,6 +8,7 @@ from lit.TestRunner import executeScript
> from lit import Test
> from lit.util import to_bytes, to_string
>
> +import codesize
> import compiletime
> import hash
> import perf
> @@ -151,5 +152,6 @@ class TestSuiteTest(FileBasedTest):
> result.addMetric(metric, lit.Test.toMetricValue(values[0]))
> compiletime.collect(context, result)
> hash.collect(context, result)
> + codesize.collect(context, result)
>
> return result
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160301/e8fba4e2/attachment.html>
More information about the llvm-commits
mailing list