1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-04 08:47:11 +00:00

(procfs_system_process_attributes): Multiply `pcpu' by 100, so it's in

percents as advertised.
This commit is contained in:
Eli Zaretskii 2008-10-02 20:04:58 +00:00
parent 60aff9248a
commit b63a740b3b
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-10-02 Eli Zaretskii <eliz@gnu.org>
* process.c (procfs_system_process_attributes): Multiply `pcpu' by
100, so it's in percents as advertised.
2008-10-02 Adrian Robert <Adrian.B.Robert@gmail.com>
* nsterm.h (ns_cursor_types, ns_output.desired_cursor_color)

View File

@ -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;