Hello community,

here is the log from the commit of package gnome-system-monitor for 
openSUSE:Factory checked in at 2017-11-30 16:30:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gnome-system-monitor (Old)
 and      /work/SRC/openSUSE:Factory/.gnome-system-monitor.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gnome-system-monitor"

Thu Nov 30 16:30:27 2017 rev:98 rq:544197 version:3.26.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/gnome-system-monitor/gnome-system-monitor.changes    
    2017-10-06 10:56:16.054504093 +0200
+++ 
/work/SRC/openSUSE:Factory/.gnome-system-monitor.new/gnome-system-monitor.changes
   2017-11-30 16:30:27.249262175 +0100
@@ -1,0 +2,6 @@
+Mon Nov 20 20:07:43 UTC 2017 - [email protected]
+
+- Add gsm-fix-inaccurate-cpu-values.patch: fix inaccurate %CPU
+  values in the Processes table (bgo#788922).
+
+-------------------------------------------------------------------

New:
----
  gsm-fix-inaccurate-cpu-values.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ gnome-system-monitor.spec ++++++
--- /var/tmp/diff_new_pack.Y5dxEJ/_old  2017-11-30 16:30:28.037233567 +0100
+++ /var/tmp/diff_new_pack.Y5dxEJ/_new  2017-11-30 16:30:28.041233421 +0100
@@ -26,6 +26,8 @@
 Source0:        
http://download.gnome.org/sources/gnome-system-monitor/3.26/%{name}-%{version}.tar.xz
 # PATCH-FEATURE-UPSTREAM gsm-bsc1020294-add-resources-scrollbar.patch 
bsc#1020294 bgo#778697 [email protected] -- add a scrollbar to the resources tab.
 Patch0:         gsm-bsc1020294-add-resources-scrollbar.patch
+# PATCH-FIX-UPSTREAM gsm-fix-inaccurate-cpu-values.patch bgo#788922 
[email protected] -- fix inaccurate %CPU values in the Process table.
+Patch1:         gsm-fix-inaccurate-cpu-values.patch
 BuildRequires:  fdupes
 BuildRequires:  gcc-c++
 BuildRequires:  intltool
@@ -61,6 +63,7 @@
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 %if !0%{?is_opensuse}
 translation-update-upstream
 %endif

++++++ gsm-fix-inaccurate-cpu-values.patch ++++++
>From 9224515cd6b19ba2dc59afe14684749b4dbf0349 Mon Sep 17 00:00:00 2001
From: Daniel van Vugt <[email protected]>
Date: Fri, 27 Oct 2017 19:11:33 +0800
Subject: [PATCH] Fix inaccurate %CPU values in the Processes table
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Multi-core machines were displaying inaccurate %CPU values due to a
loss of precision from performing integer division before multiplication.
This changes the order of operations so that no precision is lost, and
now all machines will display process %CPU values to within 1% accuracy.

https://bugzilla.gnome.org/show_bug.cgi?id=788922
Signed-off-by: BenoĆ®t Dejean <[email protected]>
---
 src/proctable.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/proctable.cpp b/src/proctable.cpp
index e41d6d08..c37a48b2 100644
--- a/src/proctable.cpp
+++ b/src/proctable.cpp
@@ -917,11 +917,13 @@ update_info (GsmApplication *app, ProcInfo *info)
     guint64 difference = proctime.rtime - info->cpu_time;
     if (difference > 0) 
         info->status = GLIBTOP_PROCESS_RUNNING;
-    info->pcpu = difference * 100 / app->cpu_total_time;
-    info->pcpu = MIN(info->pcpu, 100);
 
+    guint cpu_scale = 100;
     if (not app->config.solaris_mode)
-        info->pcpu *= app->config.num_cpus;
+        cpu_scale *= app->config.num_cpus;
+
+    info->pcpu = difference * cpu_scale / app->cpu_total_time;
+    info->pcpu = MIN(info->pcpu, cpu_scale);
 
     app->processes.cpu_times[info->pid] = info->cpu_time = proctime.rtime;
     info->nice = procuid.nice;
-- 
2.15.0


Reply via email to