summaryrefslogtreecommitdiffstats
path: root/usr.bin/procstat
Commit message (Collapse)AuthorAgeFilesLines
* Add file forgotten in r204879.kib2010-03-081-0/+139
|
* Teach procstat(1) to display some information about signal dispositionkib2010-03-084-8/+84
| | | | | | | and pending/blocked status for signals. Reviewed by: rwatson MFC after: 2 weeks
* Document one more file descriptor type and two more vnode types.antoine2010-02-061-0/+6
| | | | MFC after: 2 weeks
* Build usr.bin/ with WARNS=6 by default.ed2010-01-021-1/+0
| | | | Also add some missing $FreeBSD$ to keep svn happy.
* Revert most part of 200420 as requested, as more review and polish isdelphij2009-12-134-0/+4
| | | | needed.
* Remove unneeded header includes from usr.bin/ except contributed code.delphij2009-12-114-4/+0
| | | | Tested with: make universe
* Update procstat(1) for the fact that devfs paths are no longer unsupported.rwatson2009-08-121-4/+2
| | | | Approved by: re (kib)
* Introduce a new sysctl process mib, kern.proc.groups which adds thebrooks2009-07-241-2/+40
| | | | | | | | | | | | ability to retrieve the group list of each process. Modify procstat's -s option to query this mib when the kinfo_proc reports that the field has been truncated. If the mib does not exist, fall back to the truncated list. Reviewed by: rwatson Approved by: re (kib) MFC after: 2 weeks
* Add a new type of VM object: OBJT_SG. An OBJT_SG object is very similar tojhb2009-07-241-0/+3
| | | | | | | | | | | a device pager (OBJT_DEVICE) object in that it uses fictitious pages to provide aliases to other memory addresses. The primary difference is that it uses an sglist(9) to determine the physical addresses for a given offset into the object instead of invoking the d_mmap() method in a device driver. Reviewed by: alc Approved by: re (kensmith) MFC after: 2 weeks
* Include param.h instead of types.h before user.h so that the nestedrwatson2008-12-299-9/+9
| | | | | | include of param.h can be removed from audit.h. MFC after: 3 weeks
* Fix a typo.wxs2008-12-191-1/+1
| | | | Approved by: rwatson
* Do not segfault when procstat -f or procstat -v is called on a process notmarcus2008-12-192-0/+4
| | | | | | | | owned by the current user. If kinfo_getfile() or kinfo_getvmmap() return NULL, simply exit, and do not try and derefernce the memory. Reviewed by: peter Approved by: peter
* Update format string for kve_start/end.peter2008-12-021-2/+3
|
* Use libutil wrapper for kinfo_get{file|vmmap}()peter2008-12-013-64/+16
|
* Integrate the new MPSAFE TTY layer to the FreeBSD operating system.ed2008-08-202-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The last half year I've been working on a replacement TTY layer for the FreeBSD kernel. The new TTY layer was designed to improve the following: - Improved driver model: The old TTY layer has a driver model that is not abstract enough to make it friendly to use. A good example is the output path, where the device drivers directly access the output buffers. This means that an in-kernel PPP implementation must always convert network buffers into TTY buffers. If a PPP implementation would be built on top of the new TTY layer (still needs a hooks layer, though), it would allow the PPP implementation to directly hand the data to the TTY driver. - Improved hotplugging: With the old TTY layer, it isn't entirely safe to destroy TTY's from the system. This implementation has a two-step destructing design, where the driver first abandons the TTY. After all threads have left the TTY, the TTY layer calls a routine in the driver, which can be used to free resources (unit numbers, etc). The pts(4) driver also implements this feature, which means posix_openpt() will now return PTY's that are created on the fly. - Improved performance: One of the major improvements is the per-TTY mutex, which is expected to improve scalability when compared to the old Giant locking. Another change is the unbuffered copying to userspace, which is both used on TTY device nodes and PTY masters. Upgrading should be quite straightforward. Unlike previous versions, existing kernel configuration files do not need to be changed, except when they reference device drivers that are listed in UPDATING. Obtained from: //depot/projects/mpsafetty/... Approved by: philip (ex-mentor) Discussed: on the lists, at BSDCan, at the DevSummit Sponsored by: Snow B.V., the Netherlands dcons(4) fixed by: kan
* Fix a small typo in the procstat(1) manpage: messsage queue.ed2008-07-281-1/+1
| | | | | Approved by: philip (mentor) MFC after: 3 days
* Rework the lifetime management of the kernel implementation of POSIXjhb2008-06-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | semaphores. Specifically, semaphores are now represented as new file descriptor type that is set to close on exec. This removes the need for all of the manual process reference counting (and fork, exec, and exit event handlers) as the normal file descriptor operations handle all of that for us nicely. It is also suggested as one possible implementation in the spec and at least one other OS (OS X) uses this approach. Some bugs that were fixed as a result include: - References to a named semaphore whose name is removed still work after the sem_unlink() operation. Prior to this patch, if a semaphore's name was removed, valid handles from sem_open() would get EINVAL errors from sem_getvalue(), sem_post(), etc. This fixes that. - Unnamed semaphores created with sem_init() were not cleaned up when a process exited or exec'd. They were only cleaned up if the process did an explicit sem_destroy(). This could result in a leak of semaphore objects that could never be cleaned up. - On the other hand, if another process guessed the id (kernel pointer to 'struct ksem' of an unnamed semaphore (created via sem_init)) and had write access to the semaphore based on UID/GID checks, then that other process could manipulate the semaphore via sem_destroy(), sem_post(), sem_wait(), etc. - As part of the permission check (UID/GID), the umask of the proces creating the semaphore was not honored. Thus if your umask denied group read/write access but the explicit mode in the sem_init() call allowed it, the semaphore would be readable/writable by other users in the same group, for example. This includes access via the previous bug. - If the module refused to unload because there were active semaphores, then it might have deregistered one or more of the semaphore system calls before it noticed that there was a problem. I'm not sure if this actually happened as the order that modules are discovered by the kernel linker depends on how the actual .ko file is linked. One can make the order deterministic by using a single module with a mod_event handler that explicitly registers syscalls (and deregisters during unload after any checks). This also fixes a race where even if the sem_module unloaded first it would have destroyed locks that the syscalls might be trying to access if they are still executing when they are unloaded. XXX: By the way, deregistering system calls doesn't do any blocking to drain any threads from the calls. - Some minor fixes to errno values on error. For example, sem_init() isn't documented to return ENFILE or EMFILE if we run out of semaphores the way that sem_open() can. Instead, it should return ENOSPC in that case. Other changes: - Kernel semaphores now use a hash table to manage the namespace of named semaphores nearly in a similar fashion to the POSIX shared memory object file descriptors. Kernel semaphores can now also have names longer than 14 chars (up to MAXPATHLEN) and can include subdirectories in their pathname. - The UID/GID permission checks for access to a named semaphore are now done via vaccess() rather than a home-rolled set of checks. - Now that kernel semaphores have an associated file object, the various MAC checks for POSIX semaphores accept both a file credential and an active credential. There is also a new posixsem_check_stat() since it is possible to fstat() a semaphore file descriptor. - A small set of regression tests (using the ksem API directly) is present in src/tools/regression/posixsem. Reported by: kris (1) Tested by: kris Reviewed by: rwatson (lightly) MFC after: 1 month
* Use ddb(4), not DDB(4) for man page cross-references.rwatson2008-04-211-1/+1
| | | | | MFC after: 3 days Reported by: novel
* Provide more detailed information about each procstat(1) display mode,rwatson2008-04-191-7/+248
| | | | | | | including a key to fields in each mode and flag abbreviations. MFC after: 3 days X-MFC-note: POSIX shared memory memory objects aren't in 7-STABLE yet
* It is a bug that procstat(8) works only on live kernels and not crashdumps;rwatson2008-04-191-0/+4
| | | | | | document in case anyone wants to work on fixing this. MFC after: 3 days
* Add support for displaying a process' current working directory, rootmarcus2008-02-091-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | directory, and jail directory within procstat. While this functionality is available already in fstat, encapsulating it in the kern.proc.filedesc sysctl makes it accessible without using kvm and thus without needing elevated permissions. The new procstat output looks like: PID COMM FD T V FLAGS REF OFFSET PRO NAME 76792 tcsh cwd v d -------- - - - /usr/src 76792 tcsh root v d -------- - - - / 76792 tcsh 15 v c rw------ 16 9130 - - 76792 tcsh 16 v c rw------ 16 9130 - - 76792 tcsh 17 v c rw------ 16 9130 - - 76792 tcsh 18 v c rw------ 16 9130 - - 76792 tcsh 19 v c rw------ 16 9130 - - I am also bumping __FreeBSD_version for this as this new feature will be used in at least one port. Reviewed by: rwatson Approved by: rwatson
* WARNS fixes: mainly constness and avoid comparing signed withdwmalone2008-02-086-14/+19
| | | | | unsigned by making array indicies unsigned. Also note one or two unused parameters.
* When printing process file descriptor lists, show a type of 'h' forrwatson2008-01-201-0/+4
| | | | POSIX shared memory descriptors.
* Add 'COMM' column to a few more output modes of procstat(1). The onlyrwatson2007-12-104-20/+29
| | | | | one it's missing from is the VM display, where there's really not room, and the file output display is looking quite cramped.
* Display per-thread command line in TDNAME field for -k and -t; ifrwatson2007-12-032-21/+71
| | | | | | | | | no per-thread name is available or the name is identical to the process name, display "-" instead. Very slightly shrink the COMM entry to make a bit more room, although this doesn't help with stack traces much. Suggested by: thompsa
* Add procstat(1), a process inspection utility. This provides both somerwatson2007-12-0212-0/+1459
of the missing functionality from procfs(4) and new functionality for monitoring and debugging specific processes. procstat(1) operates in the following modes: -b Display binary information for the process. -c Display command line arguments for the process. -f Display file descriptor information for the process. -k Display the stacks of kernel threads in the process. -s Display security credential information for the process. -t Display thread information for the process. -v Display virtual memory mappings for the process. Further revision and modes are expected. Testing, ideas, etc: cognet, sam, Skip Ford <skip at menantico dot com> Wesley Shields <wxs at atarininja dot org>
OpenPOWER on IntegriCloud