Commit graph

164 commits

Author SHA1 Message Date
romner-set 547f17dda3 Add more GPU graph types to the CPU panel 2023-05-30 18:24:50 +02:00
romner 8c96bd51e9 Handle GPUs which cannot report certain stats in GPU panel 2023-05-21 20:34:47 +02:00
romner 414d7eb94c Handle GPUs which cannot report certain stats in btop_collect.cpp and CPU panel 2023-05-21 18:02:50 +02:00
aristocratos 1fee2bc08b Add DebugTimer class and change some Logger::error calls to Logger::debug 2023-05-21 13:52:19 +02:00
aristocratos 8c710a2b68 Makefile auto detection and initial logic for excluding gpu code when libs are missing 2023-05-20 01:41:04 +02:00
romner 22a463976d Add GPU info to CPU panel 2023-05-18 16:07:05 +02:00
romner-set c352bf2613 Add ROCm SMI backend for AMD GPU support 2023-05-15 19:42:55 +02:00
romner-set 917d568a77 Add multi-GPU support for NVML data collection 2023-05-15 13:58:54 +02:00
romner bcffcdf19f Make GPU window's size dynamic and integrate it with the rest of btop 2023-05-14 16:53:06 +02:00
romner 95b3228308 Improve GPU side panel 2023-05-13 19:41:51 +02:00
romner adcdc583b0 Add GPU side panel 2023-05-13 00:27:23 +02:00
romner d522a91ef4 Add rudimentary, fullscreen single-GPU NVML utilization graph 2023-05-12 19:34:47 +02:00
zackiloco 6eb37601d7 Retrieve load average from libc and use emplace_back where appropriate
Get the load average from libc and adjust the internal API. This has
less overhead than opening /proc/loadavg.

Favor emplace_back over push_back, in general it has the chance to not
create a temporary object.
2023-07-05 13:23:11 +02:00
Jakob P. Liljenberg 7e50b03e39
Merge pull request #510 from nobounce/LLVM
Support compiling with LLVM
2023-06-15 17:45:05 +02:00
Mitchell Dorrell 3c6929b025 Fix integer overflows in btop_collect.cpp
Correct data types in calls to std::accumulate(). The "bandwidth" deques
have type "long long", so the initial value of the accumulator (0) must
also be "long long" (i.e., "0ll") to prevent integer overflows. Also,
since since the bandwidth deques are (signed) "long long", the avg_speed
should presumably be a signed "long long" instead of an unsigned
"uint64_t". The previous behavior was for large bandwidth values to
overflow the accumulator, resulting in a negative total, which then was
cast to be a huge "uint64_t" value. As a consequence, the network graph
autoscaling was broken for large bandwidths.
2023-05-26 01:26:21 -04:00
zackiloco a2fa9da073 Replace statvfs64 with statvfs and define _FILE_OFFSET_BITS=64.
On my musl system statvfs64 is not exposed by default. The musl FAQ
recommends against using type64_t types, see:
https://wiki.musl-libc.org/faq.html#Q:-Do-I-need-to-define-%3Ccode%3E_LARGEFILE64_SOURCE%3C/code%3E-to-get-64bit-%3Ccode%3Eoff_t%3C/code%3E?.

Defining `_FILE_OFFSET_BITS=64` and using type_t lets type_t use the 64
bit interface, see:
https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html#index-_005fFILE_005fOFFSET_005fBITS.
2023-05-25 23:00:07 +02:00
Matt Ickstadt 345bf7c052 Linux: subtract ZFS ARC min size from available memory 2023-02-23 10:59:10 -06:00
aristocratos e67a35df08 Removed unused statement... 2022-11-30 23:18:04 +01:00
aristocratos 9aaffd6b26 Fixed: Use MemFree for used mem calculation if MemAvailable is greater than MemTotal. 2022-11-30 22:41:08 +01:00
aristocratos 5a53fb4a2c Fixed: Process nice value underflowing, issue #461 2022-11-06 11:32:17 +01:00
aristocratos 68f7d1f4bb Fixed: Not picking up last username from /etc/passwd 2022-11-05 22:56:52 +01:00
correabuscar bad9bbc160 make IPBUFFER_MAXSIZE an enum constant
... instead of a macro constant(which made the code less readable!)

