From 9b601307ff7f7ce3b8440c3641d55a8c5accc275 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Wed, 21 Apr 2021 00:00:00 -0500 Subject: [PATCH] library: lessen chance of distortion on TICS_ALL_DELTA 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 --- proc/pids.c | 4 ++-- proc/pids.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/proc/pids.c b/proc/pids.c index 833c7f27..bc4761bf 100644 --- a/proc/pids.c +++ b/proc/pids.c @@ -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) }, diff --git a/proc/pids.h b/proc/pids.h index ead09bae..60037d7b 100644 --- a/proc/pids.h +++ b/proc/pids.h @@ -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 -- 2.49.0