changeset 98466:474444f05cb5

(procfs_system_process_attributes): Multiply `pcpu' by 100, so it's in percents as advertised.
author Eli Zaretskii <eliz@gnu.org>
date Thu, 02 Oct 2008 20:03:05 +0000
parents 33d466f1a725
children 1523ad03b1d2
files src/process.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/process.c	Thu Oct 02 17:32:40 2008 +0000
+++ b/src/process.c	Thu Oct 02 20:03:05 2008 +0000
@@ -7404,7 +7404,9 @@
 			 attrs);
 	  time_from_jiffies (utime + stime, clocks_per_sec, &sec, &usec);
 	  pcpu = (sec + usec / 1000000.0) / (EMACS_SECS (telapsed) + EMACS_USECS (telapsed) / 1000000.0);
-	  attrs = Fcons (Fcons (Qpcpu, make_float (pcpu)), attrs);
+	  if (pcpu > 1.0)
+	    pcpu = 1.0;
+	  attrs = Fcons (Fcons (Qpcpu, make_float (100 * pcpu)), attrs);
 	  pmem = 4.0 * 100 * rss / procfs_get_total_memory ();
 	  if (pmem > 100)
 	    pmem = 100;