Commit graph

411 commits

Author SHA1 Message Date
DecklynKern b2bf8ef504 Fix scrollbar not clearing sometimes. 2023-10-06 17:33:38 -06:00
Rahul Aggarwal b5ba2fc963 Add keybind for toggling memory display mode in PROC box 2023-09-30 19:41:03 +02:00
nobounce 19dbbe1a17
Minor string initialization improvement 2023-09-29 12:26:19 +02:00
crestfalln cdcf8bc929 fixed bug where updated disks stats overrided disk io data 2023-09-29 09:51:18 +02:00
crestfalln 9b4e85f08d fixed bug where updated disks stats overrided disk io data 2023-09-29 09:51:18 +02:00
crestfalln 889623874e made disks stat logic async 2023-09-29 09:51:18 +02:00
lvxnull e89519fbb2 Fix signal list on non-linux/weird linux platforms 2023-09-28 18:23:11 +02:00
nobounce f34b40892f
Make process thread count better readable when wider than 5 digits 2023-09-24 16:34:50 +02:00
nobounce 6027cedd42
Add option to accumulate a child's resources in parent in tree-view 2023-09-14 23:29:49 +02:00
scorpion-26 f798acdaf7 Fix short conversion of 1000-1023*iB
floating_humanizer([1000-1024], true) with base 8 returns "2K", whereas it should return
"1.0K" to align with other formats. The conversion is also broken for
all other units(e.g. 1023M is also broken and returns "2G")
2023-09-05 18:00:47 +02:00
Jakob P. Liljenberg c296ac13cd
Merge pull request #590 from nobounce/dangling-reference-config
Convert parameters and config keys to std::string_view
2023-08-26 19:29:57 +02:00
Jakob P. Liljenberg 9a1e760a66
Merge pull request #602 from jfouquart/main
Fix getting zfs pool name with '.' char in freebsd
2023-08-26 19:20:18 +02:00
Jakob P. Liljenberg 9c8af4df43
Merge pull request #601 from joske/cleanup
[macos] don't check /sys on macos
2023-08-26 19:18:55 +02:00
Jos Dehaes d17e1a2dac fix some warnings 2023-08-25 16:18:39 +02:00
Jos Dehaes 4d8aa6b118 fix core check 2023-08-25 15:52:58 +02:00
Jonathan Fouquart 22e64caaff Fix getting zfs pool name with '.' char in freebsd 2023-08-25 09:37:49 +02:00
Jos Dehaes 2217cbe143 [macos] don't check /sys on macos 2023-08-23 16:46:02 +02:00
Jos Dehaes dcbdb7360d [macos] fix temp sensor on system with many cores 2023-08-23 15:46:47 +02:00
aristocratos c8ec6bbb00 Fix freebsd nullptr changes and makefile for gcc12 and newer 2023-08-03 23:08:33 +02:00
Jakob P. Liljenberg 8a33aab588
Merge pull request #539 from nobounce/replace-NULL-nullptr
Modernize using nullptr.
2023-07-30 13:21:48 +02:00
aristocratos 94e5c02d11 Better text editing 2023-07-27 20:51:21 +02:00
nobounce 091c30ab2b
Convert parameters and config keys to std::string_view
Using std::string_view instead of std::string& silences a new warning
from GCC 13, -Wdangling-reference

Also switch return type of `getI` from int& to int, trivial types are
cheaper to copy by value
2023-07-27 14:17:54 +02:00
nobounce e4abcefbf9 Use nullptr instead of NULL.
See https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
TLDR: NULL is of type int and relies on proper implicit pointer
conversion which may lead to issues when using overloaded functions

It is also considered a 'best practise' for modern C++ and
conveys the programmers intention more precisly.
2023-07-26 16:19:17 +02:00
aristocratos aca2e4be75 Fix whitespace indent -> tab indent 2023-07-26 14:38:48 +02:00
aristocratos 33faa01910 Revert fmt submodule to static fmt folder in include 2023-07-26 14:34:15 +02:00
Jakob P. Liljenberg ac17f34580
Merge pull request #560 from rrveex/main
FreeBSD swap info
2023-07-16 16:42:16 +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
rr 8466bf3a18 FreeBSD swap info 2023-06-21 21:12:36 +03: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 a5e4969d7e Remove pthread_exit().
Returning from the thread this way prevents local variables to be
destructed correctly since pthread_exit is marked noreturn.

This fixes a segmentation fault with glibc and llvm-libunwind on exit.
2023-05-25 23:00:07 +02: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
zackiloco 7dac8505c4 Include <codecvt> required by Clang. 2023-05-25 23:00:07 +02:00
zackiloco 34ae6d96d5 Move #include to top level and exclude Clang from compiler version
check.

Clang cannot handle <semaphore> being included in a namespace, which is
also unadvised see:
https://softwareengineering.stackexchange.com/a/335261.

Using the fallback <semaphore.h> is only meant for GCC 10, but Clang
defines `__GNUC__ = 4` so exclude Clang.
2023-05-25 23:00:07 +02:00
zackiloco 922b6475ae Insert std:: for warning unqualified call to std::move. 2023-05-25 23:00:07 +02:00
cpalv 1039bd5b5d amend! update cpu load average display
update cpu load average display

applied suggested changes
2023-05-24 19:51:43 -05:00
cpalv 5d2f7420c3 update cpu load average display 2023-05-23 19:06:50 -05:00
aristocratos b0fc63537b println -> fmt::println 2023-05-21 12:26:48 +02:00
aristocratos fbc349da2a Readd using namespace fmt 2023-05-21 12:11:29 +02:00
aristocratos bd688e24bf Add fmt prefix for fmtlib 2023-05-21 11:58:52 +02:00
Steven Xu 7ca1cc533a fix: prefix with fmt:: to fix ambiguous call to format(), that also refers to /usr/include/c++/13.1.1/format 2023-05-21 19:33:44 +10:00
aristocratos 09c075e06c Debug times thousand separator 2023-05-21 01:11:35 +02:00
aristocratos e11d64e8d7 Debug times box changes 2023-05-20 15:20:27 +02:00
aristocratos 21b85f8913 btop.cpp -> fmt 2023-05-20 14:52:50 +02:00
Steffen 053bacef1d Silence "warning: unqualified call to 'std::move'" in clang. 2023-03-07 13:16:04 +01:00
Jakob P. Liljenberg 3200de584f
Merge pull request #502 from mattico/linux-zfs-arc
Linux: subtract ZFS ARC min size from available memory
2023-02-23 18:49:01 +01:00
Matt Ickstadt 345bf7c052 Linux: subtract ZFS ARC min size from available memory 2023-02-23 10:59:10 -06:00
simplepad 2b18c6952d
fix zfs on freebsd not reporting IO 2022-12-21 21:45:25 +03: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