btop++ - A monitor of resources

Related tags

CLI btop
Overview

btop++

Linux Usage c++20 btop_version Donate Sponsor Coffee

Index

News

Under development

18 September 2021

The Linux version of btop++ is complete. Released as version 1.0.0

I will be providing statically compiled binaries for a range of architectures in every release for those having problems compiling.

For compilation GCC 10 is required, GCC 11 preferred.

Please report any bugs to the Issues page.

The development plan right now:

  • 1.1.0 Mac OsX support
  • 1.2.0 FreeBSD support
  • 1.3.0 Support for GPU monitoring
  • 1.X.0 Other platforms and features...

Windows support is not in the plans as of now, but if anyone else wants to take it on, I will try to help.

5 May 2021

This project is gonna take some time until it has complete feature parity with bpytop, since all system information gathering will have to be written from scratch without any external libraries. And will need some help in the form of code contributions to get complete support for BSD and OSX.

Documents

CHANGELOG.md

CONTRIBUTING.md

CODE_OF_CONDUCT.md

Description

Resource monitor that shows usage and stats for processor, memory, disks, network and processes.

C++ version and continuation of bashtop and bpytop.

Features

  • Easy to use, with a game inspired menu system.
  • Full mouse support, all buttons with a highlighted key is clickable and mouse scroll works in process list and menu boxes.
  • Fast and responsive UI with UP, DOWN keys process selection.
  • Function for showing detailed stats for selected process.
  • Ability to filter processes.
  • Easy switching between sorting options.
  • Tree view of processes.
  • Send any signal to selected process.
  • UI menu for changing all config file options.
  • Auto scaling graph for network usage.
  • Shows IO activity and speeds for disks
  • Battery meter
  • Selectable symbols for the graphs
  • Custom presets
  • And more...

Themes

Btop++ uses the same theme files as bpytop and bashtop (some color values missing in bashtop themes) .

See themes folder for available themes.

The make install command places the default themes in [$PREFIX or /usr/local]/share/btop/themes. User created themes should be placed in $XDG_CONFIG_HOME/btop/themes or $HOME/.config/btop/themes.

Let me know if you want to contribute with new themes.

Support and funding

You can sponsor this project through github, see my sponsors page for options.

Or donate through paypal or ko-fi.

Any support is greatly appreciated!

Prerequisites

For best experience, a terminal with support for:

  • 24-bit truecolor (See list of terminals with truecolor support)
  • 256-color terminals are supported through 24-bit to 256-color conversion when setting "truecolor" to False in the options or with "-lc/--low-color" arguments.
  • 16 color TTY mode will be activated if a real tty device is detected. Can be forced with "-t/--tty_on" arguments.
  • Wide characters (Are sometimes problematic in web-based terminals)

Also needs a UTF8 locale and a font that covers:

  • Unicode Block “Braille Patterns” U+2800 - U+28FF (Not needed in TTY mode or with graphs set to type: block or tty.)
  • Unicode Block “Geometric Shapes” U+25A0 - U+25FF
  • Unicode Block "Box Drawing" and "Block Elements" U+2500 - U+259F

Notice (Text rendering issues)

  • If you are having problems with the characters in the graphs not looking like they do in the screenshots, it's likely a problem with your systems configured fallback font not having support for braille characters.

  • See Terminess Powerline for an example of a font that includes the braille symbols.

  • See comments by @sgleizes link and @XenHat link in issue #100 for possible solutions.

  • If text are misaligned and you are using Konsole or Yakuake, turning off "Bi-Directional text rendering" is a possible fix.

  • Characters clipping in to each other or text/border misalignments is not bugs caused by btop, but most likely a fontconfig or terminal problem where the braille characters making up the graphs aren't rendered correctly.

  • Look to the creators of the terminal emulator you use to fix these issues if the previous mentioned fixes don't work for you.

Screenshots

Main UI showing details for a selected process

Screenshot 1

Main UI in TTY mode

Screenshot 2

Main UI with custom options

Screenshot 3

Main-menu

Screenshot 3

Options-menu

Screenshot 4

Help-menu

Screenshot 5

Installation

Binary release (statically compiled)

  1. Download btop-(VERSION)-(PLATFORM)-(ARCH).tbz from latest release and unpack to a new folder

  2. Install (from created folder)

    • Run install.sh or:
    # use "make install PREFIX=/target/dir" to set target, default: /usr/local
    # only use "sudo" when installing to a NON user owned directory
    sudo make install
  3. (Optional) Set suid bit to make btop always run as root (or other user)

    Enables signal sending to any process without starting with sudo and can prevent /proc read permissions problems on some systems.

    • Run setuid.sh or:
    # run after make install and use same PREFIX if any was used at install
    # set SU_USER and SU_GROUP to select user and group, default is root:root
    sudo make setuid
  • Uninstall

    • Run uninstall.sh or:
    sudo make uninstall
  • Show help

    make help

Compilation

Needs GCC 10 or higher, (GCC 11 or above strongly recommended for better CPU efficiency in the compiled binary).

