1. 17 Jun, 2017 1 commit
  2. 15 Jun, 2017 1 commit
  3. 14 Jun, 2017 1 commit
  4. 04 Jun, 2017 1 commit
    • jim warner's avatar
      top: correct functioning of the '-p' command line args · 4b44aebd
      jim warner authored
      With the introduction of a new '1' command line toggle
      I have gone and broken a provision of the '-p' command
      line switch (pids monitoring). Multiple pids could not
      be specified through the use of comma delimited lists.
      
      Thus, this commit simply corrects that newly added bug
      which was born in the 'adjustment' commit shown below.
      
      Reference(s):
      . adjustment to '-1' implementation
      commit 909b37d7Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      4b44aebd
  5. 22 May, 2017 8 commits
    • Dr. Werner Fink's avatar
      sysctl: Print lines longer than 1024 chars · 3fd84670
      Dr. Werner Fink authored
      as well do not open /proc/sys files if only the names of the
      system control names of the kernel parameters should be shown.
      Avoid leaking tmpname in case of a pattern mismatch.
      Signed-off-by: Dr. Werner Fink's avatarWerner Fink <werner@suse.de>
      3fd84670
    • jim warner's avatar
      top: address the argument parsing quirk involving '-h' · c409f5a4
      jim warner authored
      There exists the possibility that a 'putp' call can be
      issued before the 'setupterm' invocation has occurred,
      as is reflected in a bugzilla report referenced below.
      
      Strangely, such a SEGV isn't always triggered as logic
      would suggest it ought to be. I experienced a fault in
      these environments with the associated curses version:
      . archlinux, procps-ng 3.3.12, ncurses 6.0.20170429
      . fedora-25, procps-ng 3.3.10, ncurses 6.0.20160709
      . opensuse-42.2, procps-ng 3.3.9, ncurses 5.9.20140201
      . gentoo, procps-ng 3.3.12, ncurses 6.0.20150808
      . slackw-14.2, procps-ng 3.3.12, ncurses 6.0.20160910
      
      Whereas under these environments there was no problem:
      . ubuntu-17.04, procps-ng 3.3.12, ncurses 6.0.20160625
      . debian-test, procps-ng 3.3.12, ncurses 6.0.20161126
      . mageia-5.1, procps-ng 3.3.9, ncurses 5.9.20140323
      
      [ as an aside, the expected result in the bug report ]
      [ is incorrect and should mention the '1' parameter. ]
      
      [ however, until release 3.3.13 when the '1' becomes ]
      [ a valid switch, numbers are not detected when used ]
      [ with any switch which doesn't require an argument. ]
      
      [ you're welcome to treat that as a separate bugglet ]
      
      Reference(s):
      https://bugzilla.redhat.com/show_bug.cgi?id=1450429Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      c409f5a4
    • jim warner's avatar
    • jim warner's avatar
      ps: have now added the NUMA node field display support · 00820351
      jim warner authored
      [ this patch has been adapted from the newlib branch ]
      
      Reference(s):
      procps-ng/procps#58Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      00820351
    • jim warner's avatar
      top: now includes that NUMA node field display support · 1422c219
      jim warner authored
      [ this patch has been adapted from the newlib branch ]
      
      Reference(s):
      #58Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      1422c219
    • jim warner's avatar
      library: set stage for NUMA node field display support · 1a2ec039
      jim warner authored
      In response to that suggestion referenced below, these
      changes allow display of task/thread level NUMA nodes.
      
      Currently, only the 'top' program offers any NUMA type
      support and it is limited to the Summary Area display.
      With this commit both the 'top' and 'ps' programs will
      be able to display NUMA nodes associated with threads.
      
      [ this patch has been adapted from the newlib branch ]
      [ and implemented so as to preserve the existing ABI ]
      
      Reference(s):
      procps-ng/procps#58Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      1a2ec039
    • jim warner's avatar
      misc: eliminate all those remaining gcc -Wall warnings · 629fa81b
      jim warner authored
      Reference(s):
      proc/readproc.c: In function 'statm2proc'
      proc/readproc.c:627:9: warning: variable 'num' set but not used [-Wunused-but-set-variable]
      
      ps/output.c: In function 'pr_context':
      ps/output.c:1273:14: warning: unused variable 'tried_load' [-Wunused-variable]
      ps/output.c:1272:16: warning: unused variable 'ps_is_selinux_enabled' [-Wunused-variable]
      ps/output.c:1272:16: warning: 'ps_is_selinux_enabled' defined but not used [-Wunused-variable]
      ps/output.c:1273:14: warning: 'tried_load' defined but not used [-Wunused-variable]
      ps/output.c:1837:18: warning: 'shortsort_array_count' defined but not used [-Wunused-const-variable=]
      ps/output.c:1803:18: warning: 'aix_array_count' defined but not used [-Wunused-const-variable=]
      
      ps/parser.c: In function 'arg_type':
      ps/parser.c:1098:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
      ps/parser.c:1099:34: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
      
      ps/sortformat.c: In function 'format_parse':
      ps/sortformat.c:241:1: warning: label 'out' defined but not used [-Wunused-label]
      
      ps/stacktrace.c:176:13: warning: 'stack_trace_sigsegv' defined but not used [-Wunused-function]
      
      watch.c: In function 'process_ansi':
      watch.c:234:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
      watch.c:237:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
      Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      629fa81b
    • jim warner's avatar
  6. 29 Mar, 2017 2 commits
    • jim warner's avatar
      top: provide more accurate cpu usage stats for startup · 56d79b9d
      jim warner authored
      The top program already incorporated a modest delay at
      startup so that some minimal process cpu history could
      be established. However, Summary Area system level cpu
      statistic history reflected usage since boot. As such,
      unchanging % values would be shown with every restart.
      
      This commit just adopts the same approach used in task
      %CPU history for the Summary Area statistics. In other
      words, it introduces a 'priming read' at startup as is
      found in the newlib implementation for the <stat> API.
      
      Reference(s):
      procps-ng/procps!42Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      56d79b9d
    • jim warner's avatar
      top: make command line switch parsing even more robust · 909b37d7
      jim warner authored
      This program has always tried to maintain an extermely
      robust command line parsing procedure, far more robust
      that what's available with the getopt stuff. But, with
      the introduction of our first numeric switch it should
      have been made even more robust than, in fact, it was.
      
      This commit will now accomplish such a desirable goal.
      
      Reference(s):
      . added '1' command line switch
      commit 89db82d1Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      909b37d7
  7. 16 Mar, 2017 6 commits
    • jim warner's avatar
    • jim warner's avatar
      top: by default, show cmd line vs. cmd name at startup · fc5f5a93
      jim warner authored
      All of top's display was designed to fit into an 80x24
      terminal. This includes the help screens plus both the
      Summary and Task Areas, assuming no saved config file.
      
      With release 3.3.10, the startup defaults were changed
      assuming ./configure --disable-modern-top wasn't used.
      This was done in the hope of introducing some users to
      unknown capabilities such as colors, forest view, etc.
      
      The purpose of this commit is to coax a few more users
      into possibly exploring another capability: scrolling.
      We do so by tweaking the default startup display so as
      to show full command lines. Now, when things no longer
      fit in 80x24, horizontal scrolling might be exploited.
      
      [ of course, this can be reversed with the -c switch ]
      Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      fc5f5a93
    • jim warner's avatar
      top: provide -1 command line switch as 'Cpu(s)' toggle · 89db82d1
      jim warner authored
      If built without ./configure --disable-modern-top, the
      program displays each cpu individually providing there
      is sufficient vertical screen real estate. For massive
      SMP environments this will necessitate use of a config
      file where the cpu summary toggle ('1') could be saved
      via the 'W' command. But, an rcfile may not be viable.
      
      So this commit introduces a '1' command line switch to
      emulate exactly the effects of the interactive toggle.
      
      And since it is our first numeric switch some existing
      parsing logic had to be changed slightly. Such changes
      are, in truth, an improvement. For example, instead of
      seeing "inappropriate '2'" with ./top -2 we'll now see
      the vastly more appropriate error "unknown option '2'.
      
      References(s):
      procps-ng/procps#55Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      89db82d1
    • jim warner's avatar
      top: provide -E command line switch for memory scaling · fb48b5d9
      jim warner authored
      In their 3.2.7 version of top, Redhat introduced an -M
      switch to automatically scale Summary Area memory data
      to avoid truncation (and the resulting '+' indicator).
      
      The procps-ng top does not employ suffixes with memory
      data nor does it allow for different scaling with each
      separate value. Rather, scaling appears at line start.
      
      If built without ./configure --disable-modern-top, the
      Summary Area memory will be scaled at GiB which should
      lessen chance of truncation. Otherwise KiB was used to
      reflect such memory, increasing the truncation chance.
      
      And while 'W' can be used to preserve some appropriate
      scaling value, there are arguments against such rcfile
      approaches as cited in the issue and bug report below.
      
      So this commit will bump the Summary Area memory scale
      factor from KiB to MiB when using --disable-modern-top
      as a concession to that Redhat bug report noted below.
      
      And it also introduces a new command line switch which
      can force any desired scaling regardless of the rcfile
      or which ./configure option might have been specified.
      
      [ for top's help text we'll show 'E' as if it were a ]
      [ switch without arguments in order to keep the help ]
      [ text displayable without wrap in an 80x24 terminal ]
      
      [ the man page, however, will show all k-e arguments ]
      
      Reference(s):
      procps-ng/procps#53
      https://bugzilla.redhat.com/show_bug.cgi?id=1034466Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      fb48b5d9
    • jim warner's avatar
      top: show fewer decimal places for memory (by default) · fe6e03d8
      jim warner authored
      After much reflection I've come to the conclusion that
      displaying 3 decimal places (usually) when memory data
      had been scaled is no longer optimal with today's ever
      increasing amounts. And given that not all task memory
      fields are the same widths, inconsistencies can easily
      arise as illustrated and discussed in the issue below.
      
      Instead of unilaterally reducing the number of decimal
      places, this commit will sneak in such a change via an
      existing configure option that was very likely unused.
      
      The former 'disable-wide-memory' option has now become
      'enable-wide-memory', which can be used if the current
      behavior (3 decimal places) is preferred. Without that
      option, whenever memory is scaled beyond KiB, just one
      decimal place will be shown in Summary and Task areas.
      
      And Task area field width will no longer be changed by
      this revised configure option. Instead, all such field
      widths will now be fixed at the former maximum values.
      
      Reference(s):
      procps-ng/procps#50Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      fe6e03d8
    • jim warner's avatar
  8. 07 Feb, 2017 2 commits
  9. 04 Feb, 2017 3 commits
    • Craig Small's avatar
      pkill: Return 0 if successfully killed process · 625d0809
      Craig Small authored
      Original report:
      When trying kill a process with insufficient privileges (see blow),
      pkill displays the error message “... failed: Operation not permitted”,
      but returns 0. Surely it should return 3?
      
      $ pkill syslogd ; echo $?
      pkill: killing pid 373 failed: Operation not permitted
      0
      
      Return value 0 means one of more things matched. For a pgrep (which
      shares code with pkill) this makes sense, there was a match. It seems
      wrong for pkill to return 0 when it in fact could not do what you told
      it to.  However return value 3 means a fatal error and it's not fatal.
      
      Looking at other programs when trying to kill things it cannot kill.
      shell kill returns 1, procps kill returns 1, killall returns 1, skill
      returns 0 (and says it was successful!, ah well poor old skill)
      
      The consensus seems to be that you return 1 if you cannot kill it, even
      if you found it. In other words the return value for both not found and
      not able to kill it is the same.
      
      pkill only returns 0 if something was killed. This means we found a
      match AND the kill() system call worked too.
      
      References:
       https://bugs.debian.org/852758Signed-off-by: Craig Small's avatarCraig Small <csmall@enc.com.au>
      625d0809
    • Craig Small's avatar
      NEWS: Very minor typo fixed · 1fb37313
      Craig Small authored
      Signed-off-by: Craig Small's avatarCraig Small <csmall@enc.com.au>
      1fb37313
    • jim warner's avatar
      NEWS: updated with the two most recent program changes · a4f93b6d
      jim warner authored
      [ in addition to program changes, this file has been ]
      [ made to agree with that NEWS file under our newlib ]
      [ branch since some entries were ordered differently ]
      [ due to differences in the order of actual commits. ]
      Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      a4f93b6d
  10. 26 Jan, 2017 1 commit
  11. 17 Jan, 2017 1 commit
    • Earnestly's avatar
      top: Add unobtrusive XDG support · af53e170
      Earnestly authored
      By default the file HOME/.toprc will be prefered.  This ensures there
      should be minimal breakage even if this file is later created by some
      other means.  Otherwise we will follow the new behaviour described by
      the XDG Base Directory Specification:
      
      If the XDG_CONFIG_HOME environment variable is available we will attempt
      to use this as XDG_CONFIG_HOME/procps/toprc otherwise we will fall-back
      to HOME/.config/procps/toprc instead.
      Signed-off-by: Earnestly's avatarEarnestly <zibeon@gmail.com>
      af53e170
  12. 03 Jan, 2017 2 commits
  13. 02 Jan, 2017 1 commit
  14. 20 Dec, 2016 1 commit
  15. 07 Dec, 2016 4 commits
  16. 23 Nov, 2016 1 commit
  17. 22 Nov, 2016 1 commit
  18. 21 Nov, 2016 1 commit
  19. 07 Nov, 2016 1 commit
  20. 15 Oct, 2016 1 commit
    • jim warner's avatar
      top: make that 'forest view' just a tad more efficient · c6407ef1
      jim warner authored
      It makes no sense to begin our tracked nested level at
      '1' then later require a '1' to be subtracted from the
      level as artwork and indentation is added for display.
      
      By beginning such tracked levels at zero, we can avoid
      the need to adjust it & use it directly in a snprintf.
      
      [ this commit parallels a patch in our newlib branch ]
      Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      c6407ef1