summaryrefslogtreecommitdiffstats
path: root/AvailableMetersPanel.c
Commit message (Collapse)AuthorAgeFilesLines
* Update includes based on IWYUBenny Baumann2023-12-261-0/+1
|
* Fix code styleBenny Baumann2023-12-261-4/+2
|
* 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.
* Introduce Machine class for host-specific info (split from ProcessList)Nathan Scott2023-05-081-10/+11
| | | | | | | | | | | 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.
* Refactor and consolidate dynamic meters/columns pointersNathan Scott2023-04-061-4/+5
| | | | | | | | This removes the duplication of dynamic meter/column hashtable pointers that has come in between the Settings and ProcessList structures - only one copy of these is needed. With the future planned dynamic screens feature adding another pointer, let us first clean this up before any further duplication happens.
* Reformat code baseBenny Baumann2022-10-241-1/+1
| | | | | | | | | | | | | | This includes: - Wrap function implementations - Pointer alignment for function signatures - Pointer alignment for variable declarations - Whitespace after keywords - Whitespace after comma - Whitespace around initializers - Whitespace around operators - Code indentation - Line break for single line statements - Misleading alignment
* Refactor code for rendering command line cacheBenny Baumann2022-05-311-0/+1
| | | | Fixes #1008
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* Add option to change Header layoutChristian Göttsche2021-08-221-9/+10
|
* ScreenManager: reduce ScreenManager_resizeChristian Göttsche2021-08-221-1/+1
| | | | | | | | | | | | | The main change is the header hight being not included in y1. This is important if a sub-manager gets resized, e.g. a resize while editing the Settings or in a pickFromVector selection, and afterwards, then the sub-manager is closed, the super-ScreenManager gets resized, it uses the correct header hight. The header hight might have been changed since the last resize of the super-manager in the Settings by adding/removing some meters. This fixes new meters being hidden after added at runtime after a resize in the main window.
* PCP: support for 'dynamic columns' added at runtimeSohaib Mohamed2021-08-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements support for arbitrary Performance Co-Pilot metrics with per-process instance domains to form new htop columns. The column-to-metric mappings are setup using configuration files which will be documented via man pages as part of a follow-up commit. We provide an initial set of column configurations so as to provide new capabilities to pcp-htop: including configs for containers, open fd counts, scheduler run queue time, tcp/udp bytes/calls sent/recv, delay acct, virtual machine guests, detailed virtual memory, swap. Note there is a change to the configuration file path resolution algorithm introduced for 'dynamic meters'. First, look in any custom PCP_HTOP_DIR location. Then iterate, in priority order, users home directory, then local sysadmins files in /etc/pcp/htop, then readonly configuration files below /usr/share/pcp/htop. This final location becomes the preferred place for our own shipped meter and column files. The Settings file (htoprc) writing code is updated to not using the numeric identifier for dynamic columns. The same strategy used for dynamic meters is used here where we write Dynamic(name) so the name can be setup once more at start. Regular (static) columns writing to htoprc - i.e. numerically indexed - is unchanged.
* Rework CPU countingChristian Göttsche2021-07-181-2/+2
| | | | | | | | | | | 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
* Pointer indication aligned to typenameBenny Baumann2021-07-151-1/+1
|
* Split statements that should go onto multiple linesBenny Baumann2021-07-151-1/+2
|
* Add a new DynamicMeter class for runtime Meter extensionNathan Scott2021-07-071-18/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is based on exploratory work by Sohaib Mohamed. The end goal is two-fold - to support addition of Meters we build via configuration files for both the PCP platform and for scripts ( https://github.com/htop-dev/htop/issues/526 ) Here, we focus on generic code and the PCP support. A new class DynamicMeter is introduced - it uses the special case 'param' field handling that previously was used only by the CPUMeter, such that every runtime-configured Meter is given a unique identifier. Unlike with the CPUMeter this is used internally only. When reading/writing to htoprc instead of CPU(N) - where N is an integer param (CPU number) - we use the string name for each meter. For example, if we have a configuration for a DynamicMeter for some Redis metrics, we might read and write "Dynamic(redis)". This identifier is subsequently matched (back) up to the configuration file so we're able to re-create arbitrary user configurations. The PCP platform configuration file format is fairly simple. We expand configs from several directories, including the users homedir alongside htoprc (below htop/meters/) and also /etc/pcp/htop/meters. The format will be described via a new pcp-htop(5) man page, but its basically ini-style and each Meter has one or more metric expressions associated, as well as specifications for labels, color and so on via a dot separated notation for individual metrics within the Meter. A few initial sample configuration files are provided below ./pcp/meters that give the general idea. The PCP "derived" metric specification - see pmRegisterDerived(3) - is used as the syntax for specifying metrics in PCP DynamicMeters.
* Fix bitmask used to extract CPU identifier for CPUMeterNathan Scott2021-07-071-1/+1
| | | | | | | When manipulating CPUMeters in the AvailableMeterPanel we use the bottom 16 bits to hold the CPU number. However, the bitmask used to extract the CPU number only masks the lower 8 bits (0xff).
* Use unsigned types for CPU counts and associated variablesChristian Göttsche2021-03-191-4/+4
|
* Separate data-update and drawing of headerChristian Göttsche2021-03-041-0/+1
|
* Mark several non-modified pointer variables constChristian Göttsche2021-01-111-1/+1
|
* Mark several non-modified pointer variables constChristian Göttsche2021-01-111-1/+1
|
* Rework drawing of FunctionBarChristian Göttsche2020-12-201-1/+0
| | | | | | | | | | | Draw the FunctionBar within Panel_draw instead of manually throughout the code. Add an optional PanelClass function drawFunctionBar, to allow specific panels to override the default FunctionBar_draw call. Rework the code on color change, to really change all colors (selection markers and panel headers). Closes: #402
* Update even more snprintfsChristian Göttsche2020-11-281-1/+1
| | | | Use size of actual buffers instead of magic numbers
* Make all required includes explicitBenny Baumann2020-10-181-4/+9
| | | | 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
|
* Add key to pause process list updatesChristian Göttsche2020-10-121-1/+1
|
* Mark Object instances constChristian Göttsche2020-10-071-4/+4
|
* Handle Panel_getSelected() returning NULLChristian Göttsche2020-10-061-1/+4
| | | | | | | | | | | | | | | | | | | | | Found by compiling with LTO: ColumnsPanel.c: In function ‘ColumnsPanel_eventHandler’: ColumnsPanel.c:46:59: error: potential null pointer dereference [-Werror=null-dereference] 46 | ((ListItem*)Panel_getSelected(super))->moving = this->moving; | ^ AvailableColumnsPanel.c: In function ‘AvailableColumnsPanel_eventHandler’: AvailableColumnsPanel.c:31:8: error: potential null pointer dereference [-Werror=null-dereference] 31 | int key = ((ListItem*) Panel_getSelected(super))->key; | ^ AvailableMetersPanel.c: In function ‘AvailableMetersPanel_eventHandler’: AvailableMetersPanel.c:40:24: error: potential null pointer dereference [-Werror=null-dereference] 40 | int param = selected->key & 0xff; | ^ linux/IOPriorityPanel.c: In function ‘IOPriorityPanel_getIOPriority’: linux/IOPriorityPanel.c:37:11: error: potential null pointer dereference [-Werror=null-dereference] 37 | return (IOPriority) ( ((ListItem*) Panel_getSelected(this))->key ); | ^
* Update License consistently to GPLv2 as per COPYING fileDaniel Lange2020-10-051-1/+1
|
* Drop redundant casts to the same typeChristian Göttsche2020-09-291-1/+1
|
* Axe automated header generation.Zev Weiss2020-09-031-17/+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-2/+2
|\
| * Clean up existing whitespaceDaniel Flanagan2019-10-311-2/+2
| |
* | Honour setting of counting CPUs from 0/1 when presenting metersRicardo Nabinger Sanchez2019-02-071-1/+1
|/ | | | | | | In the listing of Available Meters for CPUs, the list of CPUs is always presented by counting them from one. However, if the user prefers to count CPUs from zero, this is sometimes confusing when fine-tuning the meters.
* Security review: check results of snprintf.Hisham Muhammad2017-07-271-1/+1
| | | | | Calls marked with xSnprintf shouldn't fail. Abort program cleanly if any of them does.
* Assert (Platform_meterTypes[0]==&CPUMeter_class)Explorer092016-03-191-5/+7
| | | | | | | | | | | | Just assume Platform_meterTypes[0] is always &CPUMeter_class for every platform. This removes a conditional in AvailableMetersPanel_new(). Also adds some comments about the logic here. Without assuming Platform_meterTypes[0], the (int i=1) clause in this for loop will not make sense. (I.e. Why not (int i=0)? ) Also replaced a sprintf() call with safer snprintf() in code further below.
* Improve feedback when moving meters.Hisham Muhammad2015-08-271-2/+2
|
* Simplify constructors.Hisham Muhammad2015-03-231-5/+1
|
* Move FunctionBar inside PanelHisham Muhammad2015-03-231-1/+6
|
* Fix saving of header states, motion in Setup screen.Hisham Muhammad2015-03-161-1/+1
|
* Complete cursor-based movement of headers.Hisham Muhammad2015-02-031-2/+12
|
* Add longer descriptions to available meters.Hisham Muhammad2015-02-031-1/+2
|
* Sorry about the mega-patch.Hisham Muhammad2015-01-211-8/+11
| | | | | This is a work-in-progress, code is currently broken. (Some actions, and notably, the header, are missing.)
* Move UptimeMeter into platform-dependent area.Hisham Muhammad2014-11-271-4/+5
| | | | Set up environment to move other meters.
* Changes in object model: separate class objects to store vtable. Also, nicer ↵Hisham Muhammad2012-12-051-8/+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-6/+14
|
* add support for steal/guest CPU time measurementHisham Muhammad2010-08-241-3/+3
| | | | | | simplify processor data accounting (add CPUData structure) remove Process_clone trick
* Clean up headers by using 'static' whenever possible.Hisham Muhammad2008-03-091-36/+36
| | | | | Reduces resulting code size.
* Updates for new version of the MakeHeader.py script.Hisham Muhammad2006-06-061-2/+2
|

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