Supposedly it also doesn't use run-time storage.
2022-11-04 23:23:27 +01:00
correabuscar 96a22b4078 use inet_ntop instead of getnameinfo
saves 979 bytes of reserved buffer because:
NI_MAXHOST is 1025 bytes
and
INET6_ADDRSTRLEN is 46

Depends on PR #457 being merged first.
2022-11-04 23:23:27 +01:00
correabuscar eec1999a8f Show the first IP of the interface in NET box
... instead of the last.

Also, indented the `for` statement with tabs rather than spaces.

Closes #456
2022-11-04 01:45:09 +01:00
aristocratos 9f0fcdd5bf Fixed: Moved up get_cpuHz() in the execution order to get better cpu clock reading. 2022-10-27 15:09:00 +02:00
aristocratos dda9f2589f Fixed: Ignore disks that fails in statvfs64() to avoid slowdowns and possible crashes. 2022-10-23 19:33:04 +02:00
aristocratos 8a07bc43b4 Changed: Reverted back to sysconf(_SC_NPROCESSORS_ONLN) for Cpu core count ant let the new dynamic update fix if cores are turned on later 2022-10-13 09:26:06 +02:00
aristocratos 4f45b9b25f Added: Dynamic updating of max number of CPU cores 2022-10-07 20:45:12 +02:00
aristocratos e5cc895015 Fixed: Number of cores wrongly detected for Ryzen in rare cases. 2022-10-07 13:41:04 +02:00
Jakob P. Liljenberg d58a17afb1
Merge pull request #438 from stefanos82/main
Further cleanup
2022-10-05 12:28:55 +02:00
aristocratos 0cb31e7b11 Fixed: Cpu::collect() core count counter... 2022-10-05 10:41:09 +02:00
Στέφανος f0e413ed6f All but two places const bool have been updated
I haven't touched `include/robin_hood.h` as I don't know whether it's a
third-party header file that could get rewritten at a later time of a
possible future release by the author(s) of it.
2022-10-04 21:36:04 +03:00
Στέφανος ab7fe62e65 Fix variable initialization to 'auto' for getB()
It does not make sense to return a `const bool&` as we are dealing with
Boolean literals that are `prvalue`s of type bool.

