Commit f4e2c202 authored by Arjen Hiemstra's avatar Arjen Hiemstra

Exclude all loop devices from partition and disk sensors

Summary:
Since there is little reason to monitor loop devices, exclude them
altogether from the partition and disk sensors.

This fixes cases where there are a significant amount of snaps,
which are all mounted as loop devices and thus cause partition and
disk sensors to appear, which potentially causes major slowdowns.

Test Plan: Snaps are excluded from the list of sensors in KSysGuard.

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: IlyaBizyaev, anthonyfieroni, jriddell, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D29688
parent 857eff12
......@@ -213,6 +213,7 @@ int updateDiskStat( void )
* coreutils as well.
*/
if ( (mnt_info->mnt_fsname[0] != '/') ||
!strncmp( mnt_info->mnt_fsname, "/dev/loop", 9 ) ||
!strcmp( mnt_info->mnt_type, "smbfs" ) ||
!strcmp( mnt_info->mnt_type, "cifs" ) ||
!strcmp( mnt_info->mnt_type, "proc" ) ||
......
......@@ -215,6 +215,10 @@ static int process26DiskIO( const char* buf ) {
return -1;
}
devname[DISKDEVNAMELEN-1] = 0;
if (!strncmp(devname, "/dev/loop", 9)) {
return -1;
}
last = 0;
ptr = DiskIO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment