summaryrefslogtreecommitdiffstats
path: root/Row.c
Commit message (Collapse)AuthorAgeFilesLines
* Drop return at end of function returning voidChristian Göttsche2024-04-081-1/+0
|
* Row_printNanoseconds fixesChristian Göttsche2024-04-081-1/+2
| | | | | | Don't print twice for 0.9s. Don't truncate on 1.2s, leading to an abort.
* New Row_printNanoseconds() functionExplorer092024-04-051-0/+51
| | | | | | | | | It prints the time in one of these formats: nanoseconds, "fraction of seconds", "minutes + seconds + milliseconds". If the total time is greater than 10 minutes, it uses Row_printTime() to print higher time units. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Simplify string formattingChristian Göttsche2024-03-281-2/+1
| | | | | | | Just call RichString_appendAscii() with the fixed string and avoid an superfluous snprintf() formatting. Suggested-by: Explorer09
* Short circuit zero time in Row_printTime()Christian Göttsche2024-03-271-0/+8
| | | | Bail out early if the passed time is 0 and shadow the result.
* 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.
* TypoBenny Baumann2024-03-221-1/+1
|
* Check for sufficient buffer space only after clampingBenny Baumann2024-03-221-2/+3
| | | | The clamping itself has a sanity check when debug mode is active.
* Check width in Row_printPercentage()Christian Göttsche2024-03-201-0/+4
| | | | | | | | | | The passed width should always be at least 4, otherwise printing will always truncate and lead to an abort(). The passed should not be greater or equal to the available buffer size, otherwise printing will always truncate and lead to an abort(). Add fallback for non debug builds.
* Row_printTime() code shrinkExplorer092023-12-291-7/+7
| | | | Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Row_printKBytes() improvementsExplorer092023-12-291-74/+96
| | | | | | | | | | * Allow the maximum value of "15.9Z" ((2^64 - 2) KiB) to be printed. (The previous version supports the maximum of "99.9P" (99.9 PiB) before the printing format goes weird.) * Print up to 2 fraction digits for values between "9.76G" (10000 MiB) and "9.99G" (< 10 GiB), "9.76T" and "9.99T", and so on. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Update includes based on IWYUBenny Baumann2023-12-261-3/+4
|
* Rewrite Row_printTime() with various improvementsExplorer092023-11-101-67/+50
| | | | | | | | | | | | | | | | | | * Change variable types of time values from signed to unsigned. * Change variable naming for consistency: `totalMinutes`, `totalHours`, `totalDays` for total values and `minutes`, `hours`, `days`, etc. for remainder values. (`years` remains an exception as there is no larger unit than years) * Use `unsigned long long` type for `years` value to prevent a potential overflow. * The time units are now evaluated from small to large, in the hopes that small values would print faster. (There is no performance test for this claim.) * The days unit is now printed when `totalHours` is at least 24. (Issue htop-dev#1317) There is room in the new code to revert to the old threshold (totalHours < 2400). Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Support dynamic screens with 'top-most' entities beyond processesSohaib Mohamed2023-08-301-7/+12
| | | | | | | | | | | | | | | | | | | | | | This implements our concept of 'dynamic screens' in htop, with a first use-case of pcp-htop displaying things like top-filesystem and top-cgroups under new screen tabs. However the idea is more general than use in pcp-htop and we've paved the way here for us to collectively build mroe general tabular screens in core htop, as well. From the pcp-htop side of things, dynamic screens are configured using text-based configuration files that define the mapping for PCP metrics to columns (and metric instances to rows). Metrics are defined either directly (via metric names) or indirectly via PCP derived metric specifications. Value scaling and the units displayed is automatic based on PCP metric units and data types. This commit represents a collaborative effort of several months, primarily between myself, Nathan and BenBE. Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com> Signed-off-by: Nathan Scott <nathans@redhat.com>
* Introduce Row and Table classes for screens beyond top-processesNathan Scott2023-08-301-0/+486
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.

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