summaryrefslogtreecommitdiffstats
path: root/LoadAverageMeter.c
Commit message (Collapse)AuthorAgeFilesLines
* Update includes based on IWYUBenny Baumann2023-12-261-1/+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-1/+1
| | | | | | | | | | | | 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 Machine class for host-specific info (split from ProcessList)Nathan Scott2023-05-081-6/+6
| | | | | | | | | | | 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
|
* Rework CPU countingChristian Göttsche2021-07-181-6/+6
| | | | | | | | | | | 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
* cleaned up includes with iwyumayurdahibhate2021-05-101-0/+1
|
* Use RichString_appendnAscii where possibleChristian Göttsche2021-04-261-8/+12
| | | | | | | | | | `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.
* Save text buffer in MeterChristian Göttsche2021-03-041-4/+4
|
* LoadMeter: dynamically adjust color and total of barChristian Göttsche2020-12-261-2/+40
| | | | | | | | | | Change the color and total based on the actual 1min load value: < 1 : green and total of 1.0 < cpu-count : yellow and total of cpu-count else : red and total of 2*cpu-count Closes: #32
* Split RichString_(append|appendn|write) into wide and asciiChristian Göttsche2020-12-081-4/+4
| | | | | | | | 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-2/+2
| | | | Most of the time the parameter is passed to snprintf type functions
* Make all required includes explicitBenny Baumann2020-10-181-0/+2
| | | | 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-0/+1
|
* Mark Object pointer to _display function constChristian Göttsche2020-10-101-4/+4
|
* Mark Object instances constChristian Göttsche2020-10-071-2/+2
|
* Drop redundant cast to same typeChristian Göttsche2020-10-061-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-3/+7
|
* 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.
* Security review: check results of snprintf.Hisham Muhammad2017-07-271-6/+6
| | | | | 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-4/+4
| | | | | | | | | | | | 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-0/+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.
* Array entries have been oddly flipped here for years.Hisham Muhammad2015-11-231-7/+7
|
* match load averages desc. to what it actually showskaefer2015-11-041-1/+1
|
* Add longer descriptions to available meters.Hisham Muhammad2015-02-031-0/+2
|
* Isolate cross-platform code for load average.Hisham Muhammad2014-11-271-17/+3
|
* BUGFIX: Fix crash when adding meters and toggling detailed CPU time.Hisham Muhammad2014-01-161-2/+1
| | | | | See https://bugzilla.redhat.com/show_bug.cgi?id=987805 for details. (thanks to Dawid Gajownik for the detailed analysis!)
* Remove explicit calls to curses.h in other filesHisham Muhammad2013-02-261-1/+0
|
* Changes in object model: separate class objects to store vtable. Also, nicer ↵Hisham Muhammad2012-12-051-6/+14
| | | | 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-3/+8
|
* cleanups and fixes, thanks to cppcheck and gcc -WextraHisham Muhammad2011-10-251-1/+1
|
* sanity checksHisham Muhammad2011-09-081-5/+8
|
* Tempus fugit.Hisham Muhammad2011-05-261-1/+1
|
* Remove arbitrary limit from rich stringsHisham Muhammad2010-11-221-4/+2
| | | | | | | | | 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
|
* warning fixesHisham Muhammad2010-02-251-3/+3
|
* Clean up headers by using 'static' whenever possible.Hisham Muhammad2008-03-091-28/+28
| | | | | Reduces resulting code size.
* Perform RichString operations by hand.Hisham Muhammad2006-07-121-2/+2
| | | | | Avoid unnecessary operations when processing entries on ProcessList.
* Updates for new version of the MakeHeader.py script.Hisham Muhammad2006-06-061-7/+4
|
* - Overhaul meters implementation;Hisham Muhammad2006-04-101-30/+49
| | | | | | - add AllCPUsMeter; - because of that, the new .htoprc is incompatible with previous released versions.
* Initial import.Hisham Muhammad2006-03-041-0/+71

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