Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
5f0c89e0
Commit
5f0c89e0
authored
24 years ago
by
Keith Wansbrough
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 2000-07-17 18:44:16 by keithw]
Insert code to handle instruction counts from Heimdall, as well as CacheProf.
parent
eacefec6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
glafp-utils/runstdtest/runstdtest.prl
+32
-2
32 additions, 2 deletions
glafp-utils/runstdtest/runstdtest.prl
with
32 additions
and
2 deletions
glafp-utils/runstdtest/runstdtest.prl
+
32
−
2
View file @
5f0c89e0
...
...
@@ -62,6 +62,9 @@ $DefaultStderrFile = "$TmpPrefix/no_stderr$$";
$PreScript = '';
$PostScript = '';
$TimeCmd = '';
$Heimdall = 0;
$HeimdallPrefix = '';
$HeimdallStats = "heimdall.summary";
$StatsFile = "$TmpPrefix/stats$$";
$CacheProfStats = "cacheprof.out.summary";
$SysSpecificTiming = '';
...
...
@@ -114,6 +117,10 @@ arg: while ($_ = $ARGV[0]) {
/^-cacheprof$/ && do { $SysSpecificTiming = 'ghc-instrs';
$CacheProf = 'yes';
next arg };
/^-heimdall$/ && do { $HeimdallPrefix = 'heimdall_cp '; # must have trailing space!
$SysSpecificTiming = 'ghc-instrs';
$Heimdall = 1;
next arg; };
/^-t(.*)/ && do { $TimeCmd = &grab_arg_arg('-t', $1); next arg; };
# anything else is taken to be a pgm arg
...
...
@@ -192,7 +199,7 @@ cat /dev/null > $DefaultStdoutFile
cat /dev/null > $DefaultStderrFile
$PreScriptLines
$SpixifyLine1
$TimeCmd /bin/sh -c \'$ToRun $TimingMagic @PgmArgs < $PgmStdinFile 1> $TmpPrefix/runtest$$.1 2> $TmpPrefix/runtest$$.2 3> $TmpPrefix/runtest$$.3\'
$TimeCmd /bin/sh -c \'$
HeimdallPrefix$
ToRun $TimingMagic @PgmArgs < $PgmStdinFile 1> $TmpPrefix/runtest$$.1 2> $TmpPrefix/runtest$$.2 3> $TmpPrefix/runtest$$.3\'
progexit=\$?
if [ \$progexit -eq 0 ] && [ $PgmFail -ne 0 ]; then
echo $ToRun @PgmArgs \\< $PgmStdinFile
...
...
@@ -232,6 +239,9 @@ else
fi
egrep -v '^ld\.so:.*has older revision than expected' < $TmpPrefix/runtest$$.2 > $TmpPrefix/runtest$$.2b
mv -f $TmpPrefix/runtest$$.2b $TmpPrefix/runtest$$.2
egrep '^=== HEIMDALL: ' < $TmpPrefix/runtest$$.2 > $HeimdallStats
egrep -v '^=== HEIMDALL: ' < $TmpPrefix/runtest$$.2 > $TmpPrefix/runtest$$.2b
mv -f $TmpPrefix/runtest$$.2b $TmpPrefix/runtest$$.2
hit='NO'
for out_file in @PgmStderrFile ; do
...
...
@@ -280,10 +290,11 @@ if ( $SysSpecificTiming eq '' ) {
&process_stats_file();
&process_cacheprof_files() if $CacheProf eq 'yes';
&process_heimdall_file() if $Heimdall;
# print out what we found
print STDERR "<<$SysSpecificTiming: ";
if ( $CacheProf ne 'yes' ) {
if ( $CacheProf ne 'yes'
&& !$Heimdall
) {
print STDERR "$BytesAlloc bytes, $GCs GCs, $AvgResidency/$MaxResidency avg/max bytes residency ($ResidencySamples samples), $GCWork bytes GC work, ${TotMem}M in use, $InitTime INIT ($InitElapsed elapsed), $MutTime MUT ($MutElapsed elapsed), $GcTime GC ($GcElapsed elapsed)";
} else {
print STDERR "$BytesAlloc bytes, $GCs GCs, $AvgResidency/$MaxResidency avg/max bytes residency ($ResidencySamples samples), $GCWork bytes GC work, ${TotMem}M in use, $InitTime INIT ($InitElapsed elapsed), $MutTime MUT ($MutElapsed elapsed), $GcTime GC ($GcElapsed elapsed), $TotInstrs instructions, $TotReads memory reads, $TotWrites memory writes";
...
...
@@ -450,3 +461,22 @@ sub process_cacheprof_files {
}
close(STATS);
}
sub process_heimdall_file {
open(STATS, "< $HeimdallStats") || die("Can't open $HeimdallStats\n");
# instruction counts from Julian Seward's HEIMDALL:
#
# === HEIMDALL: instruction counts: 815000 instrs, 230040 reads, 138692 writes
while (<STATS>) {
/^=== HEIMDALL: instruction counts: ([0-9]+) instrs, ([0-9]+) reads, ([0-9]+) writes/
&& do {
$TotInstrs = $1;
$TotReads = $2;
$TotWrites = $3;
}
}
close(STATS);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment