[test-suite] r224573 - Merging r218054:

Daniel Sanders daniel.sanders at imgtec.com
Fri Dec 19 05:02:00 PST 2014


Author: dsanders
Date: Fri Dec 19 07:02:00 2014
New Revision: 224573

URL: http://llvm.org/viewvc/llvm-project?rev=224573&view=rev
Log:
Merging r218054:
------------------------------------------------------------------------
r218054 | kongyi | 2014-09-18 16:50:47 +0100 (Thu, 18 Sep 2014) | 9 lines

Make the use of Perf optional

Do not try to automatically detect and use perf on Linux, thus giving
user more control of which tool to use.

Also this fixes the mistake that Perf wasn't used when not using
user mode emulation.


------------------------------------------------------------------------

Modified:
    test-suite/branches/release_35/   (props changed)
    test-suite/branches/release_35/tools/Makefile
    test-suite/branches/release_35/tools/timeit.sh

Propchange: test-suite/branches/release_35/
------------------------------------------------------------------------------
    svn:mergeinfo = /test-suite/trunk:218054

Modified: test-suite/branches/release_35/tools/Makefile
URL: http://llvm.org/viewvc/llvm-project/test-suite/branches/release_35/tools/Makefile?rev=224573&r1=224572&r2=224573&view=diff
==============================================================================
--- test-suite/branches/release_35/tools/Makefile (original)
+++ test-suite/branches/release_35/tools/Makefile Fri Dec 19 07:02:00 2014
@@ -8,20 +8,21 @@ 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
+ifndef USE_PERF
 timeit: timeit.c
 	$(ORIGINAL_CC) $(CFLAGS) -O3 -o $@ $<
-endif
 
 timeit-target: timeit.c
 	$(LD_ENV_OVERRIDES) $(LCC) -o $@ $< $(LDFLAGS) $(CFLAGS) $(TARGET_FLAGS) -O3
+else
+timeit: timeit.sh
+	cp -f $< $@
+	chmod u+x $@
+
+timeit-target: timeit.sh
+	cp -f $< $@
+	chmod u+x $@
+endif
 
 fpcmp: fpcmp.c
 	$(ORIGINAL_CC) $(CFLAGS) -O3 -o $@ $<

Modified: test-suite/branches/release_35/tools/timeit.sh
URL: http://llvm.org/viewvc/llvm-project/test-suite/branches/release_35/tools/timeit.sh?rev=224573&r1=224572&r2=224573&view=diff
==============================================================================
--- test-suite/branches/release_35/tools/timeit.sh (original)
+++ test-suite/branches/release_35/tools/timeit.sh Fri Dec 19 07:02:00 2014
@@ -1,16 +1,6 @@
 #! /bin/bash
 # A wrapper over perf to provide similar functionality to timeit.c
 
-DEPENDS="perf"
-
-# 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
@@ -26,7 +16,7 @@ while [[ $1 = -* ]]; do
 	shift 2
 done
 
-perf stat -o stats $@ < $INPUT > $OUTPUT
+perf stat -o $PERFSTAT $@ < $INPUT &> $OUTPUT
 
 EXITCODE=$?
 





More information about the llvm-commits mailing list