Commit Graph

100 Commits

Author SHA1 Message Date
Craig Small
a5750100a0 Fix Hertz calculation for FreeBSD
FreeBSD has no good way of finding the Hertz value. ELF notes don't
work, you can't find it in a function and even asm/params.h does
not have it.  Lucky for us, it is always 100.

Based upon Debian patch patch sysinfo_kfreebsd_hertz by Petr Salinger
Bug-Debian: http://bugs.debian.org/460331
Caution, 460331 has lots of overlapping bugs all around the Hertz
problem across many arches.
2011-10-07 10:22:24 +11:00
Craig Small
aae3d318d4 Elf note AT_CLKTCK is only found on Linux
Suppresses a message about elf notes not found on non-Linux systems.
kFreeBSD systems, for one, don't have this so the message appears
every time you run a procps program otherwise.

Based upon Debian patch sysinfo_elfnote by Petr Salinger
Bug-Debian: http://bugs.debian.org/378157
2011-10-07 10:08:42 +11:00
Craig Small
b9a408372e Merge branch 'master', remote-tracking branch 'sami/ng' 2011-10-01 23:23:30 +10:00
Craig Small
3ef4823f90 supgid/supgrp support, improved library interface
Library changes
   readproc
    . added support for supplementary groups
    . eliminated 2 potential mem leak sources
       . shortcut used for multi-threaded str
         vectors & ptrs was obsoleted
       . freeing of proc_t related dynamic
         memory now rests with the library
    . standardized/normalized many c comments
   sysinfo
    . corrected note regarding glibc & cpuinfo
   library.map
    . made the visible freeproc accessable
 Program changes
   pmap
    . initialized buffer for new readproc i/f
    . eliminated now obsolete free() call
   ps
    . added width aware supgrp support
    . initialized buffers for new readproc i/f
    . eliminated now obsolete free() calls
   top
    . added supgrp support as variable width
    . eliminated now obsolete free() calls
    . expoilted library freeproc function
    . corrected -h|v args text & spacing
    . updated some c comments
 Documentation changes
   ps.1
    . added supgid and supgrp
   top.1
    . added supgid and supgrp
    . addition of above required renumbering
      many fields in section 3a. DESCRIPTIONS
2011-08-01 21:28:46 +10:00
Craig Small
a26c3bfa39 top hotplug memory support
Another patch from Jim for top to support hot-pluggable memory. Not
fully tested on real hot-pluggable memory because neither of us have
it
2011-07-14 21:16:02 +10:00
Sami Kerola
33fb22b169 proc/sysinfo.c: autotools caused a regression
For some reason necessary variable was commented out at June
2003, see commit bellow for details.

commit 5c99a21b72

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-04 17:22:44 +02:00
Jim Warner
7b0fc19e9d enhanced libproc cgroup/cmdline support, exploited by top
Library Changes
. added PROC_EDITCMDLCVT flag
. added an internal (static) fill_cmdline_cvt function:
  - reads and "escapes" /proc/#/cmdline
  - returns result as a single string in a single vector
  - callers are guaranteed a cmdline (no more NULL)
. added vectorize_this_str function, exploited by
  fill_cgroup_cvt, fill_cmdline_cvt
. generalized read_cmdline function as read_unvectored, now
  exploited by fill_cgroup_cvt, fill_cmdline_cvt, read_cmdline
  ( cgroup and cmdline no longer need be converted to string )
  ( vectors before being transformed to final representation )
. fixed bug regarding skipped group numbers (when enabled)
. escape_str made responsible for all single byte translation
  with distinction between control chars + other unprintable
