Remove <sys/user.h> inclusion from a few files that don't need it.
libk{core,info}: The kern.ccpu sysctl is gone, so remove *get_sched_ccpu().Interestingly, kcore_get_sched_ccpu() seems to never have returned ccpu,but instead tk_nin, which is not related.
Sweep-fix comparing pointers with 0 (and assigning 0 to pointers).For better readability, don't compare pointers with 0 or assign 0to them. Use NULL instead.The change was done with coccinelle.
kernel - Upgrade buffer space tracking variables from int to long* Several bufspace-related buffer cache parameters can now overflow a 32 bit integer on machines with large amounts (~64G+) of mem
kernel - Upgrade buffer space tracking variables from int to long* Several bufspace-related buffer cache parameters can now overflow a 32 bit integer on machines with large amounts (~64G+) of memory. Change these to long. bufspace, maxbufspace, maxbufmallocspace, lobufspace, hibufspace, lorunningspace, hirunningspace, dirtybufspace, dirtybufspacehw, runningbufspace, lodirtybufspace, hidirtybufspace.* Also requires an API change to libkcore/libkinfo which effects top.
show more ...
lib: Move the definition of WARNS into lib/Makefile.inc.
buildworld - Fix breakage* Fix some _KERNEL_STRUCTURES breakage. This isn't a fantastic solution but it works.Reported-by: swildner
Remove hardcoded -g in several Makefiles.
When <sys/user.h> is included, it MUST be included first because it setsa preprocessor variable that effects other header files.
Change kinfo_proc interface between kernel and userland.Before, we were embedding a struct proc (among others) into structkinfo_proc. Every time we change implementation details in the kernel,us
Change kinfo_proc interface between kernel and userland.Before, we were embedding a struct proc (among others) into structkinfo_proc. Every time we change implementation details in the kernel,userland has to be adapted (recompiled). In preparation for the comingLWP changes this interface has been reworked. Now kinfo_proc is astructure which does not depend on other structures on the kernel whichare subject to change. Instead, the routines fill_kinfo_proc andfill_kinfo_lwp copy all values which are of interest between the kernelstructure and the stable kinfo_proc structure.Furthermore, this change adds infrastructure to export LWP-specific data.If userland requests LWP data, it sets the flag KERN_PROC_FLAG_LWP in thesysctl oid. This leads to multiple kinfo_procs being exported. If notset, the first LWP will used. This is like FreeBSD do it, and it seemseasy and simple. Note that userland was not yet adjusted to actuallyrequest LWPs and aggregate this information if necessary. Besides, thekernel does not yet have more than one LWP per process anyways.This introduces a new file, kern/kern_kinfo.c, which is shared betweenkernel and libkvm. This was done to avoid and remove code duplication.Now kvm_getprocs constructs a complete struct proc, including pointers,and then calls fill_kinfo_proc to do its job.In-collaboration-with: Thomas E. Spanjaard <tgen@netphreax.net>
Remove all occurences of double semicolons at the end of a line bysingle ones.Submitted-by: Bill Marquette <bill.marquette@gmail.com>
Synchronize libkcore with recent file descriptor cleanups.
Minor adjustment of types for consistency.
Adapt kcore_get_sched_cputime(3) to retrieve and present an aggregatedCPU time statistics to the client. The CPU indexed array is retrievedfrom the kernel core and then put together.
Adapt the KINFO library to aggregate per-cpu cputime statistics. (a) add a framework for aggregating per-cpu structures, of variant field types; this interface will undergo change once it is
Adapt the KINFO library to aggregate per-cpu cputime statistics. (a) add a framework for aggregating per-cpu structures, of variant field types; this interface will undergo change once it is formalised upon, kinfo_pcpu.[ch]. (b) minor style(9) cleanups while I am around these ends. (c) adjust libkcore, this might not be fully correct but it fetches the right symbol at the least, it is not so easy to collect per-cpu statistics from core files without doing magic with the CPU privatespace like how we do in GDB debug scripts. (d) kinfo_get_sched_cputime(3) is fetching aggregate statistics to retain behavior, most programs do not care about per-cpu stats without getting really mucky anyway; (discussed with joerg)
Bump major numbers in preparation for libc work.
Fully separate the kcore initialisation and the kinfo wrapper.Call kcore_wrapper_open if you want the kinfo wrapper, otherwisekcore_open. This fixes the segfaults in pstat.Reported-by: Sven Wille
Fully separate the kcore initialisation and the kinfo wrapper.Call kcore_wrapper_open if you want the kinfo wrapper, otherwisekcore_open. This fixes the segfaults in pstat.Reported-by: Sven Willenberger <sven@dmv.com>
In preparation for the jail commit, include sys/param.h instead of sys/types.h.
Add new structures for exporting the cputime statistics via 64 bit countersand redo the timer frequence export.Provide the interface glue for libkinfo and libkcore.Additionally provide interfaces
Add new structures for exporting the cputime statistics via 64 bit countersand redo the timer frequence export.Provide the interface glue for libkinfo and libkcore.Additionally provide interfaces to query ccpu, the number of cpus, tk_ninand tk_nout.Remove those fields from devstat.h's struct statinfo.Remove kvm dependency of rpc.rstatd by using the newly added libkinfofunctions and the sysctl interface for vmmeter.Use the new interface in systat, the iostat part is now kvm-free.Use kinfo_get_sched_stathz in time.Use the kinfo interface for everything beside getting the actual process listin top. This also removes the Last PID, which could be added back easily.Since the feature is not that useful and breaks e.g. the jail isolation,I haven't added a sysctl to read nextpid.Use the kinfo interface in vmstat.Use the kinfo interface in iostat. iostat is now kvm-free and notsetgid kmem anymore. This also means that iostat can't be applied tocoredump anymore. If this functionality is important, the kcore kinfo wrappercan be added easily.
Correct conditional which would always make kcore_open() fail and returnNULL.
Missing return-value check for malloc.Noticed-by: Santtu Hyrkkö <santtu.hyrkko@gmail.com>
Add the basic of libkcore. Switch pstat to use kcore/kinfo backing,defaulting to kcore for now.