[test-suite] r209797 - Revert "Revert perf tool patch, as it breaks buildbots"

David Blaikie dblaikie at gmail.com
Thu May 29 09:40:26 PDT 2014


On Thu, May 29, 2014 at 1:21 AM, Yi Kong <Yi.Kong at arm.com> wrote:
> Author: kongyi
> Date: Thu May 29 03:21:43 2014
> New Revision: 209797
>
> URL: http://llvm.org/viewvc/llvm-project?rev=209797&view=rev
> Log:
> Revert "Revert perf tool patch, as it breaks buildbots"

It's helpful to mention the revisions that were reverted/unreverted,
and explain why in the commit message ("Recommit rXXXX (reverted in
rYYYY) now that <blah> has been addressed by <blah>")

>
> Added:
>     test-suite/trunk/tools/timeit.sh
> Modified:
>     test-suite/trunk/tools/Makefile
>
> Modified: test-suite/trunk/tools/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/tools/Makefile?rev=209797&r1=209796&r2=209797&view=diff
> ==============================================================================
> --- test-suite/trunk/tools/Makefile (original)
> +++ test-suite/trunk/tools/Makefile Thu May 29 03:21:43 2014
> @@ -8,8 +8,17 @@ ifndef USER_MODE_EMULATION
>  all:: timeit-target
>  endif
>
> +ifeq ($(TARGET_OS),Linux)
> +all:: ctimeit
> +timeit: timeit.sh
> +       cp -f $< $@
> +       chmod u+x $@
> +ctimeit: timeit.c
> +       $(ORIGINAL_CC) $(CFLAGS) -O3 -o $@ $<
> +else
>  timeit: timeit.c
>         $(ORIGINAL_CC) $(CFLAGS) -O3 -o $@ $<
> +endif
>
>  timeit-target: timeit.c
>         $(LD_ENV_OVERRIDES) $(LCC) -o $@ $< $(LDFLAGS) $(CFLAGS) $(TARGET_FLAGS) -O3
>
> Added: test-suite/trunk/tools/timeit.sh
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/tools/timeit.sh?rev=209797&view=auto
> ==============================================================================
> --- test-suite/trunk/tools/timeit.sh (added)
> +++ test-suite/trunk/tools/timeit.sh Thu May 29 03:21:43 2014
> @@ -0,0 +1,38 @@
> +#! /bin/bash
> +# A wrapper over perf to provide similar functionality to timeit.c
> +
> +DEPENDS="perf schedtool"
> +
> +# Fallback to ctimeit if dependencies are not met
> +for cmd in ${DEPENDS} ; do
> +       if ! command -v ${cmd} &> /dev/null ; then
> +               $(dirname $0)/ctimeit $@
> +               exit $?
> +       fi
> +done
> +
> +REPORT=/dev/stderr
> +INPUT=/dev/stdin
> +OUTPUT=/dev/stdout
> +
> +while [[ $1 = -* ]]; do
> +       if [ $1 = "--summary" ]; then
> +               REPORT=$2
> +       elif [ $1 = "--redirect-input" ]; then
> +               INPUT=$2
> +       elif [ $1 = "--redirect-output" ]; then
> +               OUTPUT=$2
> +       fi
> +       shift 2
> +done
> +
> +perf stat -o stats schedtool -a 0x1 -e $@ < $INPUT > $OUTPUT
> +
> +EXITCODE=$?
> +
> +echo exit $EXITCODE > $REPORT
> +awk -F' ' '{if ($2 == "task-clock") print "user",$1/1000; else if($2 =="seconds") print "real",$1;}' stats >> $REPORT
> +
> +rm stats
> +
> +exit $EXITCODE
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list