diff options
author | gad <gad@FreeBSD.org> | 2004-06-20 21:25:10 +0000 |
---|---|---|
committer | gad <gad@FreeBSD.org> | 2004-06-20 21:25:10 +0000 |
commit | 45865285541caea17e34a97f58f91c98d990ceb2 (patch) | |
tree | a145b6bece79fccf10f74f0b4a9d40fc22b3eabd /bin/ps/ps.h | |
parent | 0d2c5309add400692dc414bfd73e76d49fb9d111 (diff) | |
download | FreeBSD-src-45865285541caea17e34a97f58f91c98d990ceb2.zip FreeBSD-src-45865285541caea17e34a97f58f91c98d990ceb2.tar.gz |
Have the main() routine calculate %CPU and (if needed) memory information
when copying per-process info before starting to sort the list. This way,
sort-by-CPU or sort-by-memory will only calculate values once-per-process,
instead of twice-per-comparison. Also take advantage of this to simplify
the pscomp() routine.
Diffstat (limited to 'bin/ps/ps.h')
-rw-r--r-- | bin/ps/ps.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/ps/ps.h b/bin/ps/ps.h index 46d017c..817719d 100644 --- a/bin/ps/ps.h +++ b/bin/ps/ps.h @@ -38,6 +38,8 @@ typedef struct kinfo { char *ki_args; /* exec args */ char *ki_env; /* environment */ int ki_valid; /* 1 => uarea stuff valid */ + double ki_pcpu; /* calculated in main() */ + segsz_t ki_memsize; /* calculated in main() */ } KINFO; /* Variables. */ |