summaryrefslogtreecommitdiffstats
path: root/linux/Platform.c
Commit message (Collapse)AuthorAgeFilesLines
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* Linux: rework disk-io parsingChristian Göttsche2021-09-021-14/+5
| | | | | | | | | Generalize sub-diskname handling, like sdb1/sdb2, to not count the usage twice with the aggregate top-diskname, like sdb. Rely on /proc/diskstats being ordered, e.g. no sub-diskname precedes its top-diskname. Closes: #675
* Add combined memory and swap meterChristian Göttsche2021-08-171-0/+2
| | | | Closes: #699
* Simplify Action_pickFromVector() width parameter usageChristian Göttsche2021-08-161-1/+1
| | | | Pass one less instead of subtracting one inside the function.
* Linux: do not include zram devices in DiskIOChristian Göttsche2021-08-101-0/+3
| | | | | The meter is intended to show *real* IO, which is significantly slower than zram.
* Add Shift-F7, Shift-F8 keybindings for autogroupsDaniel Lange2021-08-091-0/+2
|
* Add columns for process autogroup identifier and nice valueNathan Scott2021-08-091-0/+30
| | | | | | | | | | | | Adds AGRP (autogroup) and ANI (autogroup nice) columns that report the information from /proc/PID/autogroup, as well as handlers for '{' and '}' to change the autogroup nice value. This is guarded by /proc/sys/kernel/sched_autogroup_enabled such that sampling and/or changing values wont be attempted unless the kernel feature is enabled. Fixes: #720
* Rework CPU countingChristian Göttsche2021-07-181-2/+8
| | | | | | | | | | | 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
* Proper label indentationBenny Baumann2021-07-151-1/+1
|
* Pointer indication aligned to typenameBenny Baumann2021-07-151-2/+2
|
* platform-dependent files included relative to main source directorymayurdahibhate2021-05-101-10/+9
|
* cleaned up includes with iwyumayurdahibhate2021-05-101-1/+1
|
* Add read-only optionChristian Göttsche2021-04-141-1/+4
| | | | | Add command line option to disable all system and process changing features.
* Rename drop-capabilities options none to offChristian Göttsche2021-04-141-6/+6
| | | | | | | None might be ambiguous whether we are dropping none or whether we keep none. Rename to off to make more clear this option does not drop any.
* Linux: handle garbage in /proc/loadavgChristian Göttsche2021-03-281-12/+18
| | | | | | | When parsing the content of /proc/loadavg via fscanf(3), ensure client passed parameters are set to sanitized values. Related to: #581
* Drop always true conditionChristian Göttsche2021-03-241-2/+1
| | | | | | The variable 'dir' is checked in line 645: if (!dir) return AC_ERROR;
* Linux: fix --drop-capabilitiesChristian Göttsche2021-03-221-1/+1
| | | | Do not return false (= argument not handled) when actually handled
* Use a platform-specific routine for long option usageNathan Scott2021-03-221-0/+14
| | | | Related to https://github.com/htop-dev/htop/pull/564
* Move libcap use to (Linux) platform-specific codeNathan Scott2021-03-221-15/+158
| | | | | | | | | | | | The libcap code is Linux-specific so move it all below the linux/ platform subdirectory. As this feature has custom command-line long options I provide a mechanism whereby each platform can add custom long options that augment the main htop options. We'll make use this of this with the pcp/ platform in due course to implement the --host and --archive options there. Related to https://github.com/htop-dev/htop/pull/536
* Use unsigned types for CPU counts and associated variablesChristian Göttsche2021-03-191-1/+1
|
* MemoryMeter: show shared memory before cachedChristian Göttsche2021-03-171-3/+3
| | | | | | Shared memory is less free-able than cached memory. Show it beforehand.
* Linux: individually show shared memoryChristian Göttsche2021-03-151-1/+2
| | | | | | | | Shmem: Total memory used by shared memory (shmem) and tmpfs Source: https://www.kernel.org/doc/Documentation/filesystems/proc.txt Closes: #556
* Merge pull request #550 from natoscott/diskio-typesNathan Scott2021-03-021-3/+3
|\ | | | | Fix integer sizing issues in the DiskIO Meter
| * Fix integer sizing issues in the DiskIO MeterNathan Scott2021-03-011-3/+3
| | | | | | | | | | | | | | | | | | On Linux kernels the size of the values exported for block device bytes has used a 64 bit integer for quite some time (2.6+ IIRC). Make the procfs value extraction use correct types and change internal types used to rate convert these counters (within the DiskIO Meter) 64 bit integers, where appropriate.
* | Fix integer sizing issues in the NetworkIO MeterNathan Scott2021-03-011-19/+12
|/ | | | | | | | | On Linux kernels the size of the values exported for network device bytes and packets has used a 64 bit integer for quite some time (2.6+ IIRC). Make the procfs value extraction use correct types and change internal types used to rate convert these counters (within the NetworkIO Meter) 64 bit integers, where appropriate.
* Linux: restore memory calculation regarding HugePagesChristian Göttsche2021-02-091-2/+2
| | | | | | | | Subtract the total amount of huge page memory from total and used memory. Restores behavior from #450 (see also #447) Follow-up of 3d497a37
* Linux: overhaul memory partitionChristian Göttsche2021-02-071-8/+5
| | | | | | | Use similar calculation than procps. Show AvailableMemory in text mode. Use total minus available memory instead of manually computed used- memory as fraction part in bar mode (if available).
* Use MainPanel type in State structChristian Göttsche2021-02-051-4/+2
| | | | | | | | The State struct holds a pointer to the main process panel. Use the distinct MainPanel type, to improve maintainability regrading its usage. This avoids usages of down-casts from Panel to MainPanel, only up-casts from MainPanel to Panel are now required.
* [#480] SysArchMeter to view kernel/arch infoahgamut2021-01-311-0/+2
| | | | | | | At start, SysArchMeter calls the uname function to obtain the kernel version and architecture. If available, the distro version is obtained by calling lsb_release. The obtained values are stored in static variables and used when updating the meter.
* Linux: handle hugepagesChristian Göttsche2021-01-191-2/+4
| | | | | | | Subtract hugepages from normal memory. Add a HugePageMeter. Closes: #447
* Define PATH_MAX for GNU/hurdDaniel Lange2021-01-161-1/+0
| | | | | Otherwise fails with "> linux/LinuxProcessList.c:889:20: error: ‘PATH_MAX’ undeclared (first use in this function)"
* Mark several non-modified pointer variables constChristian Göttsche2021-01-111-1/+1
|
* Linux: Add SwapCached to the swap meterDavid Zarzycki2021-01-111-0/+1
| | | | | | | According to the Linux kernel documentation, "SwapCached" tracks "memory that once was swapped out, is swapped back in but still also is in the swapfile (if memory is needed it doesn't need to be swapped out AGAIN because it is already in the swapfile. This saves I/O)."
* Mark several non-modified pointer variables constChristian Göttsche2021-01-111-7/+7
|
* Mark Platform_defaultFields constChristian Göttsche2020-12-191-1/+1
|
* Rework enum ProcessFieldChristian Göttsche2020-12-191-3/+1
| | | | | | Use only one enum instead of a global and a platform specific one. Drop Platform_numberOfFields global variable. Set known size of Process_fields array
* IWYU updateChristian Göttsche2020-12-061-1/+0
|
* Resolve conversion from ssize_t to int for readlink return valueChristian Göttsche2020-12-051-1/+1
|
* Dynamically load libsensors at runtimeChristian Göttsche2020-12-021-7/+8
|
* Add xReadfile wrapper for reading small to medium size filesChristian Göttsche2020-12-021-47/+12
| | | | | | Inspired by proposed Linux syscall Avoid file descriptor leaks like 4af8c63f
* Update even more snprintfsChristian Göttsche2020-11-281-2/+2
| | | | Use size of actual buffers instead of magic numbers
* Unify naming of first argument of Platform_getBatteryChristian Göttsche2020-11-251-15/+15
| | | | Use percent throughout
* Merge branch 'cleanup-init-done' into masterNathan Scott2020-11-231-2/+20
|\
| * Add whitespace to improve Linux Platform_init readabilityNathan Scott2020-11-191-0/+1
| |
| * Minor cleanups to platform-specific init and doneNathan Scott2020-11-191-2/+19
| | | | | | | | | | | | | | Move platform-specific code out of the htop.c main function and into the platform sub-directories - primarily this is the Linux procfs path check and sensors setup/teardown; not needed on any other platforms. No functional changes here.
* | Rename virtual memory column from M_SIZE to M_VIRTChristian Göttsche2020-11-211-1/+1
| | | | | | | | Closes: #325
* | IWYU update (Linux)Christian Göttsche2020-11-191-1/+6
|/
* Merge individual Battery.[ch] files into Platform.[ch]Nathan Scott2020-11-181-6/+5
| | | | | Small changes from review - keep headers sorted and keep local variable declarations at the top of source files.
* Merge individual Battery.[ch] files into Platform.[ch]Nathan Scott2020-11-181-0/+323
| | | | | Consistent with everything else involving platform-specific calls from core htop code.
* Show CPU temperature in CPU meterChristian Göttsche2020-11-161-0/+6
| | | | | Show the CPU temperature in the CPU meter, like CPU frequency, instead of using an extra Meter.

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