summaryrefslogtreecommitdiffstats
path: root/freebsd/FreeBSDProcess.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-1/+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-2/+4
|
* 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-10/+17
| | | | | | | | | 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.
* Add support for scheduling policiesChristian Göttsche2023-02-051-0/+4
| | | | | | | | | | | | | Add a process column for scheduling policy to show the current scheduling policy of the process. Add a the ability to change the scheduling policy of a process via the key 'Y'. Currently implemented on Linux and FreeBSD only but should be portable, since sched_getscheduler(2) is part of POSIX.1-2001. Closes: #1161
* 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
* FreeBSD: free emulation stringChristian Göttsche2022-04-301-0/+1
|
* Auto-size (normalized) CPU usage columnsBenny Baumann2022-03-061-2/+2
|
* FreeBSD: Add support for showing process emulationJessica Clarke2022-01-161-0/+6
| | | | | | | | | This displays the same output as ps's -o emul, which is the system call emulation environment, or ABI, in use. This will typically be FreeBSD ELF32 or ELF64, but can also be Linux ELF32 or Linux ELF64 when running Linux binaries under FreeBSD's Linuxulator binary compatibility layer. The column width of 16 is chosen to match KI_EMULNAMELEN's value of 16, most of which is normally used up as FreeBSD ELF32/64 is 13 characters.
* 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
|
* FreeBSD: Implement CWD columnBenny Baumann2021-05-251-0/+1
|
* Add ELAPSED process columnChristian Göttsche2021-05-231-1/+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
* FreeBSD: add EXE and COMM columns and use merged command line helpersChristian Göttsche2021-05-231-0/+2
|
* 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-13/+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.
* FreeBSD: drop minflt and implement majfltChristian Göttsche2021-01-301-2/+1
|
* FreeBSD: simplify kernel thread logicChristian Göttsche2021-01-301-7/+1
|
* FreeBSD: miscChristian Göttsche2021-01-301-2/+3
|
* Sort out the mess around column sorting that had accumulated over timeDaniel Lange2021-01-211-9/+9
|
* Linux: use correct column alignment for wide fieldsChristian Göttsche2021-01-111-8/+3
| | | | | | | This affects: - PROC_COMM, PROC_EXE and CWD on Linux - JAIL on FreeBSD and DragonFlyBSD - ZONE on Solaris
* 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-20/+9
| | | | PID-like columns
* Rework enum ProcessFieldChristian Göttsche2020-12-191-4/+3
| | | | | | 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.
* Rename virtual memory column from M_SIZE to M_VIRTChristian Göttsche2020-11-211-1/+1
| | | | Closes: #325
* IWYU update (FreeBSD)Christian Goettsche2020-11-191-7/+6
|
* Add process column for normalized CPU usageChristian Göttsche2020-11-161-0/+1
| | | | Shows the process CPU usage divided by the number of CPU cores
* Introduce spaceship comparison for ProcessesChristian Göttsche2020-11-151-3/+5
| | | | | | | | | | | | | | | 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
* Embracing branchesBenny Baumann2020-11-021-2/+3
|
* Spacing around operatorsBenny Baumann2020-11-021-1/+1
|
* FreeBSD: update ProcessChristian Göttsche2020-10-291-13/+13
|
* FreeBSD: rework tty process columnChristian Goettsche2020-10-291-1/+15
|
* 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-3/+3
|
* Mark remaining classes constChristian Göttsche2020-10-131-1/+1
|
* Mark process argument of Process_isThread constChristian Göttsche2020-10-091-2/+2
|
* 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-27/+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.
* Merge branch 'hishamhm-pull-904'Nathan Scott2020-08-201-1/+1
|\
| * Truncate overwide jail names on BSD.Robert Crowston2019-04-171-1/+1
| |
* | 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
* Security review: check results of snprintf.Hisham Muhammad2017-07-271-2/+2
| | | | | Calls marked with xSnprintf shouldn't fail. Abort program cleanly if any of them does.
* Issue #502 fix SID colunm header widthKamyar Rasta2017-02-051-1/+1
|

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