[comp.sources.wanted] Load Average for System V?

dad@ciprico.mn.org (Dan A. Dickey) (07/27/87)

Does anyone out there have a program to display the load average on
System V, Release 2 (soon to be 3)?  This is for a Motorola System 8000.
I can't find anything on the system now, so if someone knows where/what it is,
please let me know.  Really what I want to know is what variables in the
kernel need to be looked at...and how to interpret them.
Please email to dad@ciprico.mn.org	-Dan

gwyn@brl-smoke.ARPA (Doug Gwyn ) (07/28/87)

In article <72@cipric.mn.org> dad@ciprico.mn.org (Dan A. Dickey) writes:
>Does anyone out there have a program to display the load average on
>System V, Release 2 (soon to be 3)?  This is for a Motorola System 8000.

If you have 5620 DMD terminals, try running "sysmon" in a layer.

If /usr/include/sys/sysinfo.h exists, it describes a kernel data
structure that you can read via /dev/kmem using the address of the
symbol _sysinfo that nlist() on /vmunix will determine for you.
The sysinfo structure runque and runocc members will allow you to
compute the load average.  Since sysinfo does not seem to be a
documented feature, your implementation may not support it.

allbery@ncoast.UUCP (Brandon Allbery) (08/02/87)

As quoted from <72@cipric.mn.org> by dad@ciprico.mn.org (Dan A. Dickey):
+---------------
| Does anyone out there have a program to display the load average on
| System V, Release 2 (soon to be 3)?  This is for a Motorola System 8000.
| I can't find anything on the system now, so if someone knows where/what it is,
| please let me know.  Really what I want to know is what variables in the
| kernel need to be looked at...and how to interpret them.
+---------------

Keep an eye on comp.sources.misc; I'm posting a set of programs I have for
System V:

	/etc/avenrun	(calculates load average and stuffs it into a shm
			segment for use by other programs)
	w		(!)
	csl		(it isn't sysline, but it _is_ nice)

AT&T Unix (System V) doesn't have a load average as such, but one can be
calculated that's a "ballpark figure" by manipulating some stuff in the
kernel "sysinfo" structure (see /usr/include/sys/sysinfo.h).  The code for
/etc/avenrun will show you how.
-- 
 Brandon S. Allbery, moderator of comp.sources.misc and comp.binaries.ibm.pc
  {{harvard,mit-eddie}!necntc,well!hoptoad,sun!cwruecmp!hal}!ncoast!allbery
ARPA: necntc!ncoast!allbery@harvard.harvard.edu  Fido: 157/502  MCI: BALLBERY
   <<ncoast Public Access UNIX: +1 216 781 6201 24hrs. 300/1200/2400 baud>>

brianc@cognos.uucp (Brian Campbell) (08/07/87)

In article <72@cipric.mn.org> dad@ciprico.mn.org writes:
! Does anyone out there have a program to display the load average on
! System V, Release 2 (soon to be 3)?  This is for a Motorola System 8000.

In article <6189@brl-smoke.ARPA> gwyn@brl.arpa responds:
! If you have 5620 DMD terminals, try running "sysmon" in a layer.
! 
! If /usr/include/sys/sysinfo.h exists, it describes a kernel data
! structure that you can read via /dev/kmem using the address of the
! symbol _sysinfo that nlist() on /vmunix will determine for you.
! The sysinfo structure runque and runocc members will allow you to
! compute the load average.  Since sysinfo does not seem to be a
! documented feature, your implementation may not support it.

Does anyone have the answer to this question for xenix 2.1.3?  I've got
the sysinfo include file, but an nlist informs me that the symbol is
not defined.

Has anyone written a 'top' type program for xenix?  Is there somewhere
I can get a little more information on some of the symbols defined in
/xenix?  What do the symbols prefixed with _dk, or _fl refer to?
-- 
Brian Campbell          uucp: decvax!utzoo!dciem!nrcaer!cognos!brianc
Cognos Incorporated     mail: 3755 Riverside Drive, Ottawa, Ontario, K1G 3N3
(613) 738-1440          fido: sysop@163/8

root@hobbes.UUCP (John Plocher) (08/10/87)

+---- Brian Campbell writes the following in article <1225@cognos.UUCP> ----
| ! If /usr/include/sys/sysinfo.h exists, it describes a kernel data
| ! structure that you can read via /dev/kmem using the address of the
| ! symbol _sysinfo that nlist() on /vmunix will determine for you.
| 
| Does anyone have the answer to this question for xenix 2.1.3?  I've got
| the sysinfo include file, but an nlist informs me that the symbol is
| not defined.
+----

On Microport SV/AT the structure is named "sysinfo" not "_sysinfo".  If
that doesn't work, try "_sysinf" (ie 7 chars instead of 8)

The command nm (section 1) will print out the symbol table - try:
	nm /unix | egrep sysinf
or some such...


-- 
John Plocher uwvax!geowhiz!uwspan!plocher  plocher%uwspan.UUCP@uwvax.CS.WISC.EDU