The makefile also needs GNU coreutils and sed (should already be installed on any modern distribution).

  1. Install dependencies (example for Ubuntu 21.04 Hirsute)

    sudo apt install coreutils sed git build-essential gcc-11 g++-11
    # use gcc-10 g++-10 if gcc-11 isn't available
  2. Clone repository

    git clone https://github.com/aristocratos/btop.git
    cd btop
  3. Compile

    Append STATIC=true to make command for static compilation.

    Notice! Manually set $ARCH variable if cross-compiling

    Use $ADDFLAGS variable for appending flags to both compiler and linker.

    make
  4. Install

    # use "make install PREFIX=/target/dir" to set target, default: /usr/local
    # only use "sudo" when installing to a NON user owned directory
    sudo make install
  5. (Optional) Set suid bit to make btop always run as root (or other user)

    No need for sudo to enable signal sending to any process and to prevent /proc read permissions problems on some systems.

    # run after make install and use same PREFIX if any was used at install
    # set SU_USER and SU_GROUP to select user and group, default is root:root
    sudo make setuid
  • Uninstall

    sudo make uninstall
  • Remove any object files from source dir

    make clean
  • Remove all object files, binaries and created directories in source dir

    make distclean
  • Show help

    make help

Configurability

All options changeable from within UI. Config and log files stored in $XDG_CONFIG_HOME/btop or $HOME/.config/btop folder

btop.cfg: (auto generated if not found)

#? Config file for btop v. 0.1.0

#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.
#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes"
color_theme = "Default"

#* If the theme set background should be shown, set to False if you want terminal background transparency.
theme_background = False

#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false.
truecolor = True

#* Set to true to force tty mode regardless if a real tty has been detected or not.
#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols.
force_tty = False

#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets.
#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positons, G=graph symbol to use for box.
#* Use withespace " " as seprator between different presets.
#* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty"
presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty"

#* Rounded corners on boxes, is ignored if TTY mode is ON.
rounded_corners = True

#* Default symbols to use for graph creation, "braille", "block" or "tty".
#* "braille" offers the highest resolution but might not be included in all fonts.
#* "block" has half the resolution of braille but uses more common characters.
#* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY.
#* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view.
graph_symbol = "braille"

# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_cpu = "default"

# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_mem = "default"

# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_net = "default"

# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_proc = "default"

#* Manually set which boxes to show. Available values are "cpu mem net proc", separate values with whitespace.
shown_boxes = "cpu mem net proc"

#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs.
update_ms = 2000

#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu responsive",
#* "cpu lazy" sorts top process over time (easier to follow), "cpu responsive" updates top process directly.
proc_sorting = "cpu lazy"

#* Reverse sorting order, True or False.
proc_reversed = False

#* Show processes as a tree.
proc_tree = False

#* Use the cpu graph colors in the process list.
proc_colors = True

#* Use a darkening gradient in the process list.
proc_gradient = True

#* If process cpu usage should be of the core it's running on or usage of the total available cpu power.
proc_per_core = True

#* Show process memory as bytes instead of percent.
proc_mem_bytes = True

#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate)
proc_info_smaps = False

#* Show proc box on left side of screen instead of right.
proc_left = False

#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available.
#* Select from a list of detected attributes from the options menu.
cpu_graph_upper = "total"

#* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available.
#* Select from a list of detected attributes from the options menu.
cpu_graph_lower = "total"

#* Toggles if the lower CPU graph should be inverted.
cpu_invert_lower = True

#* Set to True to completely disable the lower CPU graph.
cpu_single_graph = False

#* Show cpu box at bottom of screen instead of top.
cpu_bottom = False

#* Shows the system uptime in the CPU box.
show_uptime = True

#* Show cpu temperature.
check_temp = True

#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors.
cpu_sensor = "Auto"

#* Show temperatures for cpu cores also if check_temp is True and sensors has been found.
show_coretemp = True

#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core.
#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine.
#* Format "x:y" x=core with wrong temp, y=core with correct temp, use space as separator between multiple entries.
#* Example: "4:0 5:1 6:3"
cpu_core_map = ""

#* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine".
temp_scale = "celsius"

#* Show CPU frequency.
show_cpu_freq = True

#* Draw a clock at top of screen, formatting according to strftime, empty string to disable.
#* Special formatting: /host = hostname | /user = username | /uptime = system uptime
clock_format = "%H:%M"

#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort.
background_update = True

#* Custom cpu model name, empty string to disable.
custom_cpu_name = ""

#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ".
#* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot /home/user".
disks_filter = "exclude=/boot"

#* Show graphs instead of meters for memory values.
mem_graphs = True

#* Show mem box below net box instead of above.
mem_below_net = False

#* If swap memory should be shown in memory box.
show_swap = True

#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk.
swap_disk = True

#* If mem box should be split to also show disks info.
show_disks = True

#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar.
only_physical = True

#* Read disks list from /etc/fstab. This also disables only_physical.
use_fstab = False

#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view.
show_io_stat = True

#* Toggles io mode for disks, showing big graphs for disk read/write speeds.
io_mode = False

#* Set to True to show combined read/write io graphs in io mode.
io_graph_combined = False

