summaryrefslogtreecommitdiffstats
path: root/Process.h
Commit message (Collapse)AuthorAgeFilesLines
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* Add a Process_printPercentage helper routineHisham Muhammad2021-09-051-0/+2
| | | | | Replace several open-coded variants of percentage formatting. This function has been ported from Hishams old 'next' branch.
* Process: drop unused merged-command bit fieldsChristian Göttsche2021-09-021-2/+0
|
* PCP: support for 'dynamic columns' added at runtimeSohaib Mohamed2021-08-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Respect "Show custom thread names" settingBenny Baumann2021-07-171-0/+1
|
* Pointer indication aligned to typenameBenny Baumann2021-07-151-11/+11
|
* Check processes for using deleted shared librariesChristian Göttsche2021-06-091-0/+3
| | | | | | | | | 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-1/+7
|
* 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
* Process: add convenience helper functions to update merged command line ↵Christian Göttsche2021-05-231-0/+4
| | | | related data
* Drop mc->maxLen fieldBenny Baumann2021-05-231-1/+0
|
* Move PROC_COMM/PROC_EXE column handling to global Process implementationBenny Baumann2021-05-231-0/+2
|
* Move Process_makeCommandStr to global Process implementationBenny Baumann2021-05-231-0/+6
|
* Move LinuxProcess_getCommandStr to Process_getCommandStrBenny Baumann2021-05-231-1/+4
|
* Move kernel/userland thread handling to platform-independent implementationBenny Baumann2021-05-231-1/+18
|
* Move mergeCommand to global process structBenny Baumann2021-05-231-0/+34
|
* Rename cmdlineBasenameOffset to cmdlineBasenameEnd to properly indicate the ↵Benny Baumann2021-05-231-2/+2
| | | | fields purpose
* Move procCmdlineBasenameOffset as cmdlineBasenameStart to global Process ↵Benny Baumann2021-05-231-0/+3
| | | | structure
* Move procExeBasenameOffset to main Process structureBenny Baumann2021-05-231-0/+3
| | | | This drops procExeLen, as that field is implicit by strlen(Process->procExe)
* Move procExeDeleted flag to main Process structureBenny Baumann2021-05-231-0/+3
|
* Rename basenameOffset to cmdlineBasenameOffsetBenny Baumann2021-05-231-3/+3
|
* Move procComm and procExe to main Process structureBenny Baumann2021-05-231-0/+6
|
* Process: Put the time field more to the endBenny Baumann2021-05-231-3/+3
|
* Rename command line field from comm to cmdlineBenny Baumann2021-05-231-2/+2
|
* Refactor makeCommandStrBenny Baumann2021-05-231-0/+5
|
* Rework process field print functionsChristian Göttsche2021-04-261-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rework TTY columnChristian Göttsche2021-04-141-6/+6
| | | | | | | | | | * 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.
* Request the realtime and monotonic clock times once per sampleNathan Scott2021-04-051-2/+2
| | | | | | | | | | | | | | | | 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
* Linux: silence UBSAN implicit conversionsChristian Göttsche2021-01-301-2/+2
| | | | | | | | | pgrp and session might be -1 linux/LinuxProcessList.c:312:20: runtime error: implicit conversion from type 'unsigned long' of value 18446744073709551615 (64-bit, unsigned) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned) SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior linux/LinuxProcessList.c:312:20 in linux/LinuxProcessList.c:314:23: runtime error: implicit conversion from type 'unsigned long' of value 18446744073709551615 (64-bit, unsigned) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned) SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior linux/LinuxProcessList.c:314:23 in
* Linux: overhaul io process fieldsChristian Göttsche2021-01-301-0/+4
| | | | | | | | - 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
* Overhaul sorting of state process columnChristian Göttsche2021-01-301-3/+0
| | | | Do not sort by ascii value of the state identifier, sort by relevance
* Process: document process fieldsChristian Göttsche2021-01-301-18/+105
| | | | Drop unused fields 'flags' and 'exit_signal'
* Sort out the mess around column sorting that had accumulated over timeDaniel Lange2021-01-211-0/+1
|
* Process: drop commLenChristian Göttsche2021-01-111-1/+0
| | | | | | | | It is only used on Linux to optimize memory handling in case the command changes to a smaller-or-equal string. This "optimization" however causes more code bloat and maintenance cost on string handling issues than it gains.
* Linux: use correct column alignment for wide fieldsChristian Göttsche2021-01-111-0/+2
| | | | | | | 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-4/+4
| | | | | 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-8/+4
| | | | PID-like columns
* Rework enum ProcessFieldChristian Göttsche2020-12-191-1/+7
| | | | | | 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/+3
| | | | | | | | 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-2/+5
| | | | | | | | | | * 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.
* Move macro definitions close to usageChristian Göttsche2020-12-161-4/+0
|
* Use common naming for bare enum typesChristian Göttsche2020-12-161-1/+1
|
* Use size_t as type for buffer length in ProcessChristian Göttsche2020-12-061-1/+1
|
* IWYU updateChristian Göttsche2020-12-061-1/+0
|
* Implement sorting in tree modeMaxim Zhiburt2020-12-021-0/+5
|
* Calculate library size (M_LRS column) from maps fileFynn Wulf2020-11-261-1/+3
|
* Fix crash when getCommandStr not overloaded for a platform processChristian Göttsche2020-11-261-1/+1
| | | | Closes: #343
* Cleanup some documentationNarendran Gopalakrishnan2020-11-241-1/+1
|
* Improving Command display/sortNarendran Gopalakrishnan2020-11-241-1/+5
|
* Rename virtual memory column from M_SIZE to M_VIRTChristian Göttsche2020-11-211-2/+2
| | | | Closes: #325

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