summaryrefslogtreecommitdiffstats
path: root/openbsd/OpenBSDProcess.c
Commit message (Collapse)AuthorAgeFilesLines
* Work around GCC14 memleak diagnosticBenny Baumann2024-04-081-1/+1
| | | | | While both pointers are identical, GCC-14 with -fanalyzer complains about these return statements to leak memory. The leak is only reported with LTO though.
* Introduce autoTitleRightAlign column flagChristian Göttsche2024-03-271-0/+1
| | | | | | Instead of handling PERCENT_CPU as a special case for whether to align the title of a dynamically sized column to the right or the left introduce a new flag, which can be reused by other columns.
* Use consistent style for process field output/compare functionsBenny Baumann2023-12-261-4/+6
|
* Add includes for config.h as per the discussion in PR #1337Daniel Lange2023-12-261-0/+2
| | | | | | Many thanks to @Explorer09 Kang-Che Sung (宋岡哲). Also add a #error stanza to XUtils.h in case somebody forgets the beautiful mess GNU forces on us.
* Introduce Row and Table classes for screens beyond top-processesNathan Scott2023-08-301-7/+15
| | | | | | | | | This commit refactors the Process and ProcessList structures such they each have a new parent - Row and Table, respectively. These new classes handle screen updates relating to anything that could be represented in tabular format, e.g. cgroups, filesystems, etc, without us having to reimplement the display logic repeatedly for each new entity.
* Introduce Machine class for host-specific info (split from ProcessList)Nathan Scott2023-05-081-2/+2
| | | | | | | | | | | First stage in sanitizing the process list structure so that htop can support other types of lists too (cgroups, filesystems, ...), in the not-too-distant future. This introduces struct Machine for system-wide information while keeping process-list information in ProcessList (now much less). Next step is to propogate this separation into each platform, to match these core changes.
* Process: Display single digit precision for CPU% greater than 99.9%Kumar2022-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | Since commit edf319e[1], we're dynamically adjusting column width of "CPU%", showing single digit precision also for values greater than "99.9%" makes "CPU%" column consistent with all other values. [1]: edf319e53d1fb77546505e238d75160a3febe56e Change "Process_printPercentage()" function's logic to always display value (i.e. "val") with single precision. Except when value is greater than "99.9%" for columns like "MEM%", whose width is fixed to "4" and value cannot go beyond "100%". Credits: @Explorer09, thanks for the patch[2] to fix title alignment issue. [2]: https://github.com/htop-dev/htop/pull/959#issuecomment-1092480951 Closes: #957
* Auto-size (normalized) CPU usage columnsBenny Baumann2022-03-061-0/+2
|
* Correct the order of xCalloc parameters in a couple of placesNathan Scott2021-11-051-1/+1
| | | | No functional change. Thanks to @BenBE for pointing these out.
* 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.
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* OpenBSD: Implement CWD columnBenny Baumann2021-05-251-0/+6
|
* Add ELAPSED process columnChristian Göttsche2021-05-231-0/+6
| | | | | | | | | 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
* OpenBSD: add COMM column and use merged command line helpersChristian Göttsche2021-05-231-0/+7
|
* Move kernel/userland thread handling to platform-independent implementationBenny Baumann2021-05-231-4/+0
|
* platform-dependent files included relative to main source directorymayurdahibhate2021-05-101-1/+1
|
* Rework TTY columnChristian Göttsche2021-04-141-3/+3
| | | | | | | | | | * 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.
* Sort out the mess around column sorting that had accumulated over timeDaniel Lange2021-01-211-0/+8
|
* 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().
* Merge Process_pidColumns into Process_fields and rework auto-fit for ↵Christian Göttsche2020-12-191-17/+13
| | | | PID-like columns
* Rework enum ProcessFieldChristian Göttsche2020-12-191-8/+2
| | | | | | Use only one enum instead of a global and a platform specific one. Drop Platform_numberOfFields global variable. Set known size of Process_fields array
* Split boilerplate and platform-independent field comparisonBenny Baumann2020-12-191-1/+1
| | | | | | | | This acheives two things: - Allows for simple tie-breaking if values compare equal (needed to make sorting the tree-view stable) - Allows for platform-dependent overriding of the sort-order for specific fields Also fixes a small oversight on DragonFlyBSD when default-sorting.
* Invert Process_compare resolution so that superclass matches run firstHisham Muhammad2020-12-191-14/+7
| | | | | | | | | | * This removes duplicated code that adjusts the sort direction from every OS-specific folder. * Most fields in a regular htop screen are OS-independent, so trying Process_compare first and only falling back to the OS-specific compareByKey function if it's an OS-specific field makes sense. * This will allow us to override the sortKey in a global way without having to edit each OS-specific file.
* Split RichString_(append|appendn|write) into wide and asciiChristian Göttsche2020-12-081-1/+1
| | | | | | | | RichString_writeFrom takes a top spot during performance analysis due to the calls to mbstowcs() and iswprint(). Most of the time we know in advance that we are only going to print regular ASCII characters.
* OpenBSD updateChristian Göttsche2020-12-061-20/+22
| | | | | | - compilation failures like `return &this->this;` -> `return &this->super;` - iwyu update - misc cleanup
* Rename virtual memory column from M_SIZE to M_VIRTChristian Göttsche2020-11-211-2/+2
| | | | Closes: #325
* Add process column for normalized CPU usageChristian Göttsche2020-11-161-0/+6
| | | | Shows the process CPU usage divided by the number of CPU cores
* Introduce spaceship comparison for ProcessesChristian Göttsche2020-11-151-0/+2
| | | | | | | | | | | | | | | If currently two unsigned values are compared via `a - b`, in the case b is actually bigger than a, the result will not be an negative number (as -1 is expected) but a huge positive number as the subtraction is an unsigned subtraction. Avoid over-/underflow affected operations; use comparisons. Modern compilers will generate sane code, like: xor eax, eax cmp rdi, rsi seta al sbb eax, 0 ret
* Whitespace and indentation issuesBenny Baumann2020-11-021-25/+50
|
* Hold only a const version of Settings in ProcessChristian Göttsche2020-10-261-2/+2
|
* Mark process parameter of Process_writeField consistently constChristian Göttsche2020-10-261-2/+2
|
* Mark remaining classes constChristian Göttsche2020-10-131-1/+1
|
* Mark process argument of Process_isThread constChristian Göttsche2020-10-091-1/+1
|
* Enable -Wcast-qual compiler warningChristian Göttsche2020-10-061-6/+6
|
* Update License consistently to GPLv2 as per COPYING fileDaniel Lange2020-10-051-1/+1
|
* Axe automated header generation.Zev Weiss2020-09-031-20/+0
| | | | | | | | | | | | | | Reasoning: - implementation was unsound -- broke down when I added a fairly basic macro definition expanding to a struct initializer in a *.c file. - made it way too easy (e.g. via otherwise totally innocuous git commands) to end up with timestamps such that it always ran MakeHeader.py but never used its output, leading to overbuild noise when running what should be a null 'make'. - but mostly: it's just an awkward way of dealing with C code.
* Widen ST_UID (UID) column to 5 chars to allow UIDs > 9999 without breaking ↵Daniel Lange2018-10-071-1/+1
| | | | | | alignment Issue Github #841, Debian bug #910492
* Interpret TTY_NR column on Linux,Hisham2016-10-011-1/+1
| | | | | translate dev_t to major:minor on other platforms. Closes #316.
* Check for failure in allocations.Hisham2016-02-021-1/+1
|
* Change some tabs to three spacesMichael McConville2015-09-191-100/+100
|
* (Very) initial working OpenBSD portMichael McConville2015-09-181-0/+234

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