#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ".
#* Example: "/mnt/media:100 /:20 /boot:1".
io_graph_speeds = ""

#* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False.
net_download = 100

net_upload = 100

#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest.
net_auto = True

#* Sync the auto scaling for download and upload to whichever currently has the highest scale.
net_sync = False

#* Starts with the Network Interface specified here.
net_iface = "br0"

#* Show battery stats in top right if battery is present.
show_battery = True

#* Set loglevel for "~/.config/btop/error.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info.
log_level = "DEBUG"

Command line options

usage: btop [-h] [-v] [-/+t] [-p 
   
    ] [--utf-force] [--debug]

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show version info and exit
  -lc, --low-color      disable truecolor, converts 24-bit colors to 256-color
  -t, --tty_on          force (ON) tty mode, max 16 colors and tty friendly graph symbols
  +t, --tty_off         force (OFF) tty mode
  -p, --preset 
    
          start with preset, integer value between 0-9
  --utf-force           force start even if no UTF-8 locale was detected
  --debug               start in DEBUG mode: shows microsecond timer for information collect
                        and screen draw functions and sets loglevel to DEBUG

    
   

LICENSE

Apache License 2.0

Comments
  • [REQUEST] Distribute as Flatpak and/or Snap

    [REQUEST] Distribute as Flatpak and/or Snap

    A lot of users across various Linux Distros would have convenient access to this application if it were distributed as Flatpak and/or Snap. It would also greatly help discoverability of this application if it was published there.

    Have you considered publishing this as a Flatpak on Flathub and/or as a Snap on the Snap store? Flatpak is the more popular universal app format out of the two (because it's more open by design), so if you had to choose only one, I'd go with Flatpak.

    enhancement 
    opened by JordyScript 117
  • [BUG] Btop hangs

    [BUG] Btop hangs

    Describe the bug For some reason btop randomly hangs (after a couple of mins or hours), CPU jumps to 100% for btop process.

    To Reproduce Not sure since it's random. Installed from snap edge though.

    Expected behavior

    Screenshots

    [If applicable, add screenshots to help explain your problem.]

    Info (please complete the following information):

    • btop++ version: bpytop -v: 1.0.9
    • Architecture: [x86_64, aarch64, etc.] uname -m
    • Platform: [Linux, FreeBSD, OsX]: Ubuntu 21.04
    • (Linux) Kernel: uname -r: 5.11.0.0-36-generic
    • Terminal used: byobu
    • Font used: default byobu fonts

    Additional context

    contents of ~/.config/btop/btop.log: doesn't exist, only btop.conf

    (try running btop with --debug flag if error.log is empty): OK

    bug 
    opened by jmakov 45
  • [BUG] complains of no UTF-8 while locale *is* UTF-8

    [BUG] complains of no UTF-8 while locale *is* UTF-8

    Describe the bug

    Running on RHEL 7.7 at work, using the statically compiled binary 1.0.9, it complains of no UTF-8 locale detected. While locale is: [[email protected] Snape]$ locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=

    When using the --utf-force flag, btop works perfectly. We have the same on other RHEL 7.x boxes. I can not compile/debug btop on this machine (as its compilers are too old - even with gcc 8.3 -std=c++20 is not available). On a RHEL 8 system this just works. I can compile/debug there (after installing gcc 10 toolchain), but useless as the problem doesn't occur there. The locale settings are identical on that system.

    To Reproduce

    Get a RHEL 7.7 (probably any 7.x will do) system (via docker?) and copy the btop binary. It will complain although locale is UTF-8.

    Expected behavior

    btop can run with the --utf-force flag.

    [[email protected] Snape]$ btop ERROR: No UTF-8 locale detected! Use --utf-force argument to force start if you're sure your terminal can handle it.

    [If applicable, add screenshots to help explain your problem.]

    Info (please complete the following information):

    • btop++ version: 1.0.9
    • Binary: static binary from release
    • Architecture: x86_64
    • Platform: Linux
    • (Linux) Kernel: 3.10.0-1062.4.1.el7.x86_64
    • Terminal used: mate-terminal
    • Font used: Noto Mono for Powerline Regular

    Additional context

    contents of ~/.config/btop/btop.log -> nothing there other than no UTF-8 locale detected.

    bug 
    opened by joske 44
  • [BUG] Crashes on startup (on kitty and alacritty)

    [BUG] Crashes on startup (on kitty and alacritty)

    Describe the bug Tried to run on pop OS 21.04. Crashes on startup with the following log:

    /usr/include/c++/11/ranges:540: constexpr std::ranges::iota_view<_Winc, _Bound>::iota_view(std::type_identity_t<_Winc>, st
      3 d::type_identity_t<_Bound>) [with _Winc = int; _Bound = int; std::type_identity_t<_Winc> = int; std::type_identity_t<_Boun
      2 d> = int]: Assertion 'bool(__value <= __bound)' failed.                                                                   
      1 fish: “btop” terminated by signal SIGABRT (Abort)
    

    It seems that it doesn't like the kitty terminal, but sometimes it seemed random. Unfortunately I wasn't taking note of everything before but I think it happens on kitty but not eg. on gnome terminal.

    To Reproduce Run the executable on the kitty terminal.

    Info (please complete the following information):

    • btop++ version: 1.0.2
    • Architecture: x86_64
    • Platform: Linux
    • (Linux) Kernel: 5.11.0-7620-generic
    • Terminal used: kitty
    • Font used: Victor Mono

    Additional context

    contents of ~/.config/btop/btop.log

    (try running btop with --debug flag if error.log is empty)

    2021/09/20 (19:15:41) | ===> btop++ v.1.0.2
    2021/09/20 (19:15:41) | DEBUG: Starting in DEBUG mode!
    2021/09/20 (19:15:41) | INFO: Logger set to DEBUG
    2021/09/20 (19:15:41) | DEBUG: Setting LC_ALL=en_US.UTF-8
    2021/09/20 (19:15:41) | INFO: Running on /dev/pts/1
    
    bug 
    opened by radgeRayden 44
  • [BUG] CPU core temperatures don't update

    [BUG] CPU core temperatures don't update

    Describe the bug

    Temperature for individual cores does not update over time but overall CPU temperature does

    To Reproduce

    Run btop in terminal

    Expected behavior

    Temperature updates for each CPU core

    Screenshots

    Screen Shot 2021-12-13 at 09 23 46

    Info (please complete the following information):

    • btop++ version: 1.1.3
    • Binary: static binary from release (Homebrew)
    • Architecture: x86_64
    • Platform: macOS
    • (OSX/FreeBSD) Os release version: Big Sur 11.6
    • Terminal used: iTerm 2 & macOS Terminal
    • Font used: Fira Code
    bug 
    opened by KyleGoetke 35
  • [BUG] Link error on Btop compilation

    [BUG] Link error on Btop compilation

    Read the README.md and search for similar issues before posting a bug report!

    -Done ;-)

    Describe the bug

    Linker error for for macos 13.0.0. Linker error: ld: -rpath can only be used when targeting Mac OS X 10.5 or later

    Total gmake logs:

    PLATFORM   ?| macos
    ARCH       ?| arm64
    CXX        ?| g++-11 (11.3.0)
    THREADS    :| 8
    REQFLAGS   !| -std=c++20
    WARNFLAGS  :| -Wall -Wextra -pedantic
    OPTFLAGS   :| -O2 -ftree-loop-vectorize -flto=8
    LDCXXFLAGS :| -pthread -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS    -framework IOKit -framework CoreFoundation -Wno-format-truncation
    CXXFLAGS   +| $(REQFLAGS) $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)
    LDFLAGS    +| $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)
    
    Building btop++ (v1.0.24) macos arm64
    Compiling src/btop_tools.cpp
    Compiling src/btop_draw.cpp
    Compiling src/btop_input.cpp
    Compiling src/btop_menu.cpp
    Compiling src/btop_config.cpp
    Compiling src/btop_theme.cpp
    Compiling src/btop.cpp
    g++-11: warning: could not understand version '13.00.00'
    g++-11: warning: could not understand version '13.00.00'
    g++-11: warning: could not understand version '13.00.00'
    g++-11: warning: could not understand version '13.00.00'
    g++-11: warning: could not understand version '13.00.00'
    g++-11: warning: could not understand version '13.00.00'
    g++-11: warning: could not understand version '13.00.00'
    Compiling src/osx/btop_collect.cpp
    g++-11: warning: could not understand version '13.00.00'
    g++-11: warning: could not understand version '13.00.00'
    -> obj/btop_tools.o                (516KiB) (02s)
    g++-11: warning: could not understand version '13.00.00'
    g++-11: warning: could not understand version '13.00.00'
    g++-11: warning: could not understand version '13.00.00'
    Compiling src/osx/sensors.cpp
    -> obj/btop_input.o                (644KiB) (02s)
    g++-11: warning: could not understand version '13.00.00'
    -> obj/btop_theme.o                (680KiB) (02s)
    -> obj/btop_config.o               (740KiB) (03s)
    Compiling src/osx/smc.cpp
    g++-11: warning: could not understand version '13.00.00'
    g++-11: warning: could not understand version '13.00.00'
    g++-11: warning: could not understand version '13.00.00'
    -> obj/osx/sensors.o               ( 60KiB) (01s)
    -> obj/btop.o                      (864KiB) (03s)
    g++-11: warning: could not understand version '13.00.00'
    -> obj/osx/smc.o                   ( 28KiB) (00s)
    g++-11: warning: could not understand version '13.00.00'
    -> obj/btop_menu.o                 (1,1MiB) (04s)
    g++-11: warning: could not understand version '13.00.00'
    -> obj/osx/btop_collect.o          (2,0MiB) (06s)
    g++-11: warning: could not understand version '13.00.00'
    -> obj/btop_draw.o                 (1,8MiB) (07s)
    
    Linking and optimizing binary...
    g++-11: warning: could not understand version '13.00.00'
    ld: -rpath can only be used when targeting Mac OS X 10.5 or later
    collect2: error: ld returned 1 exit status
    gmake: *** [Makefile:210: btop] Error 1
    

    To Reproduce

    On mac M1 with osx version 13 (Ventura):
    brew install coreutils make [email protected]
    git checkout OSX
    gmake
    

    Expected behavior

    Compile btop.

    bug 
    opened by Thisora 23
  • [BUG] btop leaves bash terminal affected after closing (breaks htop use)

    [BUG] btop leaves bash terminal affected after closing (breaks htop use)

    Describe the bug

    If btop is used in the terminal (tested with gnome-terminal, uxterminal, uxterm, uterm, and lxterminal) and then closed, any subsequent launches of applications which support mouse input are messed up (like htop and dialog)

    Clicking no longer works properly with these other applications and causes strange issues in their GUI.

    To Reproduce

    Run btop and do whatever in it and close it. then run htop and notice mouse input no longer works properly

    Expected behavior

    btop does not affect other applications functionality once closed

    Screenshots

    video linked below

    Info (please complete the following information):

    • btop++ version: v1.0.23
    • Binary: static binary from release
    • Architecture: aarch64
    • Platform: linux
    • (Linux) Kernel: 4.9.140+
    • Terminal used: gnome-terminal (as well as uxterm, uxterm, uterm, and lxterminal) bash 4.4.20
    bug 
    opened by theofficialgman 21
  • Implement new ZFS pool io monitoring and the option to show ZFS pools only

    Implement new ZFS pool io monitoring and the option to show ZFS pools only

    This PR implements new ZFS pool io monitoring, compatible with newer versions of ZFS, where /proc/spl/kstat/zfs/*pool_name*/io files are not present anymore. Instead, it uses /proc/spl/kstat/zfs/*pool_name*/objset-* files, which allows for per dataset io stats.

    Also, this PR adds the zfs_pools_only option, which if enabled will hide all datasets and only show pools in disk listings, and will count io stats differently. In more detail: When zfs_pools_only is set to true:

    • In disk listings, only ZFS pools are shown
    • IO stats are calculated per pool by combining the io of all objects in the pool (all objset-* files in the pool directory, pool root included)

    When zfs_pools_only is set to false:

    • In disk listings, both ZFS pools and datasets are shown
    • IO stats are calculated per object, that is separately for ZFS pool root and each dataset (operations on datasets are not calculated towards pool root io)

    Closes #383 Partially closes #380, pools health monitoring isn't implemented

    opened by simplepad 19
  • [REQUEST] Cross compilation support

    [REQUEST] Cross compilation support

    Is your feature request related to a problem? Please describe. I want to cross-compile btop for AArch64, using Yocto project. A quick look through your Makefile tells me the experience will not be pleasent - overriding CXX is a giant red flag in my book.

    Describe the solution you'd like Best would be either fixing the Makefile, or adding CMake support. I know CMake much better than make, so I'm prepared to contribute a CMakeLists.txt if you help me understand what's going on in your Makefile. Changing := to ?= here would be a first step, but I'm not sure it would be sufficient.

    Describe alternatives you've considered I could keep a private, patched fork. But that's a stupid solution.

    Additional context The two approaches I proposed - fixing Makefile or adding CMake support - are only two possibilities, I'm sure there are other options. I want to help with this, and this issue is mostly to open discussion.

    enhancement 
    opened by jaskij 19
  • in_avail() can always be zero, it is an optimization opportunity only

    in_avail() can always be zero, it is an optimization opportunity only

    in_avail() can always return zero, so libc++'s streams does.

    So, one can not use such a technique to async cin poll.

    One can use poll/select for zero fd, but it will not work for file inputs, like in 'btop < some_file'.

    Best available option - just read input in separate thread. Also, after this commit, we will have an opportunity to remove sleep's from code, and use condition_variable timed_wait.

    Also we should always try quick_exit, instead of plain exit() call, cause:

    1. why bother with threads? let them die fast.
    2. should not overcomplicate shutdown process

    And I do not personally understand, why quick_exit disabled on Darwin... One can always use _Exit()/_exit() instead.

    opened by pg83 18
  • [BUG] Core temperature not shown on Intel CPUs supported by coretemp before SandyBridge on Linux

    [BUG] Core temperature not shown on Intel CPUs supported by coretemp before SandyBridge on Linux

    Btop does not show CPU core temperatures on Intel CPUs supported by coretemp before SandyBridge because these platforms do not support the package temperature sensor file "temp1_input" in the hwmon folder.

    This is documented in the coretemp documentation found here. https://www.kernel.org/doc/html/v5.11/hwmon/coretemp.html

    "The per-package sensor is new; as of now, it is present only in the SandyBridge platform."

    The details are found in the source code. https://elixir.bootlin.com/linux/latest/source/drivers/hwmon/coretemp.c#L460

    /*
     * Find attr number for sysfs:
     * We map the attr number to core id of the CPU
     * The attr number is always core id + 2
     * The Pkgtemp will always show up as temp1_*, if available
     */
    

    This means that on platforms before SandyBridge the coretemp entries actually start with core 0 temperature at "temp2_input" and not with package temperature at "temp1_input".

    Here a sample of an Intel Core i7 860 (codename Lynnfield) https://ark.intel.com/content/www/us/en/ark/products/41316/intel-core-i7860-processor-8m-cache-2-80-ghz.html

    > sensors -u
    coretemp-isa-0000
    Adapter: ISA adapter
    Core 0:
      temp2_input: 40.000
      temp2_max: 83.000
      temp2_crit: 99.000
      temp2_crit_alarm: 0.000
    Core 1:
      temp3_input: 40.000
      temp3_max: 83.000
      temp3_crit: 99.000
      temp3_crit_alarm: 0.000
    Core 2:
      temp4_input: 42.000
      temp4_max: 83.000
      temp4_crit: 99.000
      temp4_crit_alarm: 0.000
    Core 3:
      temp5_input: 40.000
      temp5_max: 83.000
      temp5_crit: 99.000
      temp5_crit_alarm: 0.000
    

    The btop code assumes that all temperature sensors have to start with "temp1_input" and will skip the folders where this is not the case.

    I am creating this issue before writing a fix and sending in a pull request in oder to ask for comments how the code should handle this.

    A quick fix would be to have a special handling for coretemp folders if there are entries starting with "temp2_input" and in this case set the starting index of the for loop running thru the sensors to 2 instead of 1. This would change the existing code the least and should not change the behavior for other users but looks kind of ugly.

    Please let me know what is your opinion on the matter.

    Thank you for this awesome project.

    Best regards, Christian

    To Reproduce

    • Start btop on Intel Core architecture before Sandy Bridge
    • Core temperature is not shown

    Expected behavior

    • Core temperature should be shown on CPU platforms supported by coretemp before Sandy Bridge

    Info:

    • btop++ version: 1.1.0 | btop source commit: 044927b7e5161ba40bfd4e1943e89f4fe49b5c7c
    • Binary: self compiled
    • (If compiled) Compiler and version: g++ v11.1.0
    • Architecture: x86_64
    • Platform: Linux
    • (Linux) Kernel: 5.14.16-arch1-1
    • Terminal used: Alacritty
    • Font used: DejaVu Sans Mono
    bug 
    opened by ChUnterberger 17
  • [REQUEST] Add LLVM support

    [REQUEST] Add LLVM support

    Due to missing implementations in llvm btop didn't support llvm based compilation for some time. It's now more or less possible to compile btop, with some tricks, with llvm and clang. I myself got a few llvm/musl system and I'd like to use btop on them aswell without a dependecy on gcc.

    Ad support for llvm base compilation in the makefile.

    When llvm's <ranges> implementation is complete we should rollback some workarounds.

    Notes: We need to use libc++ because clang cannot compile libstdc++'s <ranges> because it relies on concept which are not yet ready in clang. We need to enable libc++'s experimental features for <ranges> to work properly. We need to edit some flags passed to the compiler which are not known by clang.

    If this gets accepted I can open a PR.

    enhancement 
    opened by stwnt 5
  • [BUG] Weird total CPU temp reading on FreeBSD and Ryzen 9

    [BUG] Weird total CPU temp reading on FreeBSD and Ryzen 9

    I get an odd total CPU temp reading on FreeBSD and Ryzen 9, it's always -273C. The rest of the cores appear to have sane values, but they all display the same temp. Attached is a screenshot.

    [[email protected] /usr/home/mike]$ uname -a
    FreeBSD fbsd.localdomain 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-701b36961c: Thu Dec 29 19:28:32 EST 2022     [email protected]:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64
    
    [[email protected] /usr/home/mike]$ sysctl -a|grep temp
    amdtemp0: <AMD CPU On-Die Thermal Sensors> on hostb0
    vm.pfault_oom_attempts: 3
    net.inet6.ip6.use_tempaddr: 0
    net.inet6.ip6.temppltime: 86400
    net.inet6.ip6.tempvltime: 604800
    net.inet6.ip6.prefer_tempaddr: 0
            value:  /boot/kernel/amdtemp.ko
    hw.usb.template: -1
    kstat.zfs.misc.arcstats.arc_tempreserve: 0
    dev.amdtemp.0.ccd1: 42.1C
    dev.amdtemp.0.ccd0: 38.1C
    dev.amdtemp.0.core0.sensor0: 39.2C
    dev.amdtemp.0.sensor_offset: 0
    dev.amdtemp.0.%parent: hostb0
    dev.amdtemp.0.%pnpinfo: 
    dev.amdtemp.0.%location: 
    dev.amdtemp.0.%driver: amdtemp
    dev.amdtemp.0.%desc: AMD CPU On-Die Thermal Sensors
    dev.amdtemp.%parent: 
    dev.cpu.31.temperature: 39.2C
    dev.cpu.30.temperature: 39.2C
    dev.cpu.29.temperature: 39.2C
    dev.cpu.28.temperature: 39.2C
    dev.cpu.27.temperature: 39.2C
    dev.cpu.26.temperature: 39.2C
    dev.cpu.25.temperature: 39.2C
    dev.cpu.24.temperature: 39.2C
    dev.cpu.23.temperature: 39.2C
    dev.cpu.22.temperature: 39.2C
    dev.cpu.21.temperature: 39.2C
    dev.cpu.20.temperature: 39.2C
    dev.cpu.19.temperature: 39.2C
    dev.cpu.18.temperature: 39.2C
    dev.cpu.17.temperature: 39.2C
    dev.cpu.16.temperature: 39.2C
    dev.cpu.15.temperature: 39.2C
    dev.cpu.14.temperature: 39.2C
    dev.cpu.13.temperature: 39.2C
    dev.cpu.12.temperature: 39.2C
    dev.cpu.11.temperature: 39.2C
    dev.cpu.10.temperature: 39.2C
    dev.cpu.9.temperature: 39.2C
    dev.cpu.8.temperature: 39.2C
    dev.cpu.7.temperature: 39.2C
    dev.cpu.6.temperature: 39.2C
    dev.cpu.5.temperature: 39.2C
    dev.cpu.4.temperature: 39.2C
    dev.cpu.3.temperature: 39.2C
    dev.cpu.2.temperature: 39.2C
    dev.cpu.1.temperature: 39.2C
    dev.cpu.0.temperature: 39.2C
    

    Screenshot_20221230_231537

    bug 
    opened by MikeJakubik 7
  • [BUG] fcf-protection is still added when using an i686 toolchain to compile for i586/i486

    [BUG] fcf-protection is still added when using an i686 toolchain to compile for i586/i486

    This is related to this bug but is it's own issue so reporting as new.

    When using an i686 toolchain to create code that can work on all system in an initramfs setting then btop will still apply the -fcf-protection causing the compile to fail unless manually edited out of the Makefile. Is there way to add the current check to also look for march=i486 and march=i586 and disable on those configurations as well?

    Steps to reproduce

    ADDFLAGS=-march=i486 make

    Error:

    `PLATFORM ?| Linux ARCH ?| x86_64 CXX ?| g++-12 (12.2.1) THREADS :| 8 REQFLAGS !| -std=c++20 WARNFLAGS :| -Wall -Wextra -pedantic OPTFLAGS :| -O2 -ftree-loop-vectorize -flto=8 LDCXXFLAGS :| -pthread -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -fexceptions -fstack-clash-protection -fcf-protection -fstack-protector -march=i486 CXXFLAGS +| $(REQFLAGS) $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS) LDFLAGS +| $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)

    Building btop++ (v1.2.13) Linux x86_64 Compiling src/btop_config.cpp Compiling src/btop.cpp Compiling src/btop_input.cpp Compiling src/btop_menu.cpp Compiling src/btop_theme.cpp Compiling src/btop_shared.cpp Compiling src/btop_draw.cpp cc1plus: error: CPU you selected does not support x86-64 instruction set cc1plus: error: ‘-fcf-protection=full’ is not supported for this target cc1plus: error: CPU you selected does not support x86-64 instruction set cc1plus: error: ‘-fcf-protection=full’ is not supported for this target cc1plus: error: CPU you selected does not support x86-64 instruction set cc1plus: error: ‘-fcf-protection=full’ is not supported for this target make: *** [Makefile:276: obj/btop.o] Error 1 make: *** Waiting for unfinished jobs.... make: *** [Makefile:276: obj/btop_config.o] Error 1 cc1plus: error: CPU you selected does not support x86-64 instruction set cc1plus: error: ‘-fcf-protection=full’ is not supported for this target cc1plus: error: CPU you selected does not support x86-64 instruction set cc1plus: error: ‘-fcf-protection=full’ is not supported for this target make: *** [Makefile:276: obj/btop_input.o] Error 1 make: *** [Makefile:276: obj/btop_menu.o] Error 1 make: *** [Makefile:276: obj/btop_theme.o] Error 1 cc1plus: error: CPU you selected does not support x86-64 instruction set cc1plus: error: ‘-fcf-protection=full’ is not supported for this target cc1plus: error: CPU you selected does not support x86-64 instruction set cc1plus: error: ‘-fcf-protection=full’ is not supported for this target make: *** [Makefile:276: obj/btop_draw.o] Error 1 make: *** [Makefile:276: obj/btop_shared.o] Error 1 Compiling src/btop_tools.cpp cc1plus: error: CPU you selected does not support x86-64 instruction set cc1plus: error: ‘-fcf-protection=full’ is not supported for this target make: *** [Makefile:276: obj/btop_tools.o] Error 1`

    bug 
    opened by immolo 0
  • Create adwaita.theme

    Create adwaita.theme

    Add the popular Adwaita theme for people who like a theme matching GTK applications. Note: I used a 3 colors gradient while the start and mid-colors are the same, this is not a mistake, it's because using a two colors gradient it would create ugly mid-colors.

    opened by flipflop133 1
  • [fix] fix zfs on freebsd not reporting IO

    [fix] fix zfs on freebsd not reporting IO

    While processing the ZFS IO stats, nread and nwritten were getting reset every time the program examined a line in the command output, therefore when it finally was going to assign values it would always assign zeros.

    Linked to #482

    opened by simplepad 0
