#2644 sblim-cmpi-base: wrong UserModeTime and KernelModeTime

Function
closed-fixed
Dave Heller
None
providers
5
2014-10-22
2013-06-10
No

The values for UserModeTime and KernelModeTime in 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.

Discussion

  • Dave Heller
    Dave Heller
    2013-06-11

    Surprising that this went unnoticed for so long. Thanks, Henning.

    Committed to git master for cmpi-base 1.6.3 as [e37b74]

     

    Related

    Commit: [e37b74]


    Last edit: Dave Heller 2014-09-09
  • Dave Heller
    Dave Heller
    2013-06-11

    • status: open --> pending
    • assigned_to: Dave Heller
     
  • Dave Heller
    Dave Heller
    2014-10-22

    • status: pending --> closed-fixed