summaryrefslogtreecommitdiffstats
path: root/LoadAverageMeter.c
AgeCommit message (Collapse)Author
2023-12-26Update includes based on IWYUBenny Baumann
2023-12-26Add includes for config.h as per the discussion in PR #1337Daniel Lange
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.
2023-08-31Rename ProcessList to ProcessTable throughoutNathan Scott
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.
2023-05-08Introduce Machine class for host-specific info (split from ProcessList)Nathan Scott
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.
2021-09-22Update license headers to explicitly say GPLv2+Daniel Lange
2021-07-18Rework CPU countingChristian Göttsche
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
2021-05-10cleaned up includes with iwyumayurdahibhate
2021-04-26Use RichString_appendnAscii where possibleChristian Göttsche
`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.
2021-03-04Save text buffer in MeterChristian Göttsche
2020-12-26LoadMeter: dynamically adjust color and total of barChristian Göttsche
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
2020-12-08Split RichString_(append|appendn|write) into wide and asciiChristian Göttsche
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.
2020-12-06Use size_t as len type for Meter_UpdateValuesChristian Göttsche
Most of the time the parameter is passed to snprintf type functions
2020-10-18Make all required includes explicitBenny Baumann
Information as seen by IWYU 0.12 + clang 9 on Linux
2020-10-16Rename StringUtils.[ch] to XUtils.[ch]Benny Baumann
2020-10-16Move xAsprintf, xSnprintf and xStrdup to StringUtils.hBenny Baumann
2020-10-10Mark Object pointer to _display function constChristian Göttsche
2020-10-07Mark Object instances constChristian Göttsche
2020-10-06Drop redundant cast to same typeChristian Göttsche
2020-10-05Update License consistently to GPLv2 as per COPYING fileDaniel Lange
2020-09-29Covert Meter attributes to file-local constant arraysChristian Göttsche
2020-09-03Axe automated header generation.Zev Weiss
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.
2017-07-27Security review: check results of snprintf.Hisham Muhammad
Calls marked with xSnprintf shouldn't fail. Abort program cleanly if any of them does.
2016-12-29Replace all uses of sprintf with snprintfTomasz Kramkowski
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.
2016-05-04Rename Meter.setValues() functions to updateValues()Explorer09
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.
2016-03-11Explicit "maxItems" property of metersExplorer09
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.
2015-11-23Array entries have been oddly flipped here for years.Hisham Muhammad
2015-11-04match load averages desc. to what it actually showskaefer
2015-02-03Add longer descriptions to available meters.Hisham Muhammad
2014-11-27Isolate cross-platform code for load average.Hisham Muhammad
2014-01-16BUGFIX: Fix crash when adding meters and toggling detailed CPU time.Hisham Muhammad
See https://bugzilla.redhat.com/show_bug.cgi?id=987805 for details. (thanks to Dawid Gajownik for the detailed analysis!)
2013-02-26Remove explicit calls to curses.h in other filesHisham Muhammad
2012-12-05Changes in object model: separate class objects to store vtable. Also, nicer ↵Hisham Muhammad
UTF-8 display of big numbers.
2011-12-26Remove old memory debugging routines. We have Valgrind nowadays.Hisham Muhammad
2011-12-26major header cleanupHisham Muhammad
2011-10-25cleanups and fixes, thanks to cppcheck and gcc -WextraHisham Muhammad
2011-09-08sanity checksHisham Muhammad
2011-05-26Tempus fugit.Hisham Muhammad
2010-11-22Remove arbitrary limit from rich stringsHisham Muhammad
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
2010-02-25Tempus fugit.Hisham Muhammad
2010-02-25warning fixesHisham Muhammad
2008-03-09Clean up headers by using 'static' whenever possible.Hisham Muhammad
Reduces resulting code size.
2006-07-12Perform RichString operations by hand.Hisham Muhammad
Avoid unnecessary operations when processing entries on ProcessList.
2006-06-06Updates for new version of the MakeHeader.py script.Hisham Muhammad
2006-04-10- Overhaul meters implementation;Hisham Muhammad
- add AllCPUsMeter; - because of that, the new .htoprc is incompatible with previous released versions.
2006-03-04Initial import.Hisham Muhammad