With some old 2.6 kernels, fields "gtime" and "cgtime" (which are
expected to be read from /proc/#/stat file) may not be present.
pidstat used to stop should this case happens.
Fix this since these fields are not mandatory for pidstat to display its
statistics.
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
&pst->priority, &pst->policy,
&pst->blkio_swapin_delays, &pst->gtime, &pst->cgtime);
- if (rc < 17)
+ if (rc < 15)
return 1;
+ if (rc < 17) {
+ /* gtime and cgtime fields are unavailable in file */
+ pst->gtime = pst->cgtime = 0;
+ }
+
/* Convert to kB */
pst->vsz >>= 10;
pst->rss = PG_TO_KB(pst->rss);