Releases(v1.2.13)
Owner
Downtime code generator
null
Serial Data Monitor is a multiplatform (Windows, Linux, Mac, ...) tool to interactively receive/edit/monitor data and send commands to an embedded system via the serial bus

See wiki for full documentation Serial Data Monitor Description Serial Data Monitor is a multiplatform (Windows, Linux, Mac, ...) tool to interactivel

monnoliv 4 Oct 29, 2021
The InitWare Suite of Middleware allows you to manage services and system resources as logical entities called units. Its main component is a service management ("init") system.

InitWare isn't ready to use yet!! Unless you are doing so for fun, to experiment, or to contribute, you most likely do not want to try to install Init

null 164 Dec 21, 2022
Resources gathered for reverse engineering the FNIRSI-1013D scope

# FNIRSI-1013D-Hack Resources gathered for reverse engineering the FNIRSI-1013D scope As part of what is on EEVBLOG, resources for the reverse engine

null 75 Dec 25, 2022
C++ Workshop Resources Conducted by the Intellects Forum.

cpp-workshop-resources C++ Workshop Resources Conducted by the Intellects Forum.

AMC-CSE 7 May 25, 2021
Resources for DFIR Professionals Responding to the REvil Ransomware Kaseya Supply Chain Attack

Resources for DFIR Professionals Responding to the REvil Ransomware Kaseya Supply Chain Attack Yesterday Sophos and Huntress Labs identified that Kase

