It's nice to have the option of seeing the tools work-in-progress,
particularly as it is quite long-running. This adds some trace messages
for the calibrator method. Sample output looks like

$ tlbmiss_cost.sh  --verbose
TRACE: Beginning TLB measurement using calibrator
TRACE: Measured CPU Speed: 2167 MHz
TRACE: Starting Working Set Size (WSS): 13631488 bytes
TRACE: Required tolerance for match: 3 cycles
TRACE: Measured TLB Latency 19 cycles within tolerance. Matched 1/3
TRACE: Measured TLB Latency 19 cycles within tolerance. Matched 2/3
TRACE: Measured TLB Latency 19 cycles within tolerance. Matched 3/3
TLB_MISS_COST=19

Signed-off-by: Mel Gorman <m...@csn.ul.ie>
---
 tlbmiss_cost.sh |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/tlbmiss_cost.sh b/tlbmiss_cost.sh
index 0a71ccd..3e4b260 100755
--- a/tlbmiss_cost.sh
+++ b/tlbmiss_cost.sh
@@ -85,6 +85,11 @@ calibrator_calc()
        MATCHED=0
        LAST_LATENCY_CYCLES=-1
 
+       print_trace Beginning TLB measurement using calibrator
+       print_trace Measured CPU Speed: $MHZ MHz
+       print_trace Starting Working Set Size \(WSS\): $SIZE bytes
+       print_trace Required tolerance for match: $MATCH_REQUIREMENT cycles
+
        # Keep increasing size until TLB latency is being measured consistently
        while [ $MATCHED -lt $MATCH_REQUIREMENT ]; do
                $CALIBRATOR $MHZ $SIZE $PREFIX > $TMPFILE 2>&1
@@ -97,7 +102,6 @@ calibrator_calc()
                LATENCY_CYCLES=`echo $LATENCY_CYCLES | awk '{print $1}'`
 
                if [ "$LATENCY_CYCLES" = "" ]; then
-                       echo -n "No TLB Latency measured "
                        FAILED_MEASURE=$(($FAILED_MEASURE+1))
                        if [ $MEASURED -eq 0 ]; then
                                SIZE=$(($SIZE*3/2))
@@ -106,11 +110,11 @@ calibrator_calc()
                                if [ $FAILED_MEASURE -eq 3 ]; then
                                        SIZE=$(($SIZE+$STRIDE))
                                        FAILED_MEASURE=0
+                                       print_trace No TLB Latency measured: 
New WSS $SIZE
                                else
-                                       echo -n Retrying
+                                       print_trace No TLB Latency measured: 
Retrying
                                fi
                        fi
-                       echo
                        continue
                fi
                LOW_TOLERANCE=$(($LATENCY_CYCLES-$TOLERANCE))
@@ -118,7 +122,11 @@ calibrator_calc()
                if [ $LAST_LATENCY_CYCLES -ge $LOW_TOLERANCE -a \
                                $LAST_LATENCY_CYCLES -le $HIGH_TOLERANCE ]; then
                        MATCHED=$(($MATCHED+1))
+                       print_trace Measured TLB Latency $LATENCY_CYCLES cycles 
within tolerance. Matched $MATCHED/$MATCH_REQUIREMENT
                else
+                       if [ $LAST_LATENCY_CYCLES -ne -1 ]; then
+                               print_trace Measured TLB Latency 
$LATENCY_CYCLES cycles outside tolerance
+                       fi
                        MATCHED=0
                fi
 
-- 
1.6.3.3


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to