This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix analyze_brprob awk compatibility problems
- To: gcc-patches at gcc dot gnu dot org
- Subject: Fix analyze_brprob awk compatibility problems
- From: Jan Hubicka <jh at suse dot cz>
- Date: Mon, 23 Jul 2001 15:53:32 +0200
Hi,
I've commited following:
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/egcs/contrib/ChangeLog,v
retrieving revision 1.116
diff -c -3 -p -r1.116 ChangeLog
*** ChangeLog 2001/07/23 13:21:13 1.116
--- ChangeLog 2001/07/23 13:49:12
***************
*** 1,3 ****
--- 1,7 ----
+ Mon Jul 23 15:47:19 CEST 2001 Jan Hubicka <jh@suse.cz>
+
+ * analyze_brprob: Fix awk compatibility problems; update comment.
+
2001-07-23 Andreas Jaeger <aj@suse.de>
* analyze_brprob: Fix more typos.
Index: analyze_brprob
===================================================================
RCS file: /cvs/gcc/egcs/contrib/analyze_brprob,v
retrieving revision 1.3
diff -c -3 -p -r1.3 analyze_brprob
*** analyze_brprob 2001/07/23 13:21:13 1.3
--- analyze_brprob 2001/07/23 13:49:12
***************
*** 36,42 ****
# saved into *.life dumps. You need to pass the -df switch to the compiler as well
# as -fbranch-probabilities to get the results of profiling noted in the dumps.
# Ensure that there are no "Arc profiling: some edge counts were bad." warnings.
- # Keep the -fprofile-arcs switch to ensure that CFGs match.
# Step 3: Run this script to concatenate all *.life files:
# analyze_brprob `find . -name *.life`
# the information is collected and print once all files are parsed. This
--- 36,41 ----
*************** BEGIN {nnames = 0}
*** 124,149 ****
#BC crashes on long strings. Irritating.
if (length(counts[name]) > 4000)
{
! counts[name] = longeval (counts[name])
! hits[name] = longeval (hits[name])
! phits[name] = longeval (phits[name])
}
}
END {
# Heuristics called combined predicts just everything.
! maxcounts = longeval (counts["first match"])
maxbranches = branches["first match"]
max = names["first match"]
printf("HEURISTICS BRANCHES (REL) HITRATE COVERAGE (REL)\n")
for (i = 0; i < nnames ; i++)
{
name = names[i]
! counts[name] = longeval (counts[name])
printf ("%-27s %8i %5.1f%% %6s%%/%6s%% %12s %5.1f%%\n",
name,
branches[name], branches[name] * 100 / maxbranches,
! longeval ("("hits[name]") * 100 /(" counts[name]"-0.00001)"),
! longeval ("("phits[name]") * 100 /(" counts[name]"-0.00001)"),
! counts[name], longeval (counts[name]" * 100 / ("maxcounts"-0.00001)"))
}
}
--- 123,148 ----
#BC crashes on long strings. Irritating.
if (length(counts[name]) > 4000)
{
! counts[name] = longeval(counts[name])
! hits[name] = longeval(hits[name])
! phits[name] = longeval(phits[name])
}
}
END {
# Heuristics called combined predicts just everything.
! maxcounts = longeval(counts["first match"])
maxbranches = branches["first match"]
max = names["first match"]
printf("HEURISTICS BRANCHES (REL) HITRATE COVERAGE (REL)\n")
for (i = 0; i < nnames ; i++)
{
name = names[i]
! counts[name] = longeval(counts[name])
printf ("%-27s %8i %5.1f%% %6s%%/%6s%% %12s %5.1f%%\n",
name,
branches[name], branches[name] * 100 / maxbranches,
! longeval("("hits[name]") * 100 /(" counts[name]"-0.00001)"),
! longeval("("phits[name]") * 100 /(" counts[name]"-0.00001)"),
! counts[name], longeval(counts[name]" * 100 / ("maxcounts"-0.00001)"))
}
}