From b63a740b3b1fd97b335dba4e32d7ba6f8bb7daef Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 2 Oct 2008 20:04:58 +0000 Subject: [PATCH] (procfs_system_process_attributes): Multiply `pcpu' by 100, so it's in percents as advertised. --- src/ChangeLog | 5 +++++ src/process.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9a7e6776394..3c51f770eba 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-10-02 Eli Zaretskii + + * process.c (procfs_system_process_attributes): Multiply `pcpu' by + 100, so it's in percents as advertised. + 2008-10-02 Adrian Robert * nsterm.h (ns_cursor_types, ns_output.desired_cursor_color) diff --git a/src/process.c b/src/process.c index 647025e055f..b8e390ed39f 100644 --- a/src/process.c +++ b/src/process.c @@ -7404,7 +7404,9 @@ procfs_system_process_attributes (pid) 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; -- 2.39.5