You are not logged in.

#1 2019-03-02 13:33:22

GrimBandito
Member
Registered: 2016-12-04
Posts: 48

Ksysguard - cpu usage unknown

Noticed an issue with Ksysguard running on KDE as a normal user, reporting a large number of root processes cpu usage as "Unknown".

Anybody experienced this before?

At a guess it looks like this app doesn't have priviledges to read cpu usage for most of root's processes.

All suggestions welcome.

Offline

#2 2019-03-02 16:19:22

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,689

Re: Ksysguard - cpu usage unknown

Does it also say 'Unknown' when you run top?

Offline

#3 2019-03-04 14:41:08

GrimBandito
Member
Registered: 2016-12-04
Posts: 48

Re: Ksysguard - cpu usage unknown

d_fajardo wrote:

Does it also say 'Unknown' when you run top?

No in 'top' the cpu usage is reported correctly.

Offline

#4 2019-03-04 14:59:59

loqs
Member
Registered: 2014-03-06
Posts: 19,103

Re: Ksysguard - cpu usage unknown

Offline

#5 2019-03-04 15:21:07

GrimBandito
Member
Registered: 2016-12-04
Posts: 48

Re: Ksysguard - cpu usage unknown

Thx for speedy response and the links. Glad to see it is a known issue.

Offline

#6 2019-03-04 15:56:56

loqs
Member
Registered: 2014-03-06
Posts: 19,103

Re: Ksysguard - cpu usage unknown

Does the following PKGBUILD plus patch resolve the issue?

# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgname=ksysguard
pkgver=5.15.2
pkgrel=1
pkgdesc='Track and control the processes running in your system'
arch=(x86_64)
url='https://userbase.kde.org/KSysGuard'
license=(LGPL)
depends=(knewstuff libksysguard hicolor-icon-theme kinit)
makedepends=(extra-cmake-modules kdoctools)
groups=(plasma)
source=("https://download.kde.org/stable/plasma/$pkgver/$pkgname-$pkgver.tar.xz"{,.sig}
        'processlist.patch')
sha256sums=('b6f107d7bbe050fd41228326b331b84a0af47f720e530073af71ca53139b68d8'
            'SKIP'
            '4fb7c24dd9dde2f44be35e131a44c5b85d187fe7149ae59c86a1e0aa35a45652')
validpgpkeys=('2D1D5B0588357787DE9EE225EC94D18F7F05997E'  # Jonathan Riddell <jr@jriddell.org>
              '0AAC775BB6437A8D9AF7A3ACFE0784117FBCE11D'  # Bhushan Shah <bshah@kde.org>
              'D07BD8662C56CB291B316EB2F5675605C74E02CF'  # David Edmundson <davidedmundson@kde.org>
              '1FA881591C26B276D7A5518EEAAF29B42A678C20') # Marco Martin <notmart@gmail.com>

prepare() {
  mkdir -p build
  cd $pkgname-$pkgver
  patch -p1 -i ../processlist.patch
}

build() {
  cd build
  cmake ../$pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DBUILD_TESTING=OFF
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install
}

processlist.patch

diff --git a/ksysguardd/Linux/ProcessList.c b/ksysguardd/Linux/ProcessList.c
index 89c1dc0e..1dbc34af 100644
--- a/ksysguardd/Linux/ProcessList.c
+++ b/ksysguardd/Linux/ProcessList.c
@@ -321,12 +321,20 @@ static bool getProcess( int pid, ProcessInfo *ps )
     strcpy( ps->status, "sleeping" );
   else if ( status == 'D' )
     strcpy( ps->status, "disk sleep" );
-  else if ( status == 'Z' )
-    strcpy( ps->status, "zombie" );
   else if ( status == 'T' )
     strcpy( ps->status, "stopped" );
+  else if ( status == 't' )
+    strcpy( ps->status, "tracing stop" );
+  else if ( status == 'X' )
+    strcpy( ps->status, "dead" );
+  else if ( status == 'Z' )
+    strcpy( ps->status, "zombie" );
+  else if ( status == 'P' )
+    strcpy( ps->status, "parked" );
   else if ( status == 'W' )
     strcpy( ps->status, "paging" );
+  else if ( status == 'I' )
+    strcpy( ps->status, "idle" );
   else
     sprintf( ps->status, "Unknown: %c", status );
 

Edit:
move idle to the end to match kernel ordering.

Last edited by loqs (2019-03-04 16:04:59)

Offline

Board footer

Powered by FluxBB