. added escaped_copy function for already escaped strings
. reorganized parts of proc_t to restore formatting standards
  ( displacement changes shouldn't matter with new version # )
. former ZAP_SUSEONLY #define now OOMEM_ENABLE
. added to library.map: escaped_copy; read_cmdline

Top Program Changes
. exploited the new PROC_EDITCMDLCVT provision
. eliminated now obsolete #include "proc/escape.h"
. changed the P_WCH display format if no kernel symbol table
. fixed very old bug in lflgs for out-of-view sort fields
. former ZAP_SUSEONLY #define now OOMEM_ENABLE

Ps Program Changes
. exploited the new PROC_EDITCMDLCVT provision
. exploited the new escaped_copy function
. consolidated pr_args and pr_comm into pr_argcom

Signed-off-by: Jan Görig <jgorig@redhat.com>
2011-05-18 10:33:44 +02:00
Werner Fink
aac0de8994 Initialize smp_num_cpus only if really required
Initialize smp_num_cpus only if really required

Signed-off-by: Werner Fink <werner@suse.de>
2011-04-15 15:53:20 +02:00
Jan Görig
8fde4af11d Call libproc constructors in strict order
Having one constructor depend on another means if the order
is reversed you get a different result.
Patched based on idea by Tom Evans.

Added new code to old_Hertz_hack by Werner Fink <werner@suse.de>

Bug-Debian: http://bugs.debian.org/460331
Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=632236
Reviewed-by: Jan Görig <jgorig@redhat.com>
2011-01-19 12:50:26 +01:00
Jan Görig
4d3c19af52 Read the system boot time from /proc instead of computing
Read the time of system boot from /proc/stat (entry: btime) instead
of computing it as the difference between the current time and the
uptime. This is the only way to get a consistent result which won't
possibly change from one run to the next.

The problems with the original code were:
* Both the current time and the uptime are rounded down to the second,
  but the system doesn't boot on an integer second value so they do not
  tick at the same moment. Thus, the rounding errors can cause a one
  second difference from one run to the next.
* We can't read the uptime and the current time at the exact same moment
  anyway, so the time difference we compute is bound to be inaccurate.
Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=222251
Author: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Craig Small <csmall@debian.org>
2010-12-16 10:30:39 +01:00
albert
7dd414ac1b new /proc/meminfo fields 2008-03-24 04:41:26 +00:00
albert
9049ffef32 ps man page 2006-09-10 06:25:56 +00:00
albert
9278134e49 top: show CPU time stolen from a virtual machine 2006-06-25 02:15:36 +00:00
albert
47d33e7ed4 g is criteria 2006-06-24 20:12:29 +00:00
albert
29cbc63561 fputs instead of fprintf 2005-10-30 23:45:47 +00:00
albert
864a5356a1 fix race condition 2005-06-10 15:43:15 +00:00
albert
6ec1cff342 ps: built-in test code, etc. 2004-10-12 00:12:25 +00:00
albert
0d77d98bf3 ttySMX* devices, /proc/vmstat change, /proc/meminfo change 2004-08-27 20:21:46 +00:00
albert
af2077f22d new /proc/vmstat fields 2004-08-27 14:23:36 +00:00
albert
792358ba42 Linux 2.2 non-SMP on SMP Alpha needed this 2004-08-10 07:18:04 +00:00
albert
6308cb79e1 rh109147-like bug w/ old data in buffer, plus ")" problem and speed 2004-07-28 15:19:46 +00:00
albert
713d32a93a some overflow problems fixed -- thanks Holger Kiehl 2004-07-26 13:48:59 +00:00
albert
c8a8290ef2 fix vmstat -d 2004-05-04 23:29:40 +00:00
albert
e54c8239b1 new Linux 2.6.0-test4 CPU stats shown 2003-09-08 01:39:49 +00:00
albert
8618adeaaf got most of procps-3.1.11ff2.diff 2003-08-10 23:40:41 +00:00
albert
45764fb735 3.1.11 2003-07-14 12:11:43 +00:00
albert
0db94e6a1a GPLONLY_ and PID-related stuff 2003-07-03 05:20:19 +00:00
albert
5c99a21b72 diskstats and slabinfo 2003-06-08 17:28:06 +00:00
albert
de2857aa89 fabian.frederick@gmx.fr vmstat code 2003-05-31 00:38:55 +00:00
albert
89ccfbf4f8 whip me, beat me, make me do UNIX terminal handling 2003-03-27 16:28:41 +00:00
albert
9c25e92bf0 3.1.6 news 2003-01-23 07:08:00 +00:00
albert
0a03eac352 malloc error 2003-01-23 05:48:27 +00:00
albert
71d958095f just checking 2002-12-15 06:30:04 +00:00
albert
3e67b58ec2 satisfy GPL section 2a and LGPL section 2b name+date requirement 2002-12-15 00:30:17 +00:00
albert
c3ee8f3252 Inact_laundry 2002-12-08 00:14:02 +00:00
albert
bd1a19b577 c99 2002-11-25 10:16:33 +00:00
albert
1e1645c4d4 first 3.0.4 thing: ELF note warning 2002-10-14 07:53:08 +00:00
albert
81a4a3d281 gcc 3.0 warnings 2002-10-12 04:25:57 +00:00
albert
af89241571 coding style 2002-10-09 21:32:33 +00:00
albert
0fda206a66 warning and variable name fixes 2002-10-09 07:11:08 +00:00
albert
a4b477c96a fix for x86 2002-10-07 21:28:14 +00:00
albert
0a20031787 find out if the code goes unused 2002-10-07 03:37:48 +00:00
albert
623c2d9bc5 ELF note scanner 2002-10-07 01:48:47 +00:00
albert
eeb598fd98 handle Linux 2.5.xx ABI 2002-10-06 16:46:06 +00:00
csmall
15ca5a130d Adjusted includes so no longer a clash with old and new includes 2002-06-24 04:29:04 +00:00
albert
58d7de98cf 64-bit time for Linux 2.5.xx 2002-05-29 16:40:03 +00:00
albert
bce2da1f9a 64-bit time for Linux 2.5.xx 2002-05-28 04:18:55 +00:00
albert
17bd2ac219 crapectomy, add user-mode and S/390 arch, add kb_swap_cached 2002-05-28 02:30:40 +00:00
csmall
e4c67b2724 Put most of the Debian patches in
added a lot of cvsignore files
2002-02-01 23:40:38 +00:00
csmall
03a9b5a30f procps 010114 2002-02-01 22:47:29 +00:00