summaryrefslogtreecommitdiffstats
path: root/Process.c
Commit message (Collapse)AuthorAgeFilesLines
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* Process_printPercentage using one color transitionNathan Scott2021-09-141-1/+1
| | | Update Process_printPercentage such that color change happens only once at 100% and beyond.
* Highlight large percentages similar to large memory columnsBenny Baumann2021-09-051-0/+2
|
* Add a Process_printPercentage helper routineHisham Muhammad2021-09-051-25/+22
| | | | | Replace several open-coded variants of percentage formatting. This function has been ported from Hishams old 'next' branch.
* NetBSD: color process state P as runningChristian Göttsche2021-09-031-1/+5
| | | | | | On NetBSD state 'R' means runnable not running. Improve the color identifier name accordingly.
* Use break inside loop with false conditionChristian Göttsche2021-08-221-1/+1
| | | | | | | | | | | Found by clang-tidy. home/christian/Coding/workspaces/htop/Process.c:505:13: warning: 'continue' in loop with false condition is equivalent to 'break' [bugprone-terminating-continue] WRITE_HIGHLIGHT(0, strlen(procComm), commAttr, CMDLINE_HIGHLIGHT_FLAG_COMM); ^ /home/christian/Coding/workspaces/htop/Process.c:461:13: note: expanded from macro 'WRITE_HIGHLIGHT' continue; \ ^
* Respect "Show custom thread names" setting updateChristian Göttsche2021-08-141-6/+6
| | | | | | | Update merged command-line when started with "Show custom thread names" disabled and enabling at runtime. Also only consider showThreadNames when working on userland threads.
* PCP: support for 'dynamic columns' added at runtimeSohaib Mohamed2021-08-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements support for arbitrary Performance Co-Pilot metrics with per-process instance domains to form new htop columns. The column-to-metric mappings are setup using configuration files which will be documented via man pages as part of a follow-up commit. We provide an initial set of column configurations so as to provide new capabilities to pcp-htop: including configs for containers, open fd counts, scheduler run queue time, tcp/udp bytes/calls sent/recv, delay acct, virtual machine guests, detailed virtual memory, swap. Note there is a change to the configuration file path resolution algorithm introduced for 'dynamic meters'. First, look in any custom PCP_HTOP_DIR location. Then iterate, in priority order, users home directory, then local sysadmins files in /etc/pcp/htop, then readonly configuration files below /usr/share/pcp/htop. This final location becomes the preferred place for our own shipped meter and column files. The Settings file (htoprc) writing code is updated to not using the numeric identifier for dynamic columns. The same strategy used for dynamic meters is used here where we write Dynamic(name) so the name can be setup once more at start. Regular (static) columns writing to htoprc - i.e. numerically indexed - is unchanged.
* Merge branch 'cpu_count' of cgzones/htopDaniel Lange2021-08-021-1/+1
|\
| * Rework CPU countingChristian Göttsche2021-07-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | Currently htop does not support offline CPUs and hot-swapping, e.g. via echo 0 > /sys/devices/system/cpu/cpu2/online Split the current single cpuCount variable into activeCPUs and existingCPUs. Supersedes: #650 Related: #580
* | Respect "Show custom thread names" settingBenny Baumann2021-07-171-5/+8
|/
* Pointer indication aligned to typenameBenny Baumann2021-07-151-25/+25
|
* Whitespace around operatorsBenny Baumann2021-07-151-16/+16
|
* Code indentationBenny Baumann2021-07-151-8/+8
|
* Apply stale lib highlighting for EXE tooBenny Baumann2021-06-111-2/+6
|
* Linux: update process uid on changeChristian Göttsche2021-06-091-0/+1
| | | | Always check if the user of a process changed, e.g. by using setuid(2).
* Check processes for using deleted shared librariesChristian Göttsche2021-06-091-3/+8
| | | | | | | | | Shared libraries can be replaced by an upgrade, highlight processes using deleted shared libraries. Link with highlightDeletedExe setting, enabled by default. Currently only checked on Linux.
* Move CWD field handling to platform-neutral codeBenny Baumann2021-05-251-0/+17
|
* Linux: add reset to heuristicChristian Göttsche2021-05-251-1/+1
| | | | | | On hard to parse command lines tokenStart might be computed to be bigger than tokenEnd. Reset both values in such cases.
* Add ELAPSED process columnChristian Göttsche2021-05-231-0/+4
| | | | | | | | | 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
* Allow for highlighting of deleted executables to be configuredBenny Baumann2021-05-231-2/+2
| | | | Fixes #383
* Process: add convenience helper functions to update merged command line ↵Christian Göttsche2021-05-231-0/+71
| | | | related data
* Drop mc->maxLen fieldBenny Baumann2021-05-231-1/+6
|
* Reduce code duplication for nearly identical code-pathsBenny Baumann2021-05-231-7/+3
|
* Properly brace macro argumentsBenny Baumann2021-05-231-17/+17
|
* Move PROC_COMM/PROC_EXE column handling to global Process implementationBenny Baumann2021-05-231-0/+41
|
* Call makeCommandStr on all platformsBenny Baumann2021-05-231-0/+11
|
* Move Process_makeCommandStr to global Process implementationBenny Baumann2021-05-231-22/+376
|
* Move LinuxProcess_getCommandStr to Process_getCommandStrBenny Baumann2021-05-231-2/+9
|
* Move mergeCommand to global process structBenny Baumann2021-05-231-0/+1
|
* Rename cmdlineBasenameOffset to cmdlineBasenameEnd to properly indicate the ↵Benny Baumann2021-05-231-3/+3
| | | | fields purpose
* Rename basenameOffset to cmdlineBasenameOffsetBenny Baumann2021-05-231-3/+3
|
* Move procComm and procExe to main Process structureBenny Baumann2021-05-231-0/+2
|
* Rename command line field from comm to cmdlineBenny Baumann2021-05-231-7/+7
|
* cleaned up includes with iwyumayurdahibhate2021-05-101-2/+1
|
* Rework process field print functionsChristian Göttsche2021-04-261-33/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Process: 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: - TTY
* Add assert for unreachable switch caseChristian Göttsche2021-04-211-1/+2
| | | | Like the default case in Process_writeField()
* Rework TTY columnChristian Göttsche2021-04-141-9/+9
| | | | | | | | | | * 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.
* Add read-only optionChristian Göttsche2021-04-141-0/+3
| | | | | Add command line option to disable all system and process changing features.
* Convert process time to days if applicableDavid Zarzycki2021-04-101-1/+5
| | | | With big multicore machines, it's easy to accumulate process time.
* Request the realtime and monotonic clock times once per sampleNathan Scott2021-04-051-3/+3
| | | | | | | | | | | | | | | | Refactor the sample time code to make one call to gettimeofday (aka the realtime clock in clock_gettime, when available) and one to the monotonic clock. Stores each in more appropriately named ProcessList fields for ready access when needed. Every platform gets the opportunity to provide their own clock code, and the existing Mac OS X specific code is moved below darwin instead of in Compat. A couple of leftover time(2) calls are converted to use these ProcessList fields as well, instead of yet again sampling the system clock. Related to https://github.com/htop-dev/htop/pull/574
* RichString: do not unnecessarily clean whole bufferChristian Göttsche2021-03-171-1/+0
| | | | | | | The local stack buffer does not need to be cleaned to zeros when - just initialized, cause the length is set to 0 and the first character is set to '\0', so all printing functions will safely stop - no further used, i.e. the variable goes out of scope
* Process: do not access RichString internalsChristian Göttsche2021-03-121-1/+1
| | | | Use wrapper macro to encapsulate the RichString structure
* Process_compare: reorder checksChristian Göttsche2021-03-121-4/+1
| | | | | Check for result being 0 first, before checking if the result might be negated, so we do not need to negate 0.
* Use uppercase floating point literal suffixChristian Göttsche2021-03-021-5/+5
|
* Refactor to remove no-op callsBenny Baumann2021-02-171-6/+2
| | | | This removes the call-sites of the removed setuid feature
* Linux: overhaul io process fieldsChristian Göttsche2021-01-301-9/+8
| | | | | | | | - 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
* Update generic process field displayChristian Göttsche2021-01-301-83/+93
| | | | | | | | | | - sort cases by identifier - use check snprintf - color nice value of 0 as gray - color cpu and memory percentages of 0.0 as gray - color number of threads of 1 as gray - color idle and sleeping state as gray - color tgid matching pid (indicating main thread) as gray
* Overhaul sorting of state process columnChristian Göttsche2021-01-301-1/+39
| | | | Do not sort by ascii value of the state identifier, sort by relevance

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