]> granicus.if.org Git - procps-ng/commitdiff
library: lessen chance of distortion on TICS_ALL_DELTA
authorJim Warner <james.warner@comcast.net>
Wed, 21 Apr 2021 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Sat, 24 Apr 2021 01:11:03 +0000 (11:11 +1000)
That old library defined this field as 'unsigned int'.
However, here it was known as a 'signed int'. Thus for
consistency we'll now also treat it as 'unsigned int'.

[ this commit was made in pursuit of a bug involving ]
[ the distortion of elapsed task tics. but, it turns ]
[ out these changes had nothing to do with that bug. ]
[ however, the patch is being retained as desirable. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
proc/pids.c
proc/pids.h

index 833c7f27f58c5a1b9ac6f855a0c3093d209d80dd..bc4761bf44e39a33b2fdfde66de6fbfb1e3b9a75 100644 (file)
@@ -238,7 +238,7 @@ STR_set(SUPGIDS,                   supgid)
 STR_set(SUPGROUPS,                 supgrp)
 setDECL(TICS_ALL)       { (void)I; R->result.ull_int = P->utime + P->stime; }
 setDECL(TICS_ALL_C)     { (void)I; R->result.ull_int = P->utime + P->stime + P->cutime + P->cstime; }
-REG_set(TICS_ALL_DELTA,   s_int,   pcpu)
+REG_set(TICS_ALL_DELTA,   u_int,   pcpu)
 REG_set(TICS_BLKIO,       ull_int, blkio_tics)
 REG_set(TICS_GUEST,       ull_int, gtime)
 setDECL(TICS_GUEST_C)   { (void)I; R->result.ull_int = P->gtime + P->cgtime; }
@@ -487,7 +487,7 @@ static struct {
     { RS(SUPGROUPS),         x_supgrp,   FF(str),   QS(str),       0,        TS(str)     },
     { RS(TICS_ALL),          f_stat,     NULL,      QS(ull_int),   0,        TS(ull_int) },
     { RS(TICS_ALL_C),        f_stat,     NULL,      QS(ull_int),   0,        TS(ull_int) },
-    { RS(TICS_ALL_DELTA),    f_stat,     NULL,      QS(s_int),     +1,       TS(s_int)   },
+    { RS(TICS_ALL_DELTA),    f_stat,     NULL,      QS(u_int),     +1,       TS(u_int)   },
     { RS(TICS_BLKIO),        f_stat,     NULL,      QS(ull_int),   0,        TS(ull_int) },
     { RS(TICS_GUEST),        f_stat,     NULL,      QS(ull_int),   0,        TS(ull_int) },
     { RS(TICS_GUEST_C),      f_stat,     NULL,      QS(ull_int),   0,        TS(ull_int) },
index ead09bae2a658af7ed133c5945daabdef22496e5..60037d7b1870076da09540a8d0d9e17d49489bef 100644 (file)
@@ -123,7 +123,7 @@ enum pids_item {
     PIDS_SUPGROUPS,         //      str        derived from SUPGIDS, see getgrgid(3)
     PIDS_TICS_ALL,          //  ull_int        stat: stime + utime
     PIDS_TICS_ALL_C,        //  ull_int        stat: stime + utime + cstime + cutime
-    PIDS_TICS_ALL_DELTA,    //    s_int        derived from TICS_ALL
+    PIDS_TICS_ALL_DELTA,    //    u_int        derived from TICS_ALL
     PIDS_TICS_BLKIO,        //  ull_int        stat: blkio_ticks
     PIDS_TICS_GUEST,        //  ull_int        stat: gtime
     PIDS_TICS_GUEST_C,      //  ull_int        stat: gtime + cgtime