Bug 974073

Summary: SAP 7.0: sblim-cmpi-base: wrong UserModeTime and KernelModeTime
Product: Red Hat Enterprise Linux 7 Reporter: Henning Sackewitz <henning.sackewitz>
Component: sblim-cmpi-baseAssignee: Vitezslav Crhonek <vcrhonek>
Status: CLOSED CURRENTRELEASE QA Contact: Robin Hack <rhack>
Severity: high Docs Contact:
Priority: high    
Version: 7.1CC: amahdal, amascari, fdanapfe, henning.sackewitz, jscotka, linux, lmiccini
Target Milestone: rcKeywords: FutureFeature
Target Release: 7.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: sblim-cmpi-base-1.6.2-7.el7 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 974071 Environment:
Last Closed: 2014-06-13 12:41:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 974071    
Bug Blocks: 1018952, 1050219    

Description Henning Sackewitz 2013-06-13 11:44:30 UTC
+++ This bug was initially created as a clone of Bug #974071 +++

The values for UserModeTime and KernelModeTime in CIM class Linux_UnixProcess are incorrectly calculated.

OSBase_UnixProcess.c:

231 if ( (fpstat=fopen(cmd,"r")) != NULL ) {
232 fscanf(fpstat,"%s %s %s %s %s %s %s %s %s %s %s %s %s %s "
233 "%lld %lld %s %s %s %s %s %ld",
234 &umtime,&kmtime,&ctime );
235 fclose(fpstat);
236 (sptr)->kmtime = kmtime10;
237 (sptr)->umtime = umtime*10;

The code is scanning fields 15 and 16 from /proc/[pid]/stat but it should use fields 14 and 15 on current Linux kernels as documented in
/usr/src/linux/Documentation/filesystems/proc.txt.

As a result, KernelModeTime is used for UserModeTime, and Child User Time for KernelModeTime.

See https://sourceforge.net/p/sblim/bugs/2644/ for upstream bug fix.

Comment 2 Frank Danapfel 2014-01-08 07:37:28 UTC
Removed RFE from title since this is really a bugfix and not a feature request

Comment 4 Ludek Smid 2014-06-13 12:41:36 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Comment 5 Alois Mahdal 2016-09-09 05:26:23 UTC
"Fixed In Version" field was clearly wrong (fedora build for a RHEL7 bug).  I'm assuming the version @rhack reviewed it with (I think "best guess" is better than invalid value for this field).