]> granicus.if.org Git - procps-ng/commitdiff
ps: Add NEWS and checks for times and cputimes
authorCraig Small <csmall@enc.com.au>
Fri, 2 Mar 2018 11:07:46 +0000 (22:07 +1100)
committerCraig Small <csmall@enc.com.au>
Fri, 2 Mar 2018 11:07:46 +0000 (22:07 +1100)
The previous commit had one minor bug in it because the fields need
to be alphabetical and times comes after timeout.

Added NEWS item for this feature
Added another testsuite check for new flags in case they
disappear or go strange one day.

References:
 commit 8a94ed61119f8dcf7bcb98b84534e408d4eb7769

NEWS
ps/output.c
testsuite/ps.test/ps_output.exp

diff --git a/NEWS b/NEWS
index cbbcb3b191e9c8d6e18d4c81ab93e4570f4b9d73..0d9910ce976b20dfc3f82a6c2c42e573736bce73 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ procps-ng-NEXT
   * ps: avoid eip/esp address truncations                  Debian #846361
   * ps: recognizes SCHED_DEADLINE as valid CPU scheduler
   * ps: display NUMA node under which a thread ran         issue #58
+  * ps: Add seconds display for cputime and time           merge #43
   * sysctl: Permit empty string for value                  issue #74
   * sysctl: Don't segv when file not available             issue #76
   * sysctl: Read and write large buffers                   merge #56
index 1ae2f21c26f9d6abfb090544dddec9423503c86f..8c4c201c95f36593b034522e6915243d6566ddea 100644 (file)
@@ -1685,8 +1685,8 @@ static const format_struct format_array[] = {
 {"thcount",   "THCNT",   pr_nlwp,     sr_nlwp,    5,   0,    AIX, PO|RIGHT},
 {"tid",       "TID",     pr_tasks,    sr_tasks,   5,   0,    AIX, TO|PIDMAX|RIGHT},
 {"time",      "TIME",    pr_time,     sr_time,    8,   0,    U98, ET|RIGHT}, /*cputime*/ /* was 6 wide */
-{"times",     "TIME",    pr_times,    sr_time,    8,   0,    LNX, ET|RIGHT},
 {"timeout",   "TMOUT",   pr_nop,      sr_nop,     5,   0,    LNX, AN|RIGHT}, // 2.0.xx era
+{"times",     "TIME",    pr_times,    sr_time,    8,   0,    LNX, ET|RIGHT},
 {"tmout",     "TMOUT",   pr_nop,      sr_nop,     5,   0,    LNX, AN|RIGHT}, // 2.0.xx era
 {"tname",     "TTY",     pr_tty8,     sr_tty,     8,   0,    DEC, PO|LEFT},
 {"tpgid",     "TPGID",   pr_tpgid,    sr_tpgid,   5,   0,    XXX, PO|PIDMAX|RIGHT},
index cadce1318c384526df27d2f0f8eb5a1696dd947e..b290e28de6a7c09359724b26703724018457d30f 100644 (file)
@@ -27,6 +27,7 @@ set flag_match {
     "bsdstart,start,lstart" "\\s*START\\s+STARTED\\s+STARTED\\s+\(\\s*\(\[A-Z\]\[a-z\]{2} \\d+|\\d+:\\d{2}\)\\s+\(\[A-Z\]\[a-z\]{2} \\d+|\\d+:\\d{2}:\\d{2}\)\\s+\[A-Z\]\[a-z\]{2} \[A-Z\]\[a-z\]{2}\\s+\\d+ \\d{2}:\\d{2}:\\d{2} \\d{4}\\s*\)+$"
     "bsdtime,cputime,etime,etimes" "\\s*TIME\\s+TIME\\s+ELAPSED\\s+ELAPSED\\s*\(\\s*\\d+:\\d{2}\\s+\\d{2}:\\d{2}:\\d{2}\\s+\(\\d{2}:\)?\\d{2}:\\d{2}\\s+\\d+\\s*\)$"
     "user,ruser,group,rgroup,uid,ruid,gid,rgid" "\\s*USER\\s+RUSER\\s+GROUP\\s+RGROUP\\s+UID\\s+RUID\\s+GID\\s+RGID\\s+\(\(\\s*\[A-Za-z0-9_+-\]+\\s+\){4}\(\\d+\\s+\){4}\\s*\)+$"
+    "cputimes,times" "\\s*TIME\\s+TIME\\s+\\d+\\s+\\d+\\s*"
 }
 
 foreach { flag match } $flag_match  {