summaryrefslogtreecommitdiffstats
path: root/CPUMeter.c
AgeCommit message (Collapse)Author
2020-08-20Merge branch 'hishamhm-pull-1012'Nathan Scott
2020-08-20Merge branch 'hishamhm-pull-932'Nathan Scott
2020-08-20Merge branch 'hishamhm-pull-960'Nathan Scott
2020-08-20Merge branch 'hishamhm-pull-914'Nathan Scott
2020-06-12fixed x/y coordinate mixupChristoph Budziszewski
2020-06-11adding support for more than 2 smaller cpumeter columnsChristoph Budziszewski
2020-06-11removed whitespace from end of linesChristoph Budziszewski
2019-10-31Clean up existing whitespaceDaniel Flanagan
2019-08-10Move sysfs-reading code to LinuxProcessList.c and add average frequency.Arnavion
This way the frequency is read from sysfs only once per update cycle instead of every time the UI is redrawn. This also changes the code to read from /proc/cpuinfo instead. This is because reading from scaling_cur_freq stalls for 10ms if the previous read for the file was more than one second ago. [1] Since htop's update cycle is longer than that, it would cause the read of each CPU's scaling_cur_freq file to block the UI for 20ms. This easily led to a noticeable half-second lag on a 20+ CPU machine. /proc/cpuinfo also has a 10ms delay, but this applies for the whole file so the delay does not scale with the number of CPUs. [2] [1]: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4815d3c56d1e10449a44089a47544d9ba84fad0d [2]: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7d5905dc14a87805a59f3c5bf70173aac2bb18f8
2019-08-10Fix typo.Arnavion
2019-08-10Show N/A instead of 0KHz when CPU frequency is not available.Arnavion
2019-08-10Add a display option to hide CPU usage number from CPU meter.Arnavion
2019-08-09Divide by 1000, not 1024, and show more decimals.Arnavion
2019-08-09Add new display option to also show CPU frequency in CPU meters.Arnavion
The option is only implemented on Linux. On other platforms, and on Linuxes that do not expose the relevant sysfs file, the frequency will be 0. The "CPU average" meter does not show a frequency, only the individual per-CPU meters.
2019-05-26CPU_KERNEL redefinedsenjan
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.
2016-02-02Check for failure in allocations.Hisham
2015-10-23Calculate CPU averages on Darwin (See #295).Hisham Muhammad
2015-08-27remove extra space in dual meters without marginsChristian Hesse
2015-02-03Add longer descriptions to available meters.Hisham Muhammad
2015-01-21Sorry about the mega-patch.Hisham Muhammad
This is a work-in-progress, code is currently broken. (Some actions, and notably, the header, are missing.)
2014-04-24Make blue text more readable. Closes #55.Hisham Muhammad
2014-01-16Fix order of calloc arguments.Hisham Muhammad
(Patch by Dawid Gajownik)
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-12-18Make CPU meter optionally account guest time in its percentagesHisham Muhammad
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-11-18Mega-commit with features and tweaks for 1.0:Hisham Muhammad
* Performance improvements * Support for splitting CPU meters into two or four columns (thanks to Wim Heirman) * Switch from PLPA, which is now deprecated, to HWLOC. * Bring back support for native Linux sched_setaffinity, so we don't have to use HWLOC where we don't need to. * Support for typing in user names and column fields in selection panels.
2011-09-08Fix off-by-one error in PROCESSOR displayHisham Muhammad
2011-09-08Realign display of text-mode CPU meters. Closes #3369526.Hisham Muhammad
2011-05-26Tempus fugit.Hisham Muhammad
2011-05-26fix broken height for All CPUs meterHisham Muhammad
2011-03-31retain meter state when it is reinit'ed in the Setup screenHisham Muhammad
2011-03-22* Option for counting CPUs from zeroHisham Muhammad
(thanks to Sean Noonan) * Meters update in every screen (no longer halting while on Setup, etc.)
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-08-24add support for steal/guest CPU time measurementHisham Muhammad
simplify processor data accounting (add CPUData structure) remove Process_clone trick
2010-06-30Fix display of nan% in CPU metersHisham Muhammad
(Fix by Steven Hampson)
2010-02-25Tempus fugit.Hisham Muhammad
2010-02-25never show nan%Hisham Muhammad
2009-06-02changes for htop 0.8.2Hisham Muhammad
2008-03-09Clean up headers by using 'static' whenever possible.Hisham Muhammad
Reduces resulting code size.
2007-11-09IO-wait time now counts as idle time, which is a moreHisham Muhammad
accurate description. It is still available in split time, now called detailed CPU time. (thanks to Samuel Thibault for the report)
2006-10-04Contribution by Philipp Richter: Display IO-Wait, IRQ and Soft-IRQ values in ↵Hisham Muhammad
status bar (minor modifications: default to false, add help)
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