The compiler is smart enough to do the necessary optimizations wherever
is applicable.
2022-10-04 12:56:14 +03:00
Στέφανος 36a180033d Forgot to update 'auto' usage wherever necessary 2022-10-04 12:11:12 +03:00
Στέφανος 73afc487fa
Merge branch 'main' into fixed-merge-conflict 2022-10-03 10:41:40 +03:00
aristocratos 96b770cfdb Changed: Using sysconf(_SC_NPROCESSORS_CONF) for number of cores instead of sysconf(_SC_NPROCESSORS_ONLN) 2022-10-03 08:49:41 +02:00
Στέφανος 1fddbc1cd6 Further Cleanup Part 2 2022-10-03 00:29:05 +03:00
aristocratos 24f06094f8 Fixed: Crashing when cores are offline 2022-10-02 15:25:10 +02:00
aristocratos 3796a8ccee Fixed: Extra checks to avoid crash on trying to replace empty strings in tree mode 2022-10-02 13:20:15 +02:00
Jakob P. Liljenberg b48596486e
Merge pull request #385 from simplepad/zfs-iostat-new
Implement new ZFS pool io monitoring and the option to show ZFS pools only
2022-07-11 19:24:08 +02:00
simplepad a33bab3000
switch Logger calls to debug() to avoid filling up the logfile 2022-07-11 19:16:19 +03:00
simplepad bc608e862e
rename zfs_pools_only option to zfs_hide_datasets, make its description clearer 2022-07-11 19:08:25 +03:00
simplepad 189cba73e4
check if at least one object was read before updating ZFS pool io in zfs_collect_pool_total_stats(), use try-catch to prevent possible crashes from int_64t conversions 2022-07-09 03:46:15 +03:00
simplepad 4969dd8dc6
Use fs::directory_iterator() instead of readdir() in ZFS functions, use fs::path instead of strings. 2022-07-05 01:12:19 +03:00
simplepad 30cc42fcd9
Move get_zfs_stat_file() and zfs_collect_pool_total_stats() functions declarations to btop_collect.cpp so they aren't included when compiling for macos and freebsd 2022-07-05 00:20:33 +03:00
simplepad 7feff854fd
Made ZFS stats collection compatible with zfs_pools_only option. ZFS pool's stat filepath points to the objset-* file when the option is disabled, otherwise it points to the pool's stats directory. Made ZFS total pool stat collection into a separate function for clean code. Also removed an unnecessary variable in the default ZFS stat collection, and changed io_ticks to track the number of reads/writes, reducing unnecessary calculations. 2022-07-04 01:28:25 +03:00
simplepad ed20cb9e07
Re-implemented ZFS stat collection to be compatible with new ZFS versions, now it uses files "/proc/spl/kstat/zfs/*pool_name*/objset*". Needs additional work to be compatible with the option "zfs_pools_only". 2022-07-03 21:05:40 +03:00
aristocratos 6b1b9f8142 Changed: Rewrite of process sorting and tree generation including fixes for tree sorting and mouse support 2022-07-03 12:37:54 +02:00
simplepad d8d7e40814
Add zfs_pools_only option 2022-07-01 19:30:50 +03:00
Jakob P. Liljenberg b0f5eb6ea7
Merge pull request #374 from simplepad/zfs-pool-io-support
Added support for ZFS pool io stats monitoring
2022-06-29 13:46:14 +02:00
simplepad aeea53518b
use Shared::procPath, fix Logger error type 2022-06-29 14:42:27 +03:00
aristocratos f35d36ab6c Fixed kernel proc filter clearing issue + optimization 2022-06-29 09:54:28 +02:00
aristocratos b450293f7f Optimize away clear_kernel_cache() function 2022-06-29 09:43:17 +02:00
aristocratos 39f3ac4785 Merge branch 'kernel-filtering' 2022-06-29 09:33:33 +02:00
simplepad d402f4cece
Remove duplicate fstype setter 2022-06-25 20:07:13 +03:00
simplepad a88671b68f
Remove forgotten debug logger calls 2022-06-25 20:02:01 +03:00
simplepad fbba6b69d3
Added support for ZFS pool io stats monitoring 2022-06-25 18:12:35 +03:00
Jakob P. Liljenberg 7d86602ede
Changed: Disable battery monitoring if it fails instead of exiting 2022-06-21 14:42:06 +02:00
0xJoeMama d916e064d1
Changed spaces to tabs 2022-05-29 16:11:27 +03:00
0xJoeMama 482734766a
Finished kernel proc filtering. 2022-05-29 16:09:55 +03:00
aristocratos 7291c7dfdc Fixed: Net sync scale bug 2022-05-28 20:48:02 +02:00
0xJoeMama 2b4000b857
Added a check for filter kernel mode 2022-05-24 15:42:59 +03:00
0xJoeMama 8ed8d43f5a
Added caching for kernel processes. 2022-05-24 12:01:33 +03:00
0xJoeMama 3e097faecc
More indentation 2022-05-21 15:16:35 +03:00
0xJoeMama 224c065eed
Replaced my spaces with tabs 2022-05-21 15:14:16 +03:00
0xJoeMama f340fa6a48
Indentation fix. 2022-05-21 15:06:03 +03:00
0xJoeMama d53998f37c
Woops that went unnoticed, didn't it? 2022-05-21 15:03:07 +03:00
0xJoeMama 7b50543be3
Made kernel process filtering more efficient 2022-05-21 14:37:21 +03:00
0xJoeMama c0f6084159
Replaced $*\s with tabs 2022-05-20 23:54:07 +03:00
0xJoeMama e70dbc1bce
Fixed some formatting issues. 2022-05-20 23:48:59 +03:00
0xJoeMama e1341a17cb
Moved to correct version of the code 2022-05-20 23:35:41 +03:00
Jakob P. Liljenberg c257938d46
Merge pull request #326 from abrasumente233/main
Added: Case insensitive process filtering
2022-05-16 16:03:58 +02:00
Matt Ickstadt a7384483a4 Include ZFS ARC in cached/available memory on Linux 2022-05-05 10:18:35 -05:00
abrasumente abc4fb25c3 Added: Case insensitive process filtering 2022-05-01 01:08:27 +08:00
aristocratos 0f117a0273 Fixed: Disk IO stats for individual partitions instead of whole disk 2022-04-26 20:43:35 +02:00
aristocratos 4e7a212f83 Fixed: Ignore duplicate disks with same mountpoint 2022-02-17 22:28:10 +01:00
aristocratos 2aeae24b88 Fixed: string to wstring conversion crash when string is too big 2022-02-15 07:11:22 +01:00
aristocratos baabbe78b2 Added: Toggle for showing free disk space for privileged or normal users 2022-02-13 00:33:20 +01:00
aristocratos 64cdb44343 Fixed: Net speed rollover for 32-bit 2022-01-12 20:49:27 +01:00
aristocratos 56deec4988 Fixed: Account for system rolling over net speeds in Net::collect() 2021-12-30 11:26:23 +01:00
aristocratos 5453e82a95 Changed: From rng::sort() to rng::stable_sort() for more stability 2021-12-27 10:55:17 +01:00
aristocratos 9465e9b014 Fixed: coretemp ordering 2021-11-27 18:24:40 +01:00
aristocratos 1bce1be695 Merge branch 'sensor-fix' 2021-11-27 18:20:30 +01:00
aristocratos e1074cd15b Mem::collect optimization 2021-11-22 21:43:40 +01:00
Krzysztof Filipek 5fb484a299 Fix coretemp iteration due to missing temp9_input (i9-9940X)
There are cases when some files are missing:
1. Due to specific CPU topology (e.g. {cpu6: core_id=6; but cpu7: core_id=8})
2. On architectures older than SandyBridge (missing per-package sensor)
2021-11-22 19:07:53 +01:00
aristocratos 156998073a Fixed: Bad values for disks and network on 32-bit 2021-11-03 21:01:34 +01:00
aristocratos 9ecea2c94e Fixed: Removed extra spaces in cpu name 2021-10-26 23:50:28 +02:00
aristocratos 587005f094 v1.0.20 Bug fixes 2021-10-26 23:41:40 +02:00
CS Adnan 73a0ad73c0 remove log warning + extra if for k10temp 2021-10-26 11:26:52 +06:00
CS Adnan 602cef8760 add support for AMD Ryzen 5000 temp sensor 2021-10-25 00:17:54 +06:00
aristocratos 7d89c75abb FIxed: Battery error if non existant battery named is entered 2021-10-17 22:55:36 +02:00
aristocratos 4cacdf28fe Added: Displayed battery selectable in options menu 2021-10-17 22:26:43 +02:00
Jan Günter 22297f7954 added try catch block as suggested in review
https://github.com/aristocratos/btop/pull/97#discussion_r730428842
2021-10-17 17:06:18 +02:00
Jan Günter 966c9f5e5e improved battery detection
- new considering all power supplies (instead of path name filtering)
- only consider power supplies that are currently present
- only consider power supplies of type Batter or UPS
2021-10-17 16:31:25 +02:00
Jan Günter 816270750d readability change request in review
https://github.com/aristocratos/btop/pull/92#discussion_r730321422
2021-10-17 01:45:26 +02:00
Jan Günter c8a7c0dc19 changed static build behavior
restrict getpwuid usage only in static builds with glibc
2021-10-16 13:02:06 +02:00
aristocratos e20258ea9f Added: Try to restart secondary thread in case of stall and addiotional error checks for ifstream in Proc::collect() 2021-10-15 08:32:37 +02:00
aristocratos d96fdd7eb2 Fixed: Extra "root" partition when running in snap 2021-10-06 18:06:05 +02:00
aristocratos dbcd12b9d0 Fixed: snap root disk and changed to compiler flags instead of env variables for detection 2021-10-06 11:25:10 +02:00
aristocratos 69c5eba1db Fixed: Uid -> User fallback to getpwuid() if failure for non static builds 2021-10-06 10:47:24 +02:00