#
# |-----------------------------------------------------------|
# | Copyright (c) 1991, 1990 MIPS Computer Systems, Inc.      |
# | All Rights Reserved                                       |
# |-----------------------------------------------------------|
# |          Restricted Rights Legend                         |
# | Use, duplication, or disclosure by the Government is      |
# | subject to restrictions as set forth in                   |
# | subparagraph (c)(1)(ii) of the Rights in Technical        |
# | Data and Computer Software Clause of DFARS 252.227-7013.  |
# |         MIPS Computer Systems, Inc.                       |
# |         950 DeGuigne Avenue                               |
# |         Sunnyvale, California 94088-3650, USA             |
# |-----------------------------------------------------------|
#
# $Header: ptecms.awk,v 1.2.2.1 92/06/24 13:26:20 marker Exp $
/* $Header: ptecms.awk,v 1.2.2.1 92/06/24 13:26:20 marker Exp $ */

BEGIN {
	MAXCPU = 20.0		# report if cpu usage greater than this
	MAXKCORE = 1000.0	# report if KCORE usage is greater than this
	}
NF == 4		{
			print "\t\t\t\t" $1 " Time Exception Command Usage Summary"
		}

NF == 3		{
			print "\t\t\t\tCommand Exception Usage Summary"
		}

NR == 1		{
			MAXCPU = MAXCPU + 0.0
			MAXKCORE = MAXKCORE + 0.0
			print "\t\t\t\tTotal CPU > " MAXCPU " or Total KCORE > " MAXKCORE
		}

NF <= 4 && length != 0	{
				next
			}

$1 == "COMMAND" || $1 == "NAME"		{
						print
						next
					}

NF == 10 && ( $4 > MAXCPU || $3 > MAXKCORE ) && $1 != "TOTALS"

NF == 13 && ( $5 + $6 > MAXCPU || $4 > MAXKCORE ) && $1 != "TOTALS"

length == 0


