summaryrefslogtreecommitdiffstats
path: root/linux/LinuxProcess.c
Commit message (Collapse)AuthorAgeFilesLines
* Auto-size (normalized) CPU usage columnsBenny Baumann2022-03-061-5/+5
|
* Linux: dynamically adjust column width of CGROUP C(ompressed)CGROUPChristian Göttsche2022-03-061-4/+4
|
* Linux: dynamically adjust the SECATTR column widthChristian Göttsche2022-03-061-2/+2
| | | | | | | | SELinux contexts can be quite long; adjust the column width dynamically at each cycle to the longest value. Also with the recent addition of multiple screens, over-long columns can be moved into their own screen.
* Compress cgroup names based on some heuristicsBenny Baumann2021-11-281-1/+6
|
* Ensure maximum width for CGROUP columnBenny Baumann2021-11-281-2/+2
|
* Dynamically scale the ST_UID size to support 32-bit UIDsSilke Hofstra2021-10-271-2/+2
| | | | | | | | | | | | | | | | | | While most Unix-like systems use 16-bit user IDs, Linux supports 32-bit UIDs since version 2.6. UIDs above 65535 are used for UID namespacing of containers, where a container has its own set of 16-bit user IDs. Processes in such containers will have (much) larger UIDs than 65535. Because the current format strings for `ST_UID` and `USER` are `%5d` and `%9d` respectively, processes with such UIDs lead to misaligned columns. Dynamically scale the `ST_UID` column and increase the size of `USER` to 10 characters (length of UINT32_MAX) to ensure that the user ID always fits. Additionally: clean up how the titlebuffer size calculation and ensure the PID column has a minimum size of 5.
* Fix Security Attributes column header widthLucas Werkmeister2021-10-201-2/+2
| | | | | | | | | Limit the maximum width (instead of only the minimum width), pad the header width accordingly, and also remove extra stray spaces from the format string (the main spacing should just come from the alignment of the value). Fixes #850.
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* Add a Process_printPercentage helper routineHisham Muhammad2021-09-051-19/+5
| | | | | Replace several open-coded variants of percentage formatting. This function has been ported from Hishams old 'next' branch.
* linux: color void delay accounting values grayChristian Göttsche2021-09-021-4/+8
| | | | | | Use the color gray, similar to other process fields, if the delay accounting value is either 0 (or very small) or cannot be accessed, e.g. by an unprivileged user.
* linux: drop dead process field column DIRTYChristian Göttsche2021-09-021-4/+0
| | | | | The field for dirty pages in /proc/[pid]/statm is always 0 since Linux 2.6 (see man:proc(5)).
* IWYU updateChristian Göttsche2021-08-251-2/+0
|
* Add columns for process autogroup identifier and nice valueNathan Scott2021-08-091-0/+56
| | | | | | | | | | | | Adds AGRP (autogroup) and ANI (autogroup nice) columns that report the information from /proc/PID/autogroup, as well as handlers for '{' and '}' to change the autogroup nice value. This is guarded by /proc/sys/kernel/sched_autogroup_enabled such that sampling and/or changing values wont be attempted unless the kernel feature is enabled. Fixes: #720
* Split statements that should go onto multiple linesBenny Baumann2021-07-151-1/+2
|
* Move CWD field handling to platform-neutral codeBenny Baumann2021-05-251-18/+1
|
* Add ELAPSED process columnChristian Göttsche2021-05-231-0/+1
| | | | | | | | | Add process columns showing the elapsed time since the process was started. Similar to STARTTIME, but shows the time passed since the process start instead of the fixed start time of the process. Closes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=782636
* Linux: drop obsolete code now in Process_writeFieldChristian Göttsche2021-05-231-54/+0
|
* Move PROC_COMM/PROC_EXE column handling to global Process implementationBenny Baumann2021-05-231-40/+0
|
* Move Process_makeCommandStr to global Process implementationBenny Baumann2021-05-231-354/+2
|
* Move LinuxProcess_getCommandStr to Process_getCommandStrBenny Baumann2021-05-231-12/+0
|
* Move kernel/userland thread handling to platform-independent implementationBenny Baumann2021-05-231-10/+6
|
* Move mergeCommand to global process structBenny Baumann2021-05-231-11/+8
|
* Rename cmdlineBasenameOffset to cmdlineBasenameEnd to properly indicate the ↵Benny Baumann2021-05-231-15/+15
| | | | fields purpose
* Move procCmdlineBasenameOffset as cmdlineBasenameStart to global Process ↵Benny Baumann2021-05-231-1/+1
| | | | structure
* Remove duplicate field LinuxProcess->procCmdlineBasenameEndBenny Baumann2021-05-231-1/+1
| | | | This field held practically the same value as cmdlineBasenameEnd
* Move procExeBasenameOffset to main Process structureBenny Baumann2021-05-231-5/+5
| | | | This drops procExeLen, as that field is implicit by strlen(Process->procExe)
* Move procExeDeleted flag to main Process structureBenny Baumann2021-05-231-3/+3
|
* Move procComm and procExe to main Process structureBenny Baumann2021-05-231-12/+10
|
* Rename command line field from comm to cmdlineBenny Baumann2021-05-231-2/+2
|
* Refactor makeCommandStrBenny Baumann2021-05-231-127/+109
|
* platform-dependent files included relative to main source directorymayurdahibhate2021-05-101-1/+2
|
* cleaned up includes with iwyumayurdahibhate2021-05-101-0/+1
|
* Linux: update IO fieldsChristian Göttsche2021-04-261-11/+11
| | | | | | | | | | | | | | - fix header width of IO_READ_RATE - save data in bytes (not kilobytes) to better compute rate - fix rate data: multiply with 1000 to compensate time difference in milliseconds - rename unit less variable now into realtimeMs - use Process_printBytes(..., data * pageSize, ...) instead of Process_printKBytes(..., data * pageSizeKB, ...) to avoid wrapper
* Rework process field print functionsChristian Göttsche2021-04-261-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make functions formatting data for a process field column less error prone, unify interfaces and improve some internals. * Process_printBytes - rename from Process_humanNumber - take number in bytes, not kilobytes - handle petabytes - increase buffer to avoid crashes when the passed value is ~ ULLONG_MAX * Process_printKBytes - add wrapper for Process_printBytes taking kilobytes keeping -1 as special value * Process_printCount - rename from Process_colorNumber * Process_printTime - add coloring parameter as other print functions - improve coloring and formatting for larger times * Process_printRate - rename from Process_outputRate - use local buffer instead of passed one; this function prints to the RichString after all
* LinuxProcess: print default buffer in asciiChristian Göttsche2021-04-261-1/+1
| | | | | | | | | | | | | `RichString_appendWide()` is more expensive than `RichString_appendAscii()` due to the calls to `mbstowcs(3)` and `iswprint(3)`. Use the latter to print the process field buffer by default. For the following fields this theoretically can corrupt the output: - SECATTR - CGROUP - CTID
* Rework TTY columnChristian Göttsche2021-04-141-10/+1
| | | | | | | | | | * Rename internal identifier from TTY_NR to just TTY * Unify column header on platforms * Use devname(3) on BSD derivate to show the actual terminal, simplifies current FreeBSD implementation. * Use 'unsigned long int' as id type, to fit dev_t on Linux. Only on Solaris the terminal path is not yet resolved.
* LinuxProcess: Drop dead assignmentChristian Göttsche2021-03-021-1/+1
| | | | | Modern compilers are very good at finding uninitialized paths, lets rely on them.
* Fix typo, align with man page, drop dotsDaniel Lange2021-02-021-2/+2
|
* DiD: Avoid negative cmdlineBasenameOffsetBenny Baumann2021-02-011-0/+3
|
* Linux: overhaul io process fieldsChristian Göttsche2021-01-301-16/+23
| | | | | | | | - avoid UBSAN conversions - print N/A on no data (i.e. as unprivileged user) - fix rate calculation to show bytes (instead of a thousandth) - print bytes as human number (i.e. 8MB) instead of 8388608 - stabilize sorting by adjusting NAN values to very tiny negative number
* Refactor to tty_nr process field displayChristian Göttsche2021-01-301-7/+6
| | | | | | | If no terminal name can be found, fall back to generic display method with major and minor device numbers. Print special value '(none)' in case both are zero.
* Implement stable tie-breaker and add more defaultSortDesc fields as per ↵Daniel Lange2021-01-221-24/+24
| | | | cgzones' suggestions, simplify Process_compare flow from BenBE
* Sort out the mess around column sorting that had accumulated over timeDaniel Lange2021-01-211-43/+43
|
* Linux: use correct column alignment for wide fieldsChristian Göttsche2021-01-111-12/+19
| | | | | | | This affects: - PROC_COMM, PROC_EXE and CWD on Linux - JAIL on FreeBSD and DragonFlyBSD - ZONE on Solaris
* RichString_setAttrn: refactor to take a length instead of a stop indexChristian Göttsche2021-01-101-9/+9
| | | | Fixes: #459
* Declare for loop variables inside the loopChristian Göttsche2021-01-061-2/+1
|
* Object: return int on comparisonChristian Göttsche2021-01-021-1/+1
| | | | | Comparisons do, due to the new introduced shaceship-comparisons, only return -1, 0, 1 or the result of strcmp().
* Only initialize and gather delay accounting data if a related column is enabledChristian Göttsche2021-01-011-3/+3
| | | | | Avoid creating and communicating over a netlink socket by default, which triggers cap_net_admin checks as root.
* Resolve clang-analyzer signed/unsigned comparison CI failureNathan Scott2020-12-221-2/+2
|
* DiD: Ensure string offsets are inside string boundariesBenny Baumann2020-12-211-0/+6
|

© 2014-2024 Faster IT GmbH | imprint | privacy policy