summaryrefslogtreecommitdiffstats
path: root/lib/libkvm/kvm_proc.c
Commit message (Collapse)AuthorAgeFilesLines
* Make kvm(3) aware of ki_jid field.pjd2005-03-201-1/+17
| | | | | Reviewed by: gad MFC after: 3 days
* Dike out unwarranted reference to si_udev.phk2005-03-151-0/+4
|
* In preparation to remove U areas, don't refer to p_uarea in libkvm.das2004-11-201-1/+1
| | | | Reviewed by: arch@
* Remove un-needed call to close(2). The fd that close is beingcsjp2004-11-131-1/+0
| | | | | | called on is invalid and has no use. Reviewed by: smkelly
* Belatedly catch up with the dev_t/cdev changes from a few months back.peter2004-10-111-1/+11
| | | | | | | Extract the struct cdev pointer and the tty device from inside rather than incorrectly casting the 'struct cdev *' pointer to a 'dev_t' int. Not that this was particularly important since it was only used for reading vmcore files.
* - Fix the compile to chase the p_rux changes.jhb2004-10-061-1/+7
| | | | | | | - Add a comment noting that the ru_[us]times values being read aren't actually valid and need to be computed from the raw values. Submitted by: many (1)
* Refactor a bunch of scheduler code to give basically the same behaviourjulian2004-09-051-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | but with slightly cleaned up interfaces. The KSE structure has become the same as the "per thread scheduler private data" structure. In order to not make the diffs too great one is #defined as the other at this time. The KSE (or td_sched) structure is now allocated per thread and has no allocation code of its own. Concurrency for a KSEGRP is now kept track of via a simple pair of counters rather than using KSE structures as tokens. Since the KSE structure is different in each scheduler, kern_switch.c is now included at the end of each scheduler. Nothing outside the scheduler knows the contents of the KSE (aka td_sched) structure. The fields in the ksegrp structure that are to do with the scheduler's queueing mechanisms are now moved to the kg_sched structure. (per ksegrp scheduler private data structure). In other words how the scheduler queues and keeps track of threads is no-one's business except the scheduler's. This should allow people to write experimental schedulers with completely different internal structuring. A scheduler call sched_set_concurrency(kg, N) has been added that notifies teh scheduler that no more than N threads from that ksegrp should be allowed to be on concurrently scheduled. This is also used to enforce 'fainess' at this time so that a ksegrp with 10000 threads can not swamp a the run queue and force out a process with 1 thread, since the current code will not set the concurrency above NCPU, and both schedulers will not allow more than that many onto the system run queue at a time. Each scheduler should eventualy develop their own methods to do this now that they are effectively separated. Rejig libthr's kernel interface to follow the same code paths as linkse for scope system threads. This has slightly hurt libthr's performance but I will work to recover as much of it as I can. Thread exit code has been cleaned up greatly. exit and exec code now transitions a process back to 'standard non-threaded mode' before taking the next step. Reviewed by: scottl, peter MFC after: 1 week
* Remove stale code protected by #ifdef sparc. GCC 3.4.x adds sparc tokan2004-07-281-9/+0
| | | | predefined symbols on all SPARC platforms and FreeBSD follows the crowd.
* Fix a test of bit-flag "P_SA" by adding parenthesis around the expression.gad2004-06-231-1/+1
| | | | Submitted by: Cyrille Lefevre
* Replace a call to strncpy() with a call to strlcpy()gad2004-06-231-4/+2
| | | | Submitted by: Cyrille Lefevre
* Fill in the some new fields 'struct kinfo_proc', namely ki_childstime,gad2004-06-191-5/+29
| | | | | | | | | | | | | ki_childutime, and ki_emul. Also uses the timeradd() macro to correct the calculation of ki_childtime. That will correct the value returned when ki_childtime.tv_usec > 1,000,000. This also implements a new KERN_PROC_GID option for kvm_getprocs(). It also implements the KERN_PROC_RGID and KERN_PROC_SESSION options which were added to sys/kern/kern_proc.c revision 1.203. PR: bin/65803 (a very tiny piece of the PR) Submitted by: Cyrille Lefevre
* Second half of the dev_t cleanup.phk2004-06-171-1/+1
| | | | | | | | | | | The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev() Various minor adjustments including handling of userland access to kernel space struct cdev etc.
* This library has to change whenever the kernel process structure changes.julian2004-06-161-1/+1
|
* Fix a warning: compare u_long ps_strings to 0 instead of NULL.schweikh2004-03-281-1/+1
|
* Teach kvm_getprocs() to recognize a sysctl flag for including threads.deischen2004-02-221-5/+8
|
* Use the 3-component version of the KERN_PROC_PROC sysctl.tjr2003-09-271-2/+4
|
* Remove unnecssary <vm/swap_pager.h> includes.phk2003-07-311-1/+0
| | | | | These were probably not cleaned up back in whatever murky past these files were split into separate files.
* P_THREADED was renamed to P_SA, follow up.davidxu2003-06-151-2/+2
|
* s/procsig/sigacts/ to catch up to procsig and sigacts changes in the kernel.jhb2003-05-141-10/+6
| | | | Approved by: re (scottl)
* Bandaid for world. jhb gets the pointy hat here and he needs to look atpeter2003-05-141-0/+4
| | | | | | this. Approved by: re (scottl)
* Catch up with the kernel. Move the current cpu indicator to the thread.julian2003-04-101-3/+1
|
* - Spell SIGSETOR correctly.jeff2003-04-011-1/+1
|
* - Catch up with kernel signal changes.jeff2003-03-311-1/+2
|
* Catch up to p_tracep -> p_tracevp rename to unbreak world.jhb2003-03-131-1/+1
| | | | Pointy hat to: jhb
* Change the process flags P_KSES to be P_THREADED.julian2003-02-271-2/+2
| | | | This is just a cosmetic change but I've been meaning to do it for about a year.
* Catch up to SMTX -> SLOCK changes.jhb2002-10-021-7/+7
|
* Ressurect libkvm use of the bitmasked signal list in the kernel, now thatjmallett2002-10-011-7/+1
| | | | reliable signal queues are gone.
* Fix typo, should zero the kinfo_proc's siglist, not the real one's - the realjmallett2002-10-011-1/+1
| | | | | | | one doesn't have one. Submitted by: jake, scottl Big pointed hat that lands one in the badcommitters box to: jmallett
* The list of queued signals is not, can not, and will not be exported to thejmallett2002-09-301-1/+7
| | | | | | userland. If someone wants to implement a backup p_siglist in the kernel for compatability and to export one could. For now, just tell KVM to hand an empty signal set off to the userland.
* Fixed messes involving $FreeBSD$ starting with one left in the copyrightbde2002-09-161-21/+5
| | | | | | | | after adding __FBSDID(). Garbage-collected kvm_readswap(). This was once used by kvm_uread(), but kvm_uread() now just reads /proc/<pid>/mem and procfs hopefully handles swapped out pages.
* Allocate KSEs and KSEGRPs separatly and remove them from the proc structure.julian2002-09-151-12/+45
| | | | | | | | | next step is to allow > 1 to be allocated per process. This would give multi-processor threads. (when the rest of the infrastructure is in place) While doing this I noticed libkvm and sys/kern/kern_proc.c:fill_kinfo_proc are diverging more than they should.. corrective action needed soon.
* Completely redo thread states.julian2002-09-111-21/+24
| | | | Reviewed by: davidxu@freebsd.org
* Hopefully unbreak world. ke_slptime is gone. It should really have beenpeter2002-08-301-1/+1
| | | | looking at p_ksegrp.kg_slptime anyway.
* Allow one to grab the definition of struct ucred by defining _WANT_UCREDalfred2002-08-281-2/+1
| | | | | | | instead of forcing _KERNEL. Move the include of sys/_label.h in ucred.h under the _KERNEL || _WANT_UCRED case.
* &x is not a format stringkris2002-08-241-1/+1
|
* Hide 'struct ucred' behind '#ifdef _KERNEL', this should stop userlandalfred2002-08-161-0/+3
| | | | | | | from attempting to use it for good. There is a catch, kvm_proc.c needs to '#define _KERNEL' to get at the ucred. Requested by: rwatson
* Don't even read in the thread if it is a zombie process.julian2002-06-301-7/+10
|
* grow a brain and do this right.julian2002-06-301-5/+7
|
* Don't follow non existant thread pointers (e.g. for zombies)julian2002-06-301-33/+35
|
* Part 1 of KSE-IIIjulian2002-06-291-2/+19
| | | | | | | | | | | | | The ability to schedule multiple threads per process (one one cpu) by making ALL system calls optionally asynchronous. to come: ia64 and power-pc patches, patches for gdb, test program (in tools) Reviewed by: Almost everyone who counts (at various times, peter, jhb, matt, alfred, mini, bernd, and a cast of thousands) NOTE: this is still Beta code, and contains lots of debugging stuff. expect slight instability in signals..
* Fix (for the second time) kvm_getprocs() for the case where nodd2002-04-071-0/+26
| | | | | | | | | | | | processes match the given criteria. Since revision 1.60 of malloc.c, malloc() and friends return an invalid pointer when given a size of 0. kvm_getprocs() uses sysctl() with a NULL oldp argument to get an initial size, but does not check whether it's 0 before passing it to realloc() (via _kvm_realloc()). Before the aforementioned malloc() change, this resulted in a minimal allocation made and a valid poitner returned, but now results in an invalid, but non-NULL, pointer being returned. When this is passed to sysctl(), the latter returns EFAULT (as it should).
* Remove 'register' keyword.obrien2002-03-211-17/+17
|
* Also blindly attempt to fix broken world with respect to proc.p_runtimegreen2002-02-221-1/+3
| | | | changes.
* I THINK this fixes 'make world'julian2002-02-131-1/+4
| | | | | | I'll know as soon as I re-import it and compile it.. :-) There is no longer a 'pri' strict in the proc struct. the fields are scattered between the ksegrp and thread in question.
* pre-emptively fix a KSE/M3 problem.julian2002-02-071-7/+14
| | | | | | | Make a slight change so that libkvm reaches the main thread via the linked list, rather than assuming it is in the proc structure. Both conditions are true in -current but only the first will be true in the KSE M3 world.
* kern.ps_arg_max_cache is a long, not an int. I believe this is half ofpeter2001-11-081-1/+1
| | | | | | what broke ps on ia64. It probably also broke on alpha, but the fallback method of using lseek/read on /proc/*/mem to read ps_strings seems to work there. It doesn't on ia64 yet.
* Compensate for "Compensate for header dethreading" by backing it out.bde2001-10-101-2/+0
|
* Implement __FBSDID()dillon2001-09-161-0/+3
|
* KSE Milestone 2julian2001-09-121-15/+16
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Make ps -M corefile work again. This has been broken for quite some time.peter2001-08-241-6/+11
| | | | kvm_proclist() was aborting when it saw the ithreads with no pgrp.
OpenPOWER on IntegriCloud