I've been looking at using process accounting for keeping track of various users and sites running scripts that are problematic in our environment instead of trying to do something like scraping top at regular intervals.
The one that isn't particularly clear is which fields really denotes the cpu seconds/minutes used. The manual pages I have read say the 'cpu' column is for seconds burned, however there is alo the 'cp' column displayed with -m - and they can show different totals. For example:
When I use the -m flag, I get
$sa -m | grep username
username 14944 65.53re 29.90cp 5308k
When I use the -u flag and total up the column for 'cpu', I get the following:
sa -u |grep username|awk 'BEGIN{TOTAL=0}{TOTAL=TOTAL+$2}END{print TOTAL}'
1032.86
Can anybody help me understand the difference between the 'cp' and 'cpu' columns in these two different modes?
Thanks!