jdk/test/sun/tools/jstat/gcCauseOutput1.awk
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 16502 4ee53f7dc660
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
# matching the following output specified as a pattern that verifies
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# that the numerical values conform to a specific pattern, rather than
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
# specific values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
#  S0     S1     E      O      P     YGC     YGCT    FGC    FGCT     GCT    LGCC                 GCC                 
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
#  0.00 100.00  14.01   3.06  23.20      1    0.032     0    0.000    0.032 Allocation Failure   No GC           
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
BEGIN	{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
	    headerlines=0; datalines=0; totallines=0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
	}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
/^  S0     S1     E      O      P     YGC     YGCT    FGC    FGCT     GCT    LGCC                 GCC                 $/	{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
	    headerlines++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
	}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# The following pattern does not verify the validity of the gc cause
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# string as the values can vary depending on conditions out of our
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
# control. To accomodate this variability, the pattern matcher simply
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
# detects that there are two strings that match a specific pattern
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
# where the first character is a letter followed by a sequence of zero
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
# or more letters and spaces. It also provides for the ".", "(", and ")"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
# characters to allow for the string "System.gc()".
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[a-zA-Z]+[a-zA-Z \.\(\)]*[ ]*[a-zA-Z]+[a-zA-Z \.\(\)]*$/	{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
	    datalines++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
	}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
	{ totallines++; print $0 }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
END	{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
	    if ((headerlines == 1) && (datalines == 1) && (totallines == 2)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
	        exit 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
	    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
	    else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
	        exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
	    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
	}