Cado Security 171 Nov 18, 2022
Current and past resources for the UNSW courses I have tutored.

James' tutoring resources The home for the code/solutions/etc. from my tutorials, as well as any other resources as I see fit. Table of contents Cours

James Davidson 19 Oct 4, 2022
Competitive Programming Implementations, Resources, Solutions, and Tools

In competitive programming contests, one must write computer programs capable of solving clear-cut problems under the given contraints and limits. Most competitive programmers use C++, Java, or Python.

Dong Liu 14 Sep 23, 2021
Official ACM CSS PEC repository for resources and all things Open source

Contributing Guidelines Ahoy there! Welcome to the PEC-ACM Open Source Repository. We request you to read the whole guidelines before making any pull

PEC CSS 78 Dec 25, 2022
A list of excellent resources for anyone to deepen their understanding with regards to Windows Kernel Exploitation and general low level security.

WinKernel-Resources A list of excellent resources for anyone trying to deepen their understanding with regards to Windows Kernel Exploitation and gene

Vector Security 55 Nov 12, 2022
The Repository Contains all about Data Structure and Algorithms with Practice problems, series, and resources to follow!

?? The Complete DSA Preparation ?? This repository contains all the DSA (Data-Structures, Algorithms, 450 DSA by Love Babbar Bhaiya,STriver Series ,FA

Pawan Roshan Gupta 5 Oct 6, 2022
Design files and resources for building a wireless N64 controller

wireless-n64-controller This project and its documentation is a Work-In-Progress. I'm still working on writing everything down and working out kinks i

Spencer Fraint 35 Dec 23, 2022
Resources for JUCE-based audio development on the Raspberry Pi

JUCE4Pi Resources for JUCE-based audio development on the Raspberry Pi Raspberry Pi / Linux git clone https://github.com/juce-framework/JUCE.git sudo

null 11 Dec 6, 2022
Archive Extension Loader is a Cyberpunk 2077 mod that allows you to expand game resources that are currently not suitable for modifications without conflicts.

ArchiveXL Archive Extension Loader allows you to expand game resources that are currently not suitable for modifications without conflicts. Installati

Pavel Siberx 16 Nov 21, 2022
Metin2 Resource Dumper/Extractor Tool. Dump 100% of the resources from almost any Metin2 Client

PackDumper Metin2 Resource Dumper/Extractor Tool. Dump 100% of the resources from almost any Metin2 Client How to Compile ✔️ Clone the project and com

null 12 Aug 11, 2022
Simple library for embedding static resources into C++ binaries using CMake

libromfs libromfs is an easy way to bundle resources directly into any C++ application and access them through a simple interface. The main advantage

WerWolv 28 Nov 30, 2022
Awesome-lockfree - A collection of resources on wait-free and lock-free programming

Awesome Lock-Free A collection of resources on wait-free and lock-free programming. ?? ?? ?? Even better resource from MattPD: C++ links: atomics, loc

Erik Rigtorp 1.4k Jan 1, 2023
This tries to be a minimal cmake example, that covers sources resources dependencies and packaging.

Minimal CMake Example This project tries to be a minimal cmake example. It covers sources, resources, dependencies and packaging. I created this proje

Arne Döring 158 Dec 25, 2022
Resources and forum for the Chinese community, maintained and moderated by CoinSummer & PL.

Awesome Filecoin 请注意:本文中的链接并非全部是官方链接,部分链接是第三方链接,有些甚至是收费链接,请大家注意区分。 1. Website 1.1 浏览器 FilFox - 6Block 团队开发的 Filecoin 浏览器 Filscan - IPFS原力团队开发的 Filecoi

Filecoin 413 Jan 4, 2023
Simple Kernel Mode Data Pointer Swap, Credits To FoxiTV On UC for Great Resources About This Topic

Data-Pointer-Swap Simple Kernel Mode Data Pointer Swap, Credits To FoxiTV On UC for Great Resources About This Topic. This Source Was Made Back In Aug

null 14 Oct 25, 2022