Trivial doc changes to analyze_brprob

Jeffrey A Law law@redhat.com
Fri Jul 16 22:07:00 GMT 2004


I'm using analyze_brprob to investigate the first order effects of
changing the jump threading algorithm.  analyze_brprob is a reasonably
convenient way to present data from arc profiling runs, particularly
since it maps execution counts to conditional branches.

Anyway, the comments in analyze_brprob have become slightly out of
date.  Fixing the comments may make it easier for someone else
later to use analyze_brprob :-)

This patch also slightly changes the output to make it easier to
process with awk.  Previously if the predicted and measured hitrates
were both 100% we'd get output like

100.00%/100.00%

Which parses as a single field in awk, which makes further
post-processing of the output of analyze_brprob more difficult
than it ought to be.  So now the hitrates are always output as:

estimated% / measured%

Which provides the consistency which makes it a lot easier to do
additional processing on the data.

Installed.

 
-------------- next part --------------
	* analyze_brprob: Fix comments.  More consistent output format.

Index: analyze_brprob
===================================================================
RCS file: /cvs/gcc/gcc/contrib/analyze_brprob,v
retrieving revision 1.9
diff -c -p -r1.9 analyze_brprob
*** analyze_brprob	23 May 2003 16:20:44 -0000	1.9
--- analyze_brprob	16 Jul 2004 18:55:52 -0000
***************
*** 33,39 ****
  #  Step 1: Compile and profile your program.  You need to use -fprofile-arcs
  #    flag to get the profiles
  #  Step 2: Generate log files.  The information about given heuristics are
! #    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.
  #  Step 3: Run this script to concatenate all *.life files:
--- 33,39 ----
  #  Step 1: Compile and profile your program.  You need to use -fprofile-arcs
  #    flag to get the profiles
  #  Step 2: Generate log files.  The information about given heuristics are
! #    saved into *.bp dumps.  You need to pass the -db 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.
  #  Step 3: Run this script to concatenate all *.life files:
*************** END {
*** 131,142 ****
    maxcounts = longeval(counts["combined"])
    maxbranches = branches["combined"]
    max = names["combined"]
!   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)"),
--- 131,142 ----
    maxcounts = longeval(counts["combined"])
    maxbranches = branches["combined"]
    max = names["combined"]
!   printf("HEURISTICS                 BRANCHES  (REL)  HITRATE              COVERAGE  (REL)\n")
    for (i = 0; i < nnames ; i++)
     {
       name = names[i]
       counts[name] = longeval(counts[name])
!      printf ("%-26s %8i %5.1f%% %6s%% / %6s%% %12s %5.1f%%\n",
  	     name,
  	     branches[name], branches[name] * 100 / maxbranches,
  	     longeval("("hits[name]") * 100 /(" counts[name]"-0.00001)"),


More information about the Gcc-patches mailing list