[llvm-commits] CVS: poolalloc/test/TEST.p4perf.Makefile TEST.p4perf.report
John Criswell
criswell at cs.uiuc.edu
Sun Mar 7 19:38:31 PST 2004
Changes in directory poolalloc/test:
TEST.p4perf.Makefile added (r1.1)
TEST.p4perf.report added (r1.1)
---
Log message:
Addition of Pentium 4 Makefiles.
---
Diffs of the changes: (+262 -0)
Index: poolalloc/test/TEST.p4perf.Makefile
diff -c /dev/null poolalloc/test/TEST.p4perf.Makefile:1.1
*** /dev/null Fri Mar 5 17:40:23 2004
--- poolalloc/test/TEST.p4perf.Makefile Fri Mar 5 17:39:43 2004
***************
*** 0 ****
--- 1,174 ----
+ ##===- test/Programs/TEST.vtl.Makefile ---------------------*- Makefile -*-===##
+ #
+ # Makefile for getting performance metrics using Intel's VTune.
+ #
+ ##===----------------------------------------------------------------------===##
+
+ TESTNAME = $*
+ CURDIR := $(shell cd .; pwd)
+ PROGDIR := $(shell cd $(LEVEL)/test/Programs; pwd)/
+ RELDIR := $(subst $(PROGDIR),,$(CURDIR))
+
+ PERFEX := /home/vadve/criswell/local/Linux/bin/perfex
+
+ PERFOUT := /home/vadve/criswell/perf.out
+ PERFSCRIPT := $(BUILD_SRC_DIR)/perf.awk
+
+ #
+ # Events for the AMD K7 (Athlon) processors
+ #
+ K7_REFILL_SYSTEM := 0x00411F43
+ K7_REFILL_L2 := 0x00411F42
+ K7_CACHE_MISSES := 0x00410041
+ K7_CACHE_ACCESSES := 0x00410040
+
+ K7_EVENTS := -e $(K7_REFILL_SYSTEM) -e $(K7_REFILL_L2) -e $(K7_CACHE_MISSES) -e $(K7_CACHE_ACCESSES)
+
+ #
+ # Events for the Pentium 4/Xeon processors
+ #
+ P4_L1_READ_MISS := -e 0x0003B000/0x12000204 at 0x8000000C --p4pe=0x01000001 --p4pmv=0x1
+ P4_L2_READ_MISS := -e 0x0003B000/0x12002204 at 0x8000000E --p4pe=0x01000002 --p4pmv=0x1
+ #P4_L2_READ_MISS := -e 0x0003B000/0x12000204 at 0x8000000E --p4pe=0x01000002 --p4pmv=0x1
+
+ P4_EVENTS := $(P4_L1_READ_MISS) $(P4_L2_READ_MISS)
+
+ EVENTS := $(P4_EVENTS)
+
+ ############################################################################
+ # Once the results are generated, create files containing each individiual
+ # piece of performance information.
+ ############################################################################
+
+ # Pentium 4/Xeon Events
+ ifeq ($(EVENTS),$(P4_EVENTS))
+ $(PROGRAMS_TO_TEST:%=Output/$(TEST).L1Misses.%): \
+ Output/$(TEST).L1Misses.%: Output/test.$(TEST).%
+ $(VERB) grep 0x12000204 $< | awk '{print $$(NF)}' > $@
+
+ $(PROGRAMS_TO_TEST:%=Output/$(TEST).L1Misses.pa.%): \
+ Output/$(TEST).L1Misses.pa.%: Output/test.$(TEST).pa.%
+ $(VERB) grep 0x12000204 $< | awk '{print $$(NF)}' > $@
+
+ $(PROGRAMS_TO_TEST:%=Output/$(TEST).L2Misses.%): \
+ Output/$(TEST).L2Misses.%: Output/test.$(TEST).%
+ $(VERB) grep 0x12002204 $< | awk '{print $$(NF)}' > $@
+
+ $(PROGRAMS_TO_TEST:%=Output/$(TEST).L2Misses.pa.%): \
+ Output/$(TEST).L2Misses.pa.%: Output/test.$(TEST).pa.%
+ $(VERB) grep 0x12002204 $< | awk '{print $$(NF)}' > $@
+ endif
+
+ ############################################################################
+ # Rules for running the tests
+ ############################################################################
+
+ ifndef PROGRAMS_HAVE_CUSTOM_RUN_RULES
+
+ #
+ # Generate events for Pool Allocated CBE
+ #
+ $(PROGRAMS_TO_TEST:%=Output/test.$(TEST).pa.%): \
+ Output/test.$(TEST).pa.%: Output/%.poolalloc.cbe Output/test.$(TEST).%
+ @echo "========================================="
+ @echo "Running '$(TEST)' test on '$(TESTNAME)' program"
+ ifeq ($(RUN_OPTIONS),)
+ $(VERB) cat $(STDIN_FILENAME) | $(PERFEX) -o $@.1 $(P4_L1_READ_MISS) $< > /dev/null
+ $(VERB) cat $(STDIN_FILENAME) | $(PERFEX) -o $@.2 $(P4_L2_READ_MISS) $< > /dev/null
+ else
+ $(VERB) cat $(STDIN_FILENAME) | $(PERFEX) -o $@.1 $(P4_L1_READ_MISS) $< $(RUN_OPTIONS) > /dev/null
+ $(VERB) cat $(STDIN_FILENAME) | $(PERFEX) -o $@.2 $(P4_L2_READ_MISS) $< $(RUN_OPTIONS) > /dev/null
+ endif
+ @cat $@.1 $@.2 > $@
+
+ #
+ # Generate events for CBE
+ #
+ $(PROGRAMS_TO_TEST:%=Output/test.$(TEST).%): \
+ Output/test.$(TEST).%: Output/%.nonpa.cbe
+ @echo "========================================="
+ @echo "Running '$(TEST)' test on '$(TESTNAME)' program"
+ ifeq ($(RUN_OPTIONS),)
+ $(VERB) cat $(STDIN_FILENAME) | $(PERFEX) -o $@.1 $(P4_L1_READ_MISS) $< > /dev/null
+ $(VERB) cat $(STDIN_FILENAME) | $(PERFEX) -o $@.2 $(P4_L2_READ_MISS) $< > /dev/null
+ else
+ $(VERB) cat $(STDIN_FILENAME) | $(PERFEX) -o $@.1 $(P4_L1_READ_MISS) $< $(RUN_OPTIONS) > /dev/null
+ $(VERB) cat $(STDIN_FILENAME) | $(PERFEX) -o $@.2 $(P4_L2_READ_MISS) $< $(RUN_OPTIONS) > /dev/null
+ endif
+ @cat $@.1 $@.2 > $@
+
+ else
+
+ # This rule runs the generated executable, generating timing information, for
+ # SPEC
+ $(PROGRAMS_TO_TEST:%=Output/test.$(TEST).pa.%): \
+ Output/test.$(TEST).pa.%: Output/%.poolalloc.cbe
+ -$(SPEC_SANDBOX) poolalloccbe-$(RUN_TYPE) /dev/null $(REF_IN_DIR) \
+ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
+ $(PERFEX) -o $@.2 $(P4_L2_READ_MISSES) ../../$< $(RUN_OPTIONS)
+ -$(SPEC_SANDBOX) poolalloccbe-$(RUN_TYPE) /dev/null $(REF_IN_DIR) \
+ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
+ $(PERFEX) -o $@.1 $(P4_L1_READ_MISSES) ../../$< $(RUN_OPTIONS)
+ @cat $@.1 $@.2 > $@
+
+ # This rule runs the generated executable, generating timing information, for
+ # SPEC
+ $(PROGRAMS_TO_TEST:%=Output/test.$(TEST).%): \
+ Output/test.$(TEST).%: Output/%.nonpa.cbe
+ -$(SPEC_SANDBOX) nonpacbe-$(RUN_TYPE) /dev/null $(REF_IN_DIR) \
+ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
+ $(PERFEX) -o $@.2 $(P4_L2_READ_MISSES) ../../$< $(RUN_OPTIONS)
+ -$(SPEC_SANDBOX) nonpacbe-$(RUN_TYPE) /dev/null $(REF_IN_DIR) \
+ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
+ $(PERFEX) -o $@.1 $(P4_L1_READ_MISSES) ../../$< $(RUN_OPTIONS)
+ @cat $@.1 $@.2 > $@
+ endif
+
+ ############################################################################
+ # Report Targets
+ ############################################################################
+ ifeq ($(EVENTS),$(K7_EVENTS))
+ $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \
+ Output/%.$(TEST).report.txt: $(PROGRAMS_TO_TEST:%=Output/$(TEST).cacheaccesses.%) \
+ $(PROGRAMS_TO_TEST:%=Output/$(TEST).cacheaccesses.pa.%) \
+ $(PROGRAMS_TO_TEST:%=Output/$(TEST).cachemisses.%) \
+ $(PROGRAMS_TO_TEST:%=Output/$(TEST).cachemisses.pa.%) \
+ $(PROGRAMS_TO_TEST:%=Output/$(TEST).L1Misses.%) \
+ $(PROGRAMS_TO_TEST:%=Output/$(TEST).L1Misses.pa.%) \
+ $(PROGRAMS_TO_TEST:%=Output/$(TEST).L2Misses.%) \
+ $(PROGRAMS_TO_TEST:%=Output/$(TEST).L2Misses.pa.%)
+ @echo "Program:" $* > $@
+ @echo "-------------------------------------------------------------" >> $@
+ @printf "CBE-PA-Cache-Accesses: %lld\n" `cat Output/$(TEST).cacheaccesses.pa.$*` >> $@
+ @printf "CBE-Cache-Accesses: %lld\n" `cat Output/$(TEST).cacheaccesses.$*` >> $@
+ @printf "CBE-PA-Cache-Misses: %lld\n" `cat Output/$(TEST).cachemisses.pa.$*` >> $@
+ @printf "CBE-Cache-Misses: %lld\n" `cat Output/$(TEST).cachemisses.$*` >> $@
+ @printf "CBE-PA-L1-Cache-Misses: %lld\n" `cat Output/$(TEST).L1Misses.pa.$*` >> $@
+ @printf "CBE-L1-Cache-Misses: %lld\n" `cat Output/$(TEST).L1Misses.$*` >> $@
+ @printf "CBE-PA-L2-Cache-Misses: %lld\n" `cat Output/$(TEST).L2Misses.pa.$*` >> $@
+ @printf "CBE-L2-Cache-Misses: %lld\n" `cat Output/$(TEST).L2Misses.$*` >> $@
+ endif
+
+ ifeq ($(EVENTS),$(P4_EVENTS))
+ $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \
+ Output/%.$(TEST).report.txt: \
+ $(PROGRAMS_TO_TEST:%=Output/$(TEST).L1Misses.%) \
+ $(PROGRAMS_TO_TEST:%=Output/$(TEST).L1Misses.pa.%) \
+ $(PROGRAMS_TO_TEST:%=Output/$(TEST).L2Misses.%) \
+ $(PROGRAMS_TO_TEST:%=Output/$(TEST).L2Misses.pa.%)
+ @echo "Program:" $* > $@
+ @echo "-------------------------------------------------------------" >> $@
+ @printf "CBE-PA-L1-Cache-Misses: %lld\n" `cat Output/$(TEST).L1Misses.pa.$*` >> $@
+ @printf "CBE-L1-Cache-Misses: %lld\n" `cat Output/$(TEST).L1Misses.$*` >> $@
+ @printf "CBE-PA-L2-Cache-Misses: %lld\n" `cat Output/$(TEST).L2Misses.pa.$*` >> $@
+ @printf "CBE-L2-Cache-Misses: %lld\n" `cat Output/$(TEST).L2Misses.$*` >> $@
+
+ endif
+
+ $(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
+ test.$(TEST).%: Output/%.$(TEST).report.txt
+ @echo "---------------------------------------------------------------"
+ @echo ">>> ========= '$(RELDIR)/$*' Program"
+ @echo "---------------------------------------------------------------"
+ @cat $<
+
Index: poolalloc/test/TEST.p4perf.report
diff -c /dev/null poolalloc/test/TEST.p4perf.report:1.1
*** /dev/null Fri Mar 5 17:40:23 2004
--- poolalloc/test/TEST.p4perf.report Fri Mar 5 17:39:43 2004
***************
*** 0 ****
--- 1,88 ----
+ ##=== TEST.poolalloc.report - Report description for poolalloc -*- perl -*-===##
+ #
+ # This file defines a report to be generated for the pool allocator tests.
+ #
+ ##===----------------------------------------------------------------------===##
+
+ # Sort by program name
+ $SortCol = 0;
+ $TrimRepeatedPrefix = 1;
+
+ sub Ratio {
+ my ($Cols, $Col) = @_;
+ if ($Cols->[$Col-1] ne "*" and $Cols->[$Col-4] ne "*" and
+ $Cols->[$Col-1] != "0") {
+ return sprintf "%1.3f", $Cols->[$Col-4]/$Cols->[$Col-1];
+ } else {
+ return "n/a";
+ }
+ }
+
+ sub Sum {
+ my ($Cols, $Col) = @_;
+ if ($Cols->[$Col-1] ne "*" and $Cols->[$Col-2] ne "*") {
+ return sprintf "%1.3f", $Cols->[$Col-2]+$Cols->[$Col-1];
+ } else {
+ return "n/a";
+ }
+ }
+
+
+ sub FormatTime {
+ my $Time = shift;
+ if ($Time =~ m/([0-9]+)[m:]([0-9.]+)/) {
+ $Time = sprintf("%7.3f", $1*60.0+$2);
+ }
+ return $Time;
+ }
+
+ @LatexColumns = (2, 3, 4, 5, 6, 7);
+
+ my $OLDEN = 'MultiSource/Benchmarks/Olden';
+ my $FREEBENCH = 'MultiSource/Benchmarks/FreeBench';
+ my $PTRDIST = 'MultiSource/Benchmarks/Ptrdist';
+
+ @LatexRowMapOrder = (
+ "$OLDEN/bh/bh" => 'bh',
+ "$OLDEN/bisort/bisort" => 'bisort',
+ "$OLDEN/em3d/em3d" => 'em3d',
+ "$OLDEN/health/health" => 'health',
+ "$OLDEN/mst/mst" => 'mst',
+ "$OLDEN/perimeter/perimeter" => 'perimeter',
+ "$OLDEN/power/power" => 'power',
+ "$OLDEN/treeadd/treeadd" => 'treeadd',
+ "$OLDEN/tsp/tsp" => 'tsp',
+ "$OLDEN/voronoi/voronoi" => 'voronoi',
+ '-' => '-',
+ "$FREEBENCH/analyzer/analyzer" => 'analyzer',
+ # "$FREEBENCH/distray/distray" => 'distray',
+ # "$FREEBENCH/fourinarow/fourinarow" => 'fourinarow',
+ # "$FREEBENCH/mason/mason" => 'mason',
+ "$FREEBENCH/neural/neural" => 'neural',
+ "$FREEBENCH/pcompress2/pcompress2" => 'pcompress2',
+ "$FREEBENCH/pifft/pifft" => 'pifft',
+ '-' => '-',
+ "$PTRDIST/anagram/anagram" => 'anagram',
+ "$PTRDIST/bc/bc" => 'bc',
+ "$PTRDIST/ft/ft" => 'ft',
+ "$PTRDIST/ks/ks" => 'ks',
+ "$PTRDIST/yacr2/yacr2" => 'yacr2',
+ );
+
+
+ # These are the columns for the report. The first entry is the header for the
+ # column, the second is the regex to use to match the value. Empty list create
+ # seperators, and closures may be put in for custom processing.
+ (
+ # Name
+ ["Name:" , '\'([^\']+)\' Program'],
+ [],
+ # Times
+ ["L1Misses", 'CBE-L1-Cache-Misses: ([0-9]+)'],
+ ["L2Misses", 'CBE-L2-Cache-Misses: ([.0-9]+)'],
+
+ ["PoolAllocL1Misses", 'CBE-PA-L1-Cache-Misses: ([0-9]+)'],
+ ["PoolAllocL2Misses", 'CBE-PA-L2-Cache-Misses: ([.0-9]+)'],
+ []
+ );
+
More information about the llvm-commits
mailing list