summaryrefslogtreecommitdiffstats
path: root/TasksMeter.c
Commit message (Collapse)AuthorAgeFilesLines
* Update includes based on IWYUBenny Baumann2023-12-261-0/+1
|
* 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.
* Rename ProcessList to ProcessTable throughoutNathan Scott2023-08-311-8/+8
| | | | | | | | | | | | Following up with some discusson from a few months back, where it was proposed that ProcessTable is a better name. This data structure is definitely not a list ... if it was one-dimensional it'd be a set, but in practice it has much more in common with a two-dimensional table. The Process table is a familiar operating system concept for many people too so it resonates a little in that way as well.
* Introduce Row and Table classes for screens beyond top-processesNathan Scott2023-08-301-1/+2
| | | | | | | | | 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-4/+5
| | | | | | | | | | | 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.
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* TasksMeter: save some float castsExplorer092021-08-141-1/+1
| | | | Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* 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
* Use RichString_appendnAscii where possibleChristian Göttsche2021-04-261-8/+9
| | | | | | | | | | `RichString_appendnAscii()` avoids a `strlen(3)` call over ` RichString_appendAscii()`. Use the former where the length is available from a previous checked `snprintf(3)` call. Keep `RichString_appendAscii()` when passing a string literal and rely on compilers to optimize the `strlen(3)` call away.
* TaskMeter: always show number of threadsChristian Göttsche2021-03-311-27/+14
| | | | | | | | | | | Always show the number of kernel and userland threads, even when they are disabled to not be shown in the process list. The data is already available and might improve understanding the system utilization. Use a shadow color in case the kind of thread is hidden, else the normal meter one.
* Save text buffer in MeterChristian Göttsche2021-03-041-2/+2
|
* Split RichString_(append|appendn|write) into wide and asciiChristian Göttsche2020-12-081-10/+10
| | | | | | | | 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.
* Use size_t as len type for Meter_UpdateValuesChristian Göttsche2020-12-061-1/+1
| | | | Most of the time the parameter is passed to snprintf type functions
* Hold only a const version of the ProcessList in MetersChristian Göttsche2020-10-261-2/+2
|
* Make all required includes explicitBenny Baumann2020-10-181-1/+5
| | | | Information as seen by IWYU 0.12 + clang 9 on Linux
* Rename StringUtils.[ch] to XUtils.[ch]Benny Baumann2020-10-161-1/+1
|
* Move xAsprintf, xSnprintf and xStrdup to StringUtils.hBenny Baumann2020-10-161-1/+2
|
* Mark Object pointer to _display function constChristian Göttsche2020-10-101-3/+3
|
* Mark Object instances constChristian Göttsche2020-10-071-1/+1
|
* Update License consistently to GPLv2 as per COPYING fileDaniel Lange2020-10-051-1/+1
|
* Covert Meter attributes to file-local constant arraysChristian Göttsche2020-09-291-2/+5
|
* Consolidate repeated macro definitions into one headerNathan Scott2020-09-091-1/+1
| | | | | | | | The MIN, MAX, CLAMP, MINIMUM, and MAXIMUM macros appear throughout the codebase with many re-definitions. Make a single copy of each in a common header file, and use the BSD variants of MINIMUM/MAXIMUM due to conflicts in the system <sys/param.h> headers.
* Axe automated header generation.Zev Weiss2020-09-031-3/+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-960'Nathan Scott2020-08-201-3/+3
|\
| * Clean up existing whitespaceDaniel Flanagan2019-10-311-3/+3
| |
* | Merge branch 'hishamhm-pull-914'Nathan Scott2020-08-201-1/+1
|\ \ | |/ |/|
| * fixed Linux buildsenjan2019-05-301-1/+1
|/
* htop scans /proc to determine how many running tasks exist. Since thatLucas C. Villa Real2018-01-231-1/+1
| | | | | | | | | operation is not possible to be conducted in an atomic fashion, task scheduling effects can lead to a count greater than the number of actual processors; this is more easily noticed on machines with several CPUs and under heavy workload. This patch simply adds an upper bound on cpuCount to guarantee consistent reports of the number of running tasks at any given time.
* Security review: check results of snprintf.Hisham Muhammad2017-07-271-5/+5
| | | | | Calls marked with xSnprintf shouldn't fail. Abort program cleanly if any of them does.
* Replace all uses of sprintf with snprintfTomasz Kramkowski2016-12-291-4/+4
| | | | | | | | | | | | In all the cases where sprintf was being used within htop, snprintf could have been used. This patch replaces all uses of sprintf with snprintf which makes sure that if a buffer is too small to hold the resulting string, the string is simply cut short instead of causing a buffer overflow which leads to undefined behaviour. `sizeof(variable)` was used in these cases, as opposed to `sizeof variable` which is my personal preference because `sizeof(variable)` was already used in one way or another in other parts of the code.
* Rename Meter.setValues() functions to updateValues()Explorer092016-05-041-2/+2
| | | | | | | | | | | | Rationale (copied from htop issue #471): The function name "setValues" is misleading. For most OOP (object- oriented programming) contexts, setXXX functions mean they will change some member variables of an object into something specified in function arguments. But in the *Meter_setValues() case, the new values are not from the arguments, but from a hard-coded source. The caller is not supposed to change the values[] to anything it likes, but rather to "update" the values from the source. Hence, updateValues is a better name for this family of functions.
* Explicit "maxItems" property of metersExplorer092016-03-111-1/+1
| | | | | | | | | Two changes in this commit: - All meters now explicitly specify "maxItems" property, even for just 1 item. (Exception is "container" CPU meter classes, which use CUSTOM_METERMODE.) - "maxItems" being 0 is now allowed. This will let bar meters and graph meters render an empty meter.
* Major advances in FreeBSD port.Hisham Muhammad2015-03-161-1/+8
|
* Another mega-patch for the refactoring process.Hisham Muhammad2015-01-231-1/+4
| | | | | Kinda runs, but functionality from the original main loop is still missing. Patience.
* Sorry about the mega-patch.Hisham Muhammad2015-01-211-13/+15
| | | | | This is a work-in-progress, code is currently broken. (Some actions, and notably, the header, are missing.)
* BUGFIX: Fix crash when adding meters and toggling detailed CPU time.Hisham Muhammad2014-01-161-1/+0
| | | | | See https://bugzilla.redhat.com/show_bug.cgi?id=987805 for details. (thanks to Dawid Gajownik for the detailed analysis!)
* Changes in object model: separate class objects to store vtable. Also, nicer ↵Hisham Muhammad2012-12-051-3/+7
| | | | UTF-8 display of big numbers.
* Remove old memory debugging routines. We have Valgrind nowadays.Hisham Muhammad2011-12-261-1/+0
|
* major header cleanupHisham Muhammad2011-12-261-4/+5
|
* Tempus fugit.Hisham Muhammad2011-05-261-1/+1
|
* Split process and thread counts in tasks meterHisham Muhammad2010-11-231-4/+24
|
* Remove arbitrary limit from rich stringsHisham Muhammad2010-11-221-2/+1
| | | | | | | | | Fix subtree hiding Fix reading of CPU values in hidden threads Fix hiding of zombie processes as kernel threads Remove "debug proc" code Code cleanup in processElements
* Tempus fugit.Hisham Muhammad2010-02-251-1/+1
|
* Clean up headers by using 'static' whenever possible.Hisham Muhammad2008-03-091-14/+14
| | | | | Reduces resulting code size.
* Perform RichString operations by hand.Hisham Muhammad2006-07-121-1/+1
| | | | | Avoid unnecessary operations when processing entries on ProcessList.
* Updates for new version of the MakeHeader.py script.Hisham Muhammad2006-06-061-3/+3
|
* - Overhaul meters implementation;Hisham Muhammad2006-04-101-25/+18
| | | | | | - add AllCPUsMeter; - because of that, the new .htoprc is incompatible with previous released versions.
* Initial import.Hisham Muhammad2006-03-041-0/+56

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