Commit Graph

23 Commits

Author SHA1 Message Date
Robert Watson
ccd8bad0bb A first cut at teaching libkvm how to deal with dynamic per-CPU storage
(DPCPU):

A new API, kvm_dpcpu_setcpu(3), selects the active CPU for the purposes
of DPCPU.  Calls to kvm_nlist(3) will automatically translate DPCPU
symbols and return a pointer to the current CPU's version of the data.
Consumers needing to read the same symbol on several CPUs will invoke a
series of setcpu/nlist calls, one per CPU of interest.

This addition makes it possible for tools like netstat(1) to query the
values of DPCPU variables during crashdump analysis, and is based on
similar code handling virtualized global variables.

MFC after:	1 week
Sponsored by:	Juniper Networks, Inc.
2010-03-01 00:27:55 +00:00
Ed Schouten
daaf575910 Build lib/ with WARNS=6 by default.
Similar to libexec/, do the same with lib/. Make WARNS=6 the norm and
lower it when needed.

I'm setting WARNS?=0 for secure/. It seems secure/ includes the
Makefile.inc provided by lib/. I'm not going to touch that directory.
Most of the code there is contributed anyway.
2010-01-02 09:58:07 +00:00
Bjoern A. Zeeb
7cf8b4b933 Make libkvm work on live systems and crashdumps with and
without VIMAGE virtualization in the kernel.

If we cannot resolve a symbol try to see if we can find it with
prefix of the virtualized subsystem, currently only "vnet_entry"
by identifying either the vnet of the current process for a
live system or the vnet of proc0 (or of dumptid if compiled
in a non-default way).

The way this is done currently allows us to only touch libkvm
but no single application. Once we are going to virtualize more
subsystems we will have to review this decision for better scaling.

Submitted by:	rwatson (initial version of kvm_vnet.c, lots of ideas)
Reviewed by:	rwatson
Approved by:	re (kib)
2009-07-23 21:12:21 +00:00
Rafal Jaworowski
8e321b7943 Support kernel crash mini dumps on ARM architecture.
Obtained from:	Juniper Networks, Semihalf
2008-11-06 16:20:27 +00:00
John Baldwin
f110b23b7d Add a new routine kvm_getcptime(3) for fetching the equivalent of
'kern.cp_time'.  For a live kernel it uses the sysctl.  For a crashdump,
it first checks to see if the kernel has a 'cp_time' global symbol.  If
it does, it uses that.  If that doesn't work, when it uses the recently
added kvm_getmaxcpu(3) and kvm_getpcpu(3) routines to walk all the CPUs
and sum up their counters.

MFC after:	1 week
2008-08-19 21:30:36 +00:00
John Baldwin
794a9a6c96 Add two new routines to libkvm for working with per-CPU data:
kvm_getmaxcpu() and kvm_getpcpu().

MFC after:	1 week
2008-08-19 19:55:33 +00:00
Kip Macy
cab68f571e unbreak build for sparc64 etc.
TARGET won't be defined on non subarches

Approved by: rwatson (mentor)
Reviewed by: jmg
2006-10-09 05:12:54 +00:00
Kip Macy
ddd5342909 buildworld fixes for sun4v
not sure why pmap.c is included as it is unchanged

Approved by: rwatson (mentor)
Reviewed by: jmg
2006-10-09 04:58:45 +00:00
Peter Wemm
e9ca6fe47e Teach libkvm how to read minidumps. It turns out that minidumps are
far more convenient for libkvm to work with because of the page table
block at the beginning.  As a result, the MD code is smaller.

libkvm will automatically detect old vs mini dumps on i386 and amd64.

libkvm will handle i386 PAE and non-PAE modes.  There is a PAE flag in
the i386 minidump header to signal the width of the entries in the
page table block.

Other convenient values are also present, such as kernbase and the direct
map addresses on amd64.
2006-04-21 04:32:51 +00:00
David E. O'Brien
4f4a104ee8 style.Makefile(5) 2003-08-18 15:25:39 +00:00
Gordon Tetlow
41d8423f71 Stage 3 of dynamic root support. Make all the libraries needed to run
binaries in /bin and /sbin installed in /lib. Only the versioned files
reside in /lib, the .so symlink continues to live /usr/lib so the
toolchain doesn't need to be modified.
2003-08-17 08:28:46 +00:00
Ruslan Ermilov
3ab9a9d0e0 Removed -I${.CURDIR}/.../sys from CFLAGS. 2001-05-18 13:41:42 +00:00
Ruslan Ermilov
4a558355e5 MAN[1-9] -> MAN. 2001-03-27 17:27:19 +00:00
Peter Wemm
d77052e5fa Find <libkvm.h> in the source tree. This helps standalone builds. 2001-03-21 22:52:48 +00:00
Rodney W. Grimes
d05257b0f2 Replace beforeinstall target with new variables used by .mk system.
Reviewed by:	marcel, and make world
2000-01-14 07:57:47 +00:00
Peter Wemm
59c9cd2bce Install <kvm.h> from here (after repo copy) so it's all in one package. 1999-10-04 14:56:04 +00:00
Bruce Evans
8bb84da720 Fixed unsorting of SRCS and MAN3 in previous commit.
Sorted MLINKS.
1999-01-23 07:55:15 +00:00
Matthew Dillon
e92324a21e Implement kvm_getswapinfo() libkvm function. Will be used by
pstat, top, and systat.
1999-01-22 10:36:04 +00:00
KATO Takenori
d7feb25bdf Change ${MACHINE} into ${MACHINE_ARCH} to support MACHINE=pc98. 1998-09-09 11:27:33 +00:00
Bruce Evans
30a72f72d5 -I${DESTDIR}/sys -> -I${.CURDIR}/../../sys. 1997-08-26 14:13:02 +00:00
Satoshi Asami
688034bb93 Add ${DESTDIR} in front of absolute path. 1997-07-18 06:32:39 +00:00
Garrett Wollman
ab532cffe5 Make it work with our make macros. 1994-08-05 01:42:04 +00:00
Rodney W. Grimes
58f0484fa2 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00