1. 12 Sep, 2018 4 commits
    • jim warner's avatar
      top: eliminated the use of that 'procps.h' header file · a6dfc238
      jim warner authored
      That prior patch set the stage for eliminating the use
      of that 'procps.h' header, while retaining support for
      a ./configure -DXTRA_PROCPS_DEBUG' during development.
      
      This commit just eliminates top's use of 'procps.h' in
      favor of a separate include for needed newlib headers.
      Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      a6dfc238
    • jim warner's avatar
      library: refactor the XTRA_PROCPS_DEBUG implementation · fab37662
      jim warner authored
      If we ever were to eliminate the procps.h header file,
      as discussed in the thread referenced below, then that
      would impair the current XTRA_PROCPS_DEBUG provisions.
      
      The only remaining way to verify result types would be
      to explicitly include that <proc/xtra-procps-debug.h>.
      
      So, this commit will once again enable the ./configure
      provision for defining the -DXTRA_PROCPS_DEBUG option.
      
      Reference(s):
      https://www.freelists.org/post/procps/newlib-Qualys-patches,6Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      fab37662
    • jim warner's avatar
      top: a tweak to the forest view collapsed code (again) · 19dd4f71
      jim warner authored
      From the outset, top has tried to provide some minimal
      garbage collection in support of forest view collapse.
      For example, with every 'v' keystroke, a check is made
      of the currently targeted pids.  If all were negative,
      which means expanded, that Hide_pid array was emptied.
      
      Recently, yet another efficiency was added wherein the
      continuing scan for a targeted pid was terminated when
      a match was found. But, one more inefficiency existed.
      
      When a task which was subject to collapse under forest
      view mode has disappeared (ended), repeatedly scanning
      for such a pid with each iteration makes little sense.
      
      So this commit will negate such targeted pids and thus
      avoid scanning every current task looking for a match.
      Then, if 'v' is ever stuck at some point in the future
      there will be a chance to empty that Hide_pid[] array.
      
      [ hopefully this will be a final tweak of the forest ]
      [ view collapse stuff, but cross your fingers anyway ]
      Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      19dd4f71
    • jim warner's avatar
      top: the '#define SCROLLVAR_NO' is bent but not broken · 5c8d94ff
      jim warner authored
      This patch simply avoids an 'unused' variable warning.
      Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      5c8d94ff
  2. 13 Aug, 2018 4 commits
    • jim warner's avatar
      top: speed up the collapsed children forest view logic · 43caa7a1
      jim warner authored
      In forest view mode, once a collapsible parent process
      and all of its children (if any) have been identified,
      there is no longer a need to scan the remaining tasks.
      
      So this patch will just force a new scan for any other
      'Hide_pid' entries which might remain to be identified
      after a targeted parent has been completely processed.
      Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      43caa7a1
    • jim warner's avatar
      top: miscellaneous accumulated tweaks to code/comments · 52376d16
      jim warner authored
      This patch includes the following miscellaneous stuff:
      
      . ensure 1 space before any '*' ptr sizeof() reference
      
      . explain the rather cryptic 'ioa' guy a little better
      Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      52376d16
    • jim warner's avatar
      top: eliminate all of that 'relative enumerator' bloat · 65feb3c5
      jim warner authored
      The top program has always specified the maximum stack
      depth at 'new' time. Then, in those stacks the minimum
      number of result structures were used for representing
      only fields actually being displayed in the 4 windows.
      
      That, however, complicated all subsequent access since
      each field's enumerator then had to be translated into
      a relative position when interacting with the library.
      This was accomplished by that Fieldstab 'erel' member.
      
      So this patch eliminates an extra level of indirection
      by fully exploiting the existing maximum sized stacks.
      Now, the enumerators that top uses to represent fields
      also represent their relative positions in each stack.
      
      [ for fields not actually displayed, the position in ]
      [ a stack is represented by the 'PIDS_extra' struct. ]
      [ thus, there isn't any real library costs for those ]
      [ enumerators/fields which aren't currently visible. ]
      Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      65feb3c5
    • Craig Small's avatar
      docs: Update ps.1 to warn about command name length · 76a2d4c0
      Craig Small authored
      Previous versions of ps used to only match on the first 15 characters
      because that's what the kernel used to provide. Newer kernels have a
      longer length for this field so procps has been updated to suit.
      
      References:
       #101
       https://bugzilla.suse.com/show_bug.cgi?id=1099091
      76a2d4c0
  3. 08 Aug, 2018 2 commits
  4. 01 Aug, 2018 3 commits
  5. 18 Jul, 2018 3 commits
  6. 17 Jul, 2018 2 commits
    • jim warner's avatar
    • jim warner's avatar
      top: parent total cpu includes collapsed children, pgm · 7c7903e5
      jim warner authored
      Now, when a parent's children have been collapsed, the
      cpu used by those unseen tasks will disappear no more.
      Instead such tics will be added to the parent's total.
      
      [ if one wished a return to the 'land of lost tics', ]
      [ the '#define TREE_VCPUOFF' directive is available. ]
      
      ------------------------------------------------------
      Note: With collapsible parents now displaying children
      cpu usage, it will eventually be noticed the cpu stats
      for the summary area and task areas often vary widely.
      
      It's worth a reminder that for top's summary area each
      individual cpu and the cpu summary is limited to 100%,
      regardless of how many tics a linux kernel may export.
      
      An individual task is limited to 100% times the number
      of threads. But, in no case will cpu usage ever exceed
      100% times total number of processors. Such limits are
      further reduced under 'Solaris' mode ('I' toggle off).
      In this mode, a task cpu usage will never exceed 100%.
      These limits will now also apply to collapsed parents.
      
      In addition to those influences, results are subjected
      to kernel timer sampling anomalies and the distortions
      inherent in a small sample size, made worse by smaller
      delay intervals. Often there is just 1 or 2 tics for a
      few tasks at smaller intervals such as: 1/10th second.
      
      Anyway, should questions on this subject arise, a good
      starting point, beyond the reminders above, is the 1st
      link listed below. Those other links were derivatives.
      
      Reference(s):
      . from the kernel documentation
      https://www.kernel.org/doc/Documentation/cpu-load.txt
      . as mentioned in the above kernel documentation
      https://lkml.org/lkml/2007/2/12/6
      . from above, with many more links on the subject
      https://www.boblycat.org/~malc/apc/Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
      7c7903e5
  7. 26 Jun, 2018 17 commits
  8. 23 Jun, 2018 5 commits