Showing preview only (1,875K chars total). Download the full file or copy to clipboard to get everything.
Repository: aristocratos/btop
Branch: main
Commit: e895a5462685
Files: 138
Total size: 1.8 MB
Directory structure:
gitextract_90er4fjl/
├── .editorconfig
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ ├── renovate.json5
│ └── workflows/
│ ├── cmake-freebsd.yml
│ ├── cmake-linux.yml
│ ├── cmake-macos.yml
│ ├── cmake-netbsd.yml
│ ├── cmake-openbsd.yml
│ ├── continuous-build-freebsd.yml
│ ├── continuous-build-gpu.yml
│ ├── continuous-build-linux.yml
│ ├── continuous-build-macos.yml
│ ├── continuous-build-netbsd.yml
│ ├── continuous-build-openbsd.yml
│ └── test-snap-can-build.yml
├── .gitignore
├── CHANGELOG.md
├── CMakeLists.txt
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── btop.desktop
├── cmake/
│ ├── Finddevstat.cmake
│ ├── Findelf.cmake
│ ├── Findkvm.cmake
│ └── Findproplib.cmake
├── include/
│ ├── fmt/
│ │ ├── LICENSE.rst
│ │ ├── args.h
│ │ ├── base.h
│ │ ├── chrono.h
│ │ ├── color.h
│ │ ├── compile.h
│ │ ├── core.h
│ │ ├── format-inl.h
│ │ ├── format.h
│ │ ├── os.h
│ │ ├── ostream.h
│ │ ├── printf.h
│ │ ├── ranges.h
│ │ ├── std.h
│ │ └── xchar.h
│ └── widechar_width.hpp
├── manpage.md
├── snap/
│ └── snapcraft.yaml
├── src/
│ ├── btop.cpp
│ ├── btop.hpp
│ ├── btop_cli.cpp
│ ├── btop_cli.hpp
│ ├── btop_config.cpp
│ ├── btop_config.hpp
│ ├── btop_draw.cpp
│ ├── btop_draw.hpp
│ ├── btop_input.cpp
│ ├── btop_input.hpp
│ ├── btop_log.cpp
│ ├── btop_log.hpp
│ ├── btop_menu.cpp
│ ├── btop_menu.hpp
│ ├── btop_shared.cpp
│ ├── btop_shared.hpp
│ ├── btop_theme.cpp
│ ├── btop_theme.hpp
│ ├── btop_tools.cpp
│ ├── btop_tools.hpp
│ ├── config.h.in
│ ├── freebsd/
│ │ └── btop_collect.cpp
│ ├── linux/
│ │ ├── btop_collect.cpp
│ │ └── intel_gpu_top/
│ │ ├── CMakeLists.txt
│ │ ├── drm.h
│ │ ├── drm_mode.h
│ │ ├── i915_drm.h
│ │ ├── i915_pciids.h
│ │ ├── i915_pciids_local.h
│ │ ├── igt_perf.c
│ │ ├── igt_perf.h
│ │ ├── intel_chipset.h
│ │ ├── intel_device_info.c
│ │ ├── intel_gpu_top.c
│ │ ├── intel_gpu_top.h
│ │ ├── intel_name_lookup_shim.c
│ │ ├── source.txt
│ │ └── xe_pciids.h
│ ├── main.cpp
│ ├── netbsd/
│ │ └── btop_collect.cpp
│ ├── openbsd/
│ │ ├── btop_collect.cpp
│ │ ├── internal.h
│ │ ├── sysctlbyname.cpp
│ │ └── sysctlbyname.h
│ └── osx/
│ ├── btop_collect.cpp
│ ├── sensors.cpp
│ ├── sensors.hpp
│ ├── smc.cpp
│ └── smc.hpp
├── tests/
│ ├── CMakeLists.txt
│ └── tools.cpp
└── themes/
├── HotPurpleTrafficLight.theme
├── adapta.theme
├── adwaita-dark.theme
├── adwaita.theme
├── ayu.theme
├── dracula.theme
├── dusklight.theme
├── elementarish.theme
├── everforest-dark-hard.theme
├── everforest-dark-medium.theme
├── everforest-light-medium.theme
├── flat-remix-light.theme
├── flat-remix.theme
├── flexoki-dark.theme
├── flexoki-light.theme
├── gotham.theme
├── greyscale.theme
├── gruvbox_dark.theme
├── gruvbox_dark_v2.theme
├── gruvbox_light.theme
├── gruvbox_material_dark.theme
├── horizon.theme
├── kanagawa-lotus.theme
├── kanagawa-wave.theme
├── kyli0x.theme
├── matcha-dark-sea.theme
├── monokai.theme
├── night-owl.theme
├── nord.theme
├── onedark.theme
├── orange.theme
├── paper.theme
├── phoenix-night.theme
├── solarized_dark.theme
├── solarized_light.theme
├── tokyo-night.theme
├── tokyo-storm.theme
├── tomorrow-night.theme
├── twilight.theme
└── whiteout.theme
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
[*.{cpp,h,hpp,sh,md,cfg,sample}]
indent_style = tab
indent_size = 4
brace_style = same_line
[*.{yml,yaml}]
indent_style = space
indent_size = 2
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: aristocratos
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: aristocratos
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://paypal.me/aristocratos
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
labels: bug
---
**Read the README.md and search for similar issues before posting a bug report!**
<!-- Any bug that can be solved by just reading the [prerequisites](https://github.com/aristocratos/btop#prerequisites) section of the README will likely be ignored. -->
**Describe the bug**
<!-- A clear and concise description of what the bug is. -->
**To Reproduce**
<!-- Steps to reproduce the behavior. ->
**Expected behavior**
<!-- A clear and concise description of what you expected to happen. -->
**Screenshots**
<!-- If applicable, add screenshots to help explain your problem. -->
**Info (please complete the following information):**
- btop++ version: `btop --version`
- If using snap: `snap info btop`
- Binary: [self compiled or static binary from release]
- Architecture: [x86_64, aarch64, etc.] `uname -m`
- Platform: [Linux, FreeBSD, OsX]
- (Linux) Kernel: `uname -r`
- (OSX/FreeBSD) Os release version:
- Terminal used:
- Font used:
**Additional context**
<!-- Contents of `~/.local/state/btop.log` -->
<!-- Note: The snap uses: `~/snap/btop/current/.local/state/btop.log` -->
<!-- (try running btop with `--debug` flag if btop.log is empty) -->
**GDB Backtrace**
<!-- If btop++ is crashing at start the following steps could be helpful: -->
<!-- (Extra helpful if compiled with `make OPTFLAGS="-O0 -g"`) -->
<!-- 1. run (linux): `gdb btop` (macos): `lldb btop` -->
<!-- 2. `r` to run, wait for crash and press enter if prompted, CTRL+L to clear screen if needed. -->
<!-- 3. (gdb): `thread apply all bt` (lldb): `bt all` to get backtrace for all threads -->
<!-- 4. Copy and paste the backtrace here: -->
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
labels: feature
---
**Is your feature request related to a problem? Please describe.**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
**Describe the solution you'd like**
<!-- A clear and concise description of what you want to happen. -->
**Describe alternatives you've considered**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->
================================================
FILE: .github/renovate.json5
================================================
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: ["config:recommended"],
}
================================================
FILE: .github/workflows/cmake-freebsd.yml
================================================
name: FreeBSD CMake
on:
workflow_dispatch:
push:
branches: main
tags-ignore: '*.*'
paths:
- '.github/workflows/cmake-freebsd.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'include/**'
- 'src/*pp'
- 'src/freebsd/*pp'
pull_request:
branches: main
paths:
- '.github/workflows/cmake-freebsd.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'include/**'
- 'src/*pp'
- 'src/freebsd/*pp'
jobs:
build:
name: freebsd-${{ matrix.version}}-${{ matrix.arch}}
runs-on: ubuntu-24.04
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.arch }}-${{ matrix.version }}
cancel-in-progress: true
strategy:
matrix:
arch: ['aarch64', 'x86_64']
version: ['14.3', '15.0']
steps:
- uses: actions/checkout@v6
- name: Compile
uses: vmactions/freebsd-vm@v1
with:
arch: ${{ matrix.arch }}
release: ${{ matrix.version }}
usesh: true
prepare: pkg install -y cmake git ninja
run: |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
cmake --build build --verbose
ctest --test-dir build
================================================
FILE: .github/workflows/cmake-linux.yml
================================================
name: Linux CMake
on:
workflow_dispatch:
push:
branches: main
tags-ignore: '*.*'
paths:
- '.github/workflows/cmake-linux.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'include/**'
- 'src/*pp'
- 'src/linux/*pp'
pull_request:
branches: main
paths:
- '.github/workflows/cmake-linux.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'include/**'
- 'src/*pp'
- 'src/linux/*pp'
jobs:
build:
name: ${{ matrix.compiler }}-${{ matrix.version }}
runs-on: ubuntu-24.04
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.compiler }}-${{ matrix.version }}
cancel-in-progress: true
strategy:
matrix:
include:
- compiler: clang
version: 19
- compiler: clang
version: 20
- compiler: clang
version: 21
- compiler: gcc
version: 14
steps:
- uses: actions/checkout@v6
- name: Install clang ${{ matrix.version }}
if: ${{ matrix.compiler == 'clang' }}
run: wget -qO - https://apt.llvm.org/llvm.sh | sudo bash -s -- ${{ matrix.version }} all
- name: Configure
run: |
if [[ "${{ matrix.compiler }}" == "clang" ]]; then
export CC=clang-${{ matrix.version }}
export CXX=clang++-${{ matrix.version }}
export CXXFLAGS="-stdlib=libc++"
export LDFLAGS="-fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind"
else
export CC=gcc-${{ matrix.version }}
export CXX=g++-${{ matrix.version }}
fi
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
- name: Compile
run: cmake --build build --verbose
- name: Test
run: ctest --test-dir build
================================================
FILE: .github/workflows/cmake-macos.yml
================================================
name: macOS CMake
on:
workflow_dispatch:
push:
branches: main
tags-ignore: '*.*'
paths:
- '.github/workflows/cmake-macos.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'include/**'
- 'src/*pp'
- 'src/osx/*pp'
pull_request:
branches: main
paths:
- '.github/workflows/cmake-macos.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'include/**'
- 'src/*pp'
- 'src/osx/*pp'
jobs:
cmake_build_on_macos:
runs-on: macos-15
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v6
- name: Install build tools
run: |
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
brew update --quiet
brew install --force --overwrite cmake llvm lld ninja
- name: Configure
run: |
export LLVM_PREFIX="$(brew --prefix llvm)"
export LLD_PREFIX="$(brew --prefix lld)"
export CXX="$LLVM_PREFIX/bin/clang++"
export CPPFLAGS="-I$LLVM_PREFIX/include"
export LDFLAGS="-L$LLVM_PREFIX/lib -L$LLVM_PREFIX/lib/c++ -Wl,-rpath,$LLVM_PREFIX/lib/c++ -fuse-ld=$LLD_PREFIX/bin/ld64.lld"
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
- name: Compile
run: cmake --build build --verbose
- name: Test
run: ctest --test-dir build
================================================
FILE: .github/workflows/cmake-netbsd.yml
================================================
name: NetBSD CMake
on:
workflow_dispatch:
push:
branches: main
tags-ignore: '*.*'
paths:
- '.github/workflows/cmake-netbsd.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'include/**'
- 'src/*pp'
- 'src/netbsd/*pp'
pull_request:
branches: main
paths:
- '.github/workflows/cmake-netbsd.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'include/**'
- 'src/*pp'
- 'src/netbsd/*pp'
jobs:
build:
name: netbsd-${{ matrix.version }}-${{ matrix.arch }}
runs-on: ubuntu-24.04
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.arch }}-${{ matrix.version }}
cancel-in-progress: true
strategy:
matrix:
arch: ['aarch64', 'amd64']
version: ['10.1']
steps:
- uses: actions/checkout@v6
- name: Compile
uses: vmactions/netbsd-vm@v1
with:
arch: ${{ matrix.arch }}
release: ${{ matrix.version }}
usesh: true
prepare: |
export PATH="/usr/pkg/sbin:/usr/pkg/bin:$PATH"
export PKG_PATH="https://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/${{ matrix.arch }}/${{ matrix.version }}/All/"
/usr/sbin/pkg_add pkgin
pkgin -y install cmake gcc14 git ninja-build
run: |
export CXX="/usr/pkg/gcc14/bin/g++"
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
cmake --build build --verbose
ctest --test-dir build
================================================
FILE: .github/workflows/cmake-openbsd.yml
================================================
name: OpenBSD CMake
on:
workflow_dispatch:
push:
branches: main
tags-ignore: '*.*'
paths:
- '.github/workflows/cmake-openbsd.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'include/**'
- 'src/*pp'
- 'src/openbsd/*pp'
pull_request:
branches: main
paths:
- '.github/workflows/cmake-openbsd.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'include/**'
- 'src/*pp'
- 'src/openbsd/*pp'
jobs:
build:
name: openbsd-${{ matrix.version}}-${{ matrix.arch}}
runs-on: ubuntu-24.04
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.arch }}-${{ matrix.version }}
cancel-in-progress: true
strategy:
matrix:
arch: ['aarch64', 'x86_64']
version: ['7.8']
steps:
- uses: actions/checkout@v6
- name: Compile
uses: vmactions/openbsd-vm@v1
with:
arch: ${{ matrix.arch }}
release: ${{ matrix.version }}
usesh: true
prepare: pkg_add cmake git ninja
run: |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
cmake --build build --verbose
ctest --test-dir build
================================================
FILE: .github/workflows/continuous-build-freebsd.yml
================================================
name: Continuous Build FreeBSD
on:
workflow_dispatch:
push:
branches:
- main
tags-ignore:
- '*.*'
paths:
- 'src/**'
- '!src/linux/**'
- '!src/osx/**'
- '!src/netbsd/**'
- '!src/openbsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/continuous-build-freebsd.yml'
pull_request:
branches:
- main
paths:
- 'src/**'
- '!src/linux/**'
- '!src/osx/**'
- '!src/netbsd/**'
- '!src/openbsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/continuous-build-freebsd.yml'
jobs:
build-freebsd:
runs-on: ubuntu-24.04
timeout-minutes: 20
strategy:
matrix:
compiler: ["clang++", "g++"]
steps:
- uses: actions/checkout@v6
- name: Compile
uses: vmactions/freebsd-vm@v1
with:
release: '14.3'
usesh: true
prepare: |
pkg install -y gmake gcc15 coreutils git lowdown
git config --global --add safe.directory /home/runner/work/btop/btop
run: |
if [ "${{ matrix.compiler }}" == "g++" ]; then
CXX=g++15
COMPILER=gcc
else
CXX=clang++
COMPILER=llvm
fi
gmake STATIC=true STRIP=true
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
mv bin/btop bin/btop-"$COMPILER"-"$GIT_HASH"
ls -alh bin
- uses: actions/upload-artifact@v7
with:
name: btop-x86_64-freebsd-14-${{ matrix.compiler }}
path: 'bin/*'
if-no-files-found: error
================================================
FILE: .github/workflows/continuous-build-gpu.yml
================================================
name: Continuous Build Gpu
on:
workflow_dispatch:
push:
branches:
- main
tags-ignore:
- '*.*'
paths:
- 'src/**'
- '!src/osx/**'
- '!src/freebsd/**'
- '!src/netbsd/**'
- '!src/openbsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/continuous-build-gpu.yml'
pull_request:
branches:
- main
paths:
- 'src/**'
- '!src/osx/**'
- '!src/freebsd/**'
- '!src/netbsd/**'
- '!src/openbsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/continuous-build-gpu.yml'
jobs:
gpu_build_linux:
runs-on: ubuntu-24.04
container: alpine:edge
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v6
- name: Install build tools
run: apk add --no-cache --update gcc g++ make linux-headers
- name: Compile
run: make CXX=g++ GPU_SUPPORT=true
================================================
FILE: .github/workflows/continuous-build-linux.yml
================================================
name: Continuous Build Linux
on:
workflow_dispatch:
push:
branches: main
tags-ignore: '*.*'
paths:
- 'src/**'
- '!src/osx/**'
- '!src/freebsd/**'
- '!src/netbsd/**'
- '!src/openbsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/continuous-build-linux.yml'
pull_request:
branches: main
paths:
- 'src/**'
- '!src/osx/**'
- '!src/freebsd/**'
- '!src/netbsd/**'
- '!src/openbsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/continuous-build-linux.yml'
jobs:
build:
runs-on: ubuntu-24.04
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.toolchain }}
cancel-in-progress: true
continue-on-error: true
strategy:
matrix:
toolchain:
- aarch64-unknown-linux-musl
- arm-unknown-linux-musleabi
- arm-unknown-linux-musleabihf
- armv7-unknown-linux-musleabi
- armv7-unknown-linux-musleabihf
- i586-unknown-linux-musl
- i686-unknown-linux-musl
- m68k-unknown-linux-musl
- mips-unknown-linux-musl
- mips-unknown-linux-muslsf
- mips64-unknown-linux-musl
- mips64el-unknown-linux-musl
- mipsel-unknown-linux-musl
- mipsel-unknown-linux-muslsf
- powerpc-unknown-linux-musl
- powerpc64-unknown-linux-musl
- powerpc64le-unknown-linux-musl
- powerpcle-unknown-linux-musl
- riscv32-unknown-linux-musl
- riscv64-unknown-linux-musl
- s390x-ibm-linux-musl
- x86_64-unknown-linux-musl
steps:
- uses: actions/checkout@v6
- name: Install cross toolchain
run: |
wget -q -P /tmp https://github.com/cross-tools/musl-cross/releases/download/20250929/${{ matrix.toolchain }}.tar.xz
wget -q -P /tmp https://github.com/cross-tools/musl-cross/releases/download/20250929/${{ matrix.toolchain }}.tar.xz.sha256
echo "$(cat /tmp/${{ matrix.toolchain }}.tar.xz.sha256) /tmp/${{ matrix.toolchain }}.tar.xz" | sha256sum --check --status
mkdir -p /opt/x-tools/
tar -xf /tmp/${{ matrix.toolchain }}.tar.xz -C /opt/x-tools
- name: Compile
run: CXX=/opt/x-tools/${{ matrix.toolchain }}/bin/${{ matrix.toolchain }}-g++ make STATIC=true STRIP=true
- name: Create binary artifacts
run: |
TOOLCHAIN=${{ matrix.toolchain }}
GIT_HASH=$(git rev-parse --short "${{ github.sha }}")
FILENAME=btop-${TOOLCHAIN/linux-musl/}-$GIT_HASH
mv bin/btop bin/$FILENAME
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: btop-${{ matrix.toolchain }}
path: '${{ github.workspace }}/bin/*'
================================================
FILE: .github/workflows/continuous-build-macos.yml
================================================
name: Continuous Build MacOS
on:
workflow_dispatch:
push:
branches:
- main
tags-ignore:
- '*.*'
paths:
- 'src/**'
- '!src/linux/**'
- '!src/freebsd/**'
- '!src/netbsd/**'
- '!src/openbsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/continuous-build-macos.yml'
pull_request:
branches:
- main
paths:
- 'src/**'
- '!src/linux/**'
- '!src/freebsd/**'
- '!src/netbsd/**'
- '!src/openbsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/continuous-build-macos.yml'
jobs:
build-macos:
strategy:
matrix:
os:
# - {runner: 'macos-13', version: 'Ventura'}
- {runner: 'macos-14', version: 'Sonoma'}
- {runner: 'macos-15', version: 'Sequoia'}
runs-on: ${{ matrix.os.runner }}
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- uses: actions/checkout@v6
- name: Install build tools
run: |
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
brew update --quiet
brew install --force --overwrite gcc@15 lowdown
- name: Compile
run: |
make CXX=$(brew --prefix)/bin/g++-15
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
mv bin/btop bin/btop-arm64-${{ matrix.os.runner }}-${{ matrix.os.version }}-$GIT_HASH
ls -alh bin
- uses: actions/upload-artifact@v7
with:
name: btop-arm64-${{ matrix.os.runner }}-${{ matrix.os.version }}
path: 'bin/*'
================================================
FILE: .github/workflows/continuous-build-netbsd.yml
================================================
name: Continuous Build NetBSD
on:
workflow_dispatch:
push:
branches:
- main
tags-ignore:
- '*.*'
paths:
- 'src/**'
- '!src/linux/**'
- '!src/osx/**'
- '!src/freebsd/**'
- '!src/openbsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/continuous-build-netbsd.yml'
pull_request:
branches:
- main
paths:
- 'src/**'
- '!src/linux/**'
- '!src/osx/**'
- '!src/freebsd/**'
- '!src/openbsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/continuous-build-netbsd.yml'
jobs:
build-netbsd:
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
- name: Compile
uses: vmactions/netbsd-vm@v1
with:
release: '10.1'
usesh: true
prepare: |
PATH="/usr/pkg/sbin:/usr/pkg/bin:$PATH"
PKG_PATH="https://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/10.1/All/"
export PATH PKG_PATH
/usr/sbin/pkg_add pkgin
pkgin -y install gmake gcc14 coreutils git
git config --global --add safe.directory /home/runner/work/btop/btop
run: |
gmake CXX=/usr/pkg/gcc14/bin/g++ CXXFLAGS='-DNDEBUG -I/usr/pkg/gcc10/include -I/usr/include -I/usr/pkg/include' STATIC=true STRIP=true
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
mv bin/btop bin/btop-GCC10-"$GIT_HASH"
ls -alh bin
- uses: actions/upload-artifact@v7
with:
name: btop-x86_64-netbsd-9.3
path: 'bin/*'
if-no-files-found: error
================================================
FILE: .github/workflows/continuous-build-openbsd.yml
================================================
name: Continuous Build OpenBSD
on:
workflow_dispatch:
push:
branches:
- main
tags-ignore:
- '*.*'
paths:
- 'src/**'
- '!src/linux/**'
- '!src/osx/**'
- '!src/freebsd/**'
- '!src/netbsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/continuous-build-openbsd.yml'
pull_request:
branches:
- main
paths:
- 'src/**'
- '!src/linux/**'
- '!src/osx/**'
- '!src/freebsd/**'
- '!src/netbsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/continuous-build-openbsd.yml'
jobs:
build-openbsd:
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
- name: Compile
uses: vmactions/openbsd-vm@v1
with:
release: '7.8'
usesh: true
prepare: |
pkg_add gmake coreutils git lowdown
git config --global --add safe.directory /home/runner/work/btop/btop
run: |
gmake STATIC=true STRIP=true
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
mv bin/btop bin/btop-"$GIT_HASH"
- uses: actions/upload-artifact@v7
with:
name: btop-x86_64-openbsd-7.8
path: 'bin/*'
if-no-files-found: error
================================================
FILE: .github/workflows/test-snap-can-build.yml
================================================
name: 🧪 Test snap can be built on x86_64
on:
workflow_dispatch:
push:
branches: [ main ]
tags-ignore:
- '*.*'
paths:
- 'src/**'
- '!src/osx/**'
- '!src/freebsd/**'
- '!src/netbsd/**'
- '!src/openbsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/test-snap-can-build.yml'
- 'snap/snapcraft.yaml'
pull_request:
branches: [ main ]
paths:
- 'src/**'
- '!src/osx/**'
- '!src/freebsd/**'
- '!src/netbsd/**'
- '!src/openbsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/test-snap-can-build.yml'
- 'snap/snapcraft.yaml'
jobs:
build:
runs-on: ubuntu-24.04
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v6
- uses: snapcore/action-build@v1
id: build
- uses: diddlesnaps/snapcraft-review-action@v1
with:
snap: ${{ steps.build.outputs.snap }}
isClassic: 'false'
================================================
FILE: .gitignore
================================================
# gitginore template for creating Snap packages
# website: https://snapcraft.io/
parts/
prime/
stage/
*.snap
# Snapcraft global state tracking data(automatically generated)
# https://forum.snapcraft.io/t/location-to-save-global-state/768
/snap/.snapcraft/
# Source archive packed by `snapcraft cleanbuild` before pushing to the LXD container
/*_source.tar.bz2
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# Compiled man page
btop.1
build
bin
btop
/obj/
config.h
.*/
# Optional libraries
lib/rocm_smi_lib
# Don't ignore .github directory
!.github/
# Ignore files created by Qt Creator
*.config
*.creator
*.creator.user
*.creator.user.*
*.cflags
*.cxxflags
*.files
*.includes
# CMake
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
CMakeUserPresets.json
# CLion
cmake-build-*
================================================
FILE: CHANGELOG.md
================================================
## v1.4.6
References | Description | Author(s)
--- | --- | ---
#1272 | Skip 'H' and 'HX' suffix in AMD cpu name trimming | @ramdomPTM
#1268 | feature: add process renice functionality | @goddamnparticle
#1285 | Revert "Use /sys/dev/block/MAJOR:MINOR instead of /sys/block/NAME for disk I/O" #1270 | @deckstose
#1277 | feat: Introduce cpu frequency display modes | @emiliopedrollo
#1282 | Fix CPU frequency detection for LoongArch CPUs | @Twopic2
#1275 | fix arrow keys that send 'O' instead of '[' | @vandabbin
#1251 | OpenBSD: battery: add support for watthour and watts sensors | @shtrophic
#1208 | Add Gotham theme | @jrebs
#1291 | Fix macOS deadlocks and race conditions in collector threads #1292 | @kuzmeech
#1296 | fix: btop crash on arm cpu | @emiliopedrollo @zenofile
#984 | Added ability to set which gpu vendors to enable | @thedustinmiller
#1274 | added tree toggle of expand/collapse for children of process | @irabrine
#1300 | Use right key codes to match f1 and f2 keys | @vandabbin
#1305 | Handle missing SMC gracefully on macOS | @achille
#1309 | Fix redraw in proc list when changing sort order | @vandabbin
#1304 | Fix load average and GPU watts leaking past box border | @vandabbin
#1220 | feat: respect effective cpus from cgroup | @deckstose
#1218 | feat: display container engine | @deckstose
#1315 | feat: raise cpp standard to c++23 | @deckstose
d0cbaf7 | Add configuration toggle for terminal synchronization | @aristocratos
#1306 | Implement feat Process list pausing | @vandabbin
#1322 | flip name, command, and user sorting | @vandabbin
#1334 | fix tty theme for pause banner | @vandabbin
#1325 | test: add test harness with ctest | @deckstose
#1339 | fix: skip first argument of argv | @AlvaroParker
#1357 | feat: add --themes-dir flag | @adeci
#1359 | fix: don't over-/underflow when parsing --update argument | @yinghao-w
#1362 | fix segfault on musl systems | @v1cont
#1363 | Pass only static duration strings to Config::set in Config::apply_preset | @yinghao-w
#1366 | fix: cpu per-thread totals not reaching 100% | @Tom94
#1367 | Fix: Align boxes when Cpu bottom and Gpu on | @yinghao-w
#1372 | Minor fixes and improvements for NetBSD | @fraggerfox
#1377 | Fixed GPU rendering | @TheSovietPancakes
#1379 | Fix: Always collect GPU data when cpu_graph_lower = "Auto" | @yinghao-w
#1393 | Fix: humanized units shortening | @yinghao-w
#1401 | Feat: add mouse dragging of scrollbar | @yinghao-w
#1399 | feat: add cli option to dump default config | @deckstose
e969f43 | Added "save_config_on_exit" option to configuration | @aristocratos
## v1.4.5
References | Description | Author(s)
--- | --- | ---
#1254 | Bump bundled fmt to 12.0.0 | @deckstose
#1242 | Enable vim movement in help menu | @botantony
#948 | Remove reduntant symbols in tree view | @Denizantip
#1249 | Use /sys/dev/block/MAJOR:MINOR instead of /sys/block/NAME for disk I/O | @CountBleck
#1227 | feat: display CPU power draw & fix GPU+load avg overwriting core info | @Tom94 and @YuriiShkrobut
4f5abbb | Fix locale issues | @aristocratos
#1165 | Add encode and decode meters on Nvidia GPUs | @sam-kirby
#1197 | linux: Battery Time-to-full | @RadsammyT
#1203 | Convert ascii escape codes in mountpoint names before reading statvfs | @deckstose
#1198 | Fix presets erroring with gpu* usage | @entropylost
#1191 | Fix --tty/--no-tty flag having no effect | @deckstose
## v1.4.4
References | Description | Author(s)
--- | --- | ---
#1185 | Fix auto-detection of CPU temp on Ampere boards | @bexcran
589c133 | Fixed floating_humanizer() to work correctly when numeric delimiter isn't a dot. | @aristocratos
#1157 | Add command line option to set an inital filter | @imwints
#1172 | Make 100ms the minimal refresh rate. Exit gracefully if integer conversion in CLI parser fails. | @imwints
#1031 | Lock/unlock config to avoid infinite recursion | @Jacajack
#1156 | Fix incorrect positioning and start symbol of second title introduced in 2538d89 | @xDMPx
ffcd064 | Fix dangling reference warnings for GCC 13 and later | aristocratos
## v1.4.3
References | Description | Author(s)
--- | --- | ---
c3b225f | Revert e266ccd which broke str_to_upper() and str_to_lower() | @aristocratos
#1137 | Enable additional checks in libc++ with the new hardening mode | @imwints
#1135 | Remove redundant optimization flag | @imwints
#1139 | Ignore incomplete filter regex, issue #1133 | @imwints
## v1.4.2
References | Description | Author(s)
--- | --- | ---
f1482fe | Fix process arguments appearing outside proc box by replacing ASCII control codes with blankspace, issue #1080 | @aristocratos
#1130 | Fix problems shown by clang-tidy's performance checks | @imwints
#1120 | Fix wrong error message and documentation of renamed option --utf-force | @t-webber @imwints
#1128 | Flatten cmake module path | @imwints
#1129 | CMake: Remove option to use mold | @imwints
#1047 | Update Terminus font link, fix typo, spelling, and grammar | @QinCai-rui
#929 | Please clang with sanitizers | @bad-co-de
#1126 | Fix MacOS tree-mode + aggregate memory/thread scaling issue | @xaskii
#993 | Fix typo: Mhz -> MHz | @NyCodeGHG
## v1.4.1
References | Description | Author(s)
--- | --- | ---
#1111 #1112 | Various code fixes | @imwints
#930 #931 | Various code fixes | @bad-co-de
#1061 | Fixed typo | @polluks
#1110 | Move the config parser in it's own module | @imwints
#1101 | Adding a menu option to show bitrates in base 10 separate from the setting to show bytes/bits in base 10 | @georgev93
#1079 | Allow MidnightBSD to build btop using the existing freebsd support. | @laffer1
#1098 | Use XDG_STATE_HOME to save logs | @imwints
#1092 | Bump CMake version to 3.25 required for LINUX variable | @imwints
#1058 | Replace brackets with arrows in net and proc box | @taha-yassine
#1091 | Bump bundled fmt to 11.1.4 | @imwints
#725 | cmake: link to CMAKE_DL_LIBS | @alalazo
#990 | Fix phoenix-night.theme marked as executable | @sertonix
#1034 | Add Kanagawa-lotus and Kanagawa-wave themes | @philikarus
#973 | Bump NetBSD version to 10.1 and FreeBSD version to 14.2. | @fraggerfox
#1072 | Add dark version of adwaita theme: adwaita-dark | @k0tran
#1036 | Resetting last selection on page navigation in optionsMenu to avoid unordered_map error | @seth-wood
#1029 | Share the CPU name trimming code between platforms | @yarrick
#1033 | Update Ryzen name trimming | @yarrick
#1030 | Drop macos 12 build, add v14 and v15 | @yarrick
#1028 | Fix cmake-macos workflow | @yarrick
#1027 | Bump version of deprecated upload-artifact step | @yarrick
#1025 | Update obsolete egrep call | @tywkeene
b52069c | Fix menu crash when GPU_SUPPORT=false, issue #989 | @aristocratos
#961 | Add 'Everforest Ligth Medium' theme | @mstuttgart
#960 | Support intel GPUs before Gen-6 (patch from upstream) | @w8jcik
#958 | intel_name_lookup_shim.c (get_intel_device_name): Fix SEGFAULT | @artyom-poptsov
2e7208d | Fix rsmi_measure_pcie_speeds not saving, issue #934 | @aristocratos
f3446ed | Show GPU Watt fractions when below 100W | @aristocratos
| + more from @imwints @aristocratos
Big thanks to @imwints for helping out with project maintenance, PR reviews and merging!
## v1.4.0
References | Description | Author(s)
--- | --- | ---
#703 | NetBSD Support | @fraggerfox
#903 | Intel GPU support | @bjia56
161e8f4 | Added warnings when toggling boxes and terminal size is to small | @aristocratos
4210f5f | Fix missing core percentages, issue #792 | @aristocratos
35857f8 | Various fixes for drawing GPU related information | @aristocratos
#879 | fix divide 0 error when caculating disk usage percentage (#791) | @flylai
#884 | fix io_graph_speeds parsing | @feihtthief
#863 | V1 of Phoenix Night theme | @Firehawke
3f384c0 | Fixed missing CPU core temps when too small to show core temp graphs, issues #792 #867 | @aristocratos
97d2fb5 | Fixed missing IO graphs in IO mode, issue #867 | @aristocratos
#840 | fix zero temp (#467) | @joske
#850 | Fix comments (parsing) in theme files | @acidghost
#806 | Add regex filtering | @imwints
#836 | Fix typo in file existences check for voltage_now | @vsey
#835 | Show time in days when remaining battery exceeds an estimation of 24h | @imwints
#819 | (AMD Gpu) fix pwr_usage not being defined correctly during rsmi collection | @kalkafox
#831 | macOS: fix crash if there exists a uid not associated with any user | @thecoder-001
#796 | Fix rsmi device name buffer size | @davc0n
#807 | Add gruvbox_light theme | @kk9uk
#724 | Create man page for btop in Markdown | @ottok
#734 | Include metadata in binary version output `btop --version` | @imwints
#771 | collect: Fix reading of battery power draw on Linux | @Derppening
## v1.3.2
Description | Author(s) | References
--- | --- | ---
fix: Can't detect librocm 6.0.x | @imwints, @aristocratos | #761
## v1.3.1
Description | Author(s) | References
--- | --- | ---
GPU: Added support for dynamic loading of ROCm v6 libraries | @aristocratos, @fxzjshm | 5511131, #737
Increase max network interface name to 15 | @tessus | #714
Fix OpenBSD UTF-8 locale detection | @lcheylus, @imwints | #753, #717
Add hot-reloading of config file with CTRL+R or SIGUSR2 signal | @MartinPit | #722
Add battery power draw for linux and freebsd | @vsey | #689
Fix crash caused by string exception when cpu clock is exactly between 999.5 and 999.9 Mhz | @rkmcode | #735
Write newline at end of config file | @planet36 | #743
Add theme based on Everforest Dark Medium palette | @M-Sviridov | #746
fix: don't mangle memory for zombie processes | @joske | #747
Share common code from collect | @imwints | #756
Fixed incorrect used and available memory for OSX | | 4461a43
## v1.3.0
* Added Gpu Support Linux | @romner-set | PR #529
* Added platform support for OpenBSD | @joske | PR #607
* Enable macos clang | @muneebmahmed | PR #666
* Fix Apple Silicon CPUs misprinted | @masiboss | PR #679
* Cmake support for MacOS | @imwints | PR #675
* Elementarish theme: color update according to Elementary palette | @stradicat | PR #660
* Add alternative key codes for Delete, Insert, Home, End | @ivanp7 | PR #659
* Fix scrollbar not clearing sometimes. | @DecklynKern | PR #643
* Add keybind for toggling memory display mode in PROC box | @rahulaggarwal965 | PR #623
* Minor string initialization improvement | @imwints | PR #636
* Made disks statvfs logic asynchronous. | @crestfallnatwork | PR #633
* Fix signal list on non-linux/weird linux platforms | @lvxnull | PR #630
* Add option to accumulate a child's resources in parent in tree-view | @imwints | PR #618
* Add CMake support for Linux | @imwints | PR #589
* Horizon theme | @SidVeld | PR #610
* Fix short conversion of 1000-1023 *iB | @scorpion-26 | #609
* Fix integer overflows in btop_collect.cpp | @dorrellmw | #546
* Support compiling with LLVM | @imwints | #510
* Fix getting zfs pool name with '.' char in freebsd | @jfouquart | #602
* [macos/freebsd] support gcc13 | @joske | #600
* FreeBSD swap info | @rrveex | #560
* Create adwaita.theme | @flipflop133 | #485
* Try get terminal size of "/dev/tty" if stdout fails | @imwints | PR #627
* Refresh rate program argument | @imwints | PR #640
* Improved error handling when determining the config directory | @imwints | #652
* Use native POSIX polling syscalls to read input | @lvxnull | #624
* Conditional compile on Big Sur and up | @joske | PR #690
+ Various fixes by @imwints, @simplepad, @joske, @gwena, @cpalv, @iambeingtracked, @mattico, @NexAdn
## v1.2.13
* Makefile: VERBOSE=true flag for Makefile to display all compiler commands and fixed so already set CXXFLAGS and LDFLAGS are displayed.
* Makefile: Added autodetection for gcc12 to make compiling on macos Ventura easier.
* 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
* Fixed: Ignore disks that fails in statvfs64() to avoid slowdowns and possible crashes.
* Fixed: Moved up get_cpuHz() in the execution order to get better cpu clock reading.
* Added: proc tree view: if there's more than 40 width left, try to print full cmd, by @Superty
* Fixed: Show the first IP of the interface in NET box instead of the last, by @correabuscar
* Changed: Replace getnameinfo with inet_ntop [on Linux], by @correabuscar
* Fixed: Not picking up last username from /etc/passwd
* Fixed: Process nice value underflowing, issue #461
* Changed: Replace getnameinfo with inet_ntop [on FreeBSD], by @correabuscar
* Changed: Replace getnameinfo with inet_ntop [on macos], by @correabuscar
## v1.2.12
* Added: Dynamic updating of max number of CPU cores.
## v1.2.11
* Fixed: Number of cores wrongly detected for Ryzen in rare cases.
## v1.2.10
* Fixed: Process tree filtering not case insensitive
* Added: Paper theme, by @s6muel
* Fixed: Extra checks to avoid crash on trying to replace empty strings in tree mode
* Fixed: Crashing when cores are offline
* Fixed: Cpu::collect() core count counter...
* Changed: Using sysconf(_SC_NPROCESSORS_CONF) for number of cores instead of sysconf(_SC_NPROCESSORS_ONLN)
* Maintenance: Code cleanup, by @stefanos82
## v1.2.9
* Fixed: Memory values not clearing properly when not in graph mode in mem box
* Changed: kyli0x theme color update, by @kyli0x
* Added: Elementarish theme, by @dennismayr
* Added: key "?" to see help, by @mohi001
* Added: solarized_light theme, by @Fingerzam
* Changed: Made ZFS stats collection compatible with zfs_pools_only option, by @simplepad
* Changed: Rewrite of process sorting and tree generation including fixes for tree sorting and mouse support
* Added: Option to hide the small cpu graphs for processes
* Changed: Small graphs now show colors for each character
* Fixed: Getting selfpath on macos (fix for finding theme folder)
## v1.2.8
* Added: Support for ZFS pool io stats monitoring, by @simplepad
* Added: Filtering of kernel processes, by @0xJoeMama
* Added: New theme everforest-dark-hard, by @iambeingtracked
* Added: New theme tomorrow-night, by @appuchias
* Changed: Disable battery monitoring if it fails instead of exiting
## v1.2.7
* Fixed: Disk IO stats for individual partitions instead of whole disk (Linux)
* Added: Case insensitive process filtering, by @abrasumente233
* Added: Include ZFS ARC in cached/available memory on Linux, by @mattico
* Added: Desktop entry and icons, by @yonatan8070
* Fixed: Net sync scale bug
* Added: tokyo-night & tokyo-storm themes, by @Schievel1
## v1.2.6
* Fixed: Wrong memory unit when shorten and size is less than 10, by @mohi001
* Fixed: Use cpu cores average temp if missing cpu package temp for FreeBSD
* Changed: Enter symbol to a more common variant
## v1.2.5
* Fixed: Fallback to less accurate UTF8 char count if conversion to wstring fails
* Fixed: Small ui fixes for mem and disks
* Added: New theme HotPurpleTrafficLight, by @pallebone
* Fixed: title_left symbol between auto and zero in the net box is not displayed, by @mrdotx
* Fixed: Mouse mappings for net box
## v1.2.4
* Optimization: Proc::draw()
* Fixed: Ignore duplicate disks with same mountpoint
* Changed: Restrict command line for processes to 1000 characters to fix utf8 conversion errors
* Added: add "g" and "G" to vim keys, by @mohi001
## v1.2.3
* Changed: floating_humanizer() now show fractions when shortened and value is < 10
* Fixed: Process tree not redrawing properly
* Fixed: string to wstring conversion crash when string is too big
## v1.2.2
* Changed: Reverted uncolor() back to using regex to fix delay in opening menu when compiled with musl
* Added: Toggle for showing free disk space for privileged or normal users
* Added: Clarification on signal screen that number can be manually entered
## v1.2.1
* Added: Arrow only after use of "f" when filtering processes, by @NavigationHazard
* Fixed: Fx::uncolor not removing all escapes
* Fixed: Text alignment for popup boxes
* Fixed: Terminal resize warning getting stuck
* Removed: Unnecessary counter for atomic_lock
* Added: Percentage progress to Makefile
* Fixed: Alignment of columns in proc box when wide UTF8 characters are used
* Fixed: Battery meter draw fix
## v1.2.0
* Added: Support for FreeBSD, by @joske and @aristocratos
* Fixed (again): Account for system rolling over net speeds in Net::collect()
* Added: Theme gruvbox_material_dark, by @marcoradocchia
* Added: Option for base 10 bytes/bits
## v1.1.5
* Fixed: Account for system rolling over net speeds in Net::collect()
## v1.1.4
* Fixed: Create dependency files in build directory when compiling, by @stwnt
* Fixed: fix CPU temp fallback on macOS, by @joske
* Changed: From rng::sort() to rng::stable_sort() for more stability
* Fixed: in_avail() can always be zero, by @pg83
## v1.1.3
* Added: New theme ayu, by @AlphaNecron
* Added: New theme gruvbox_dark_v2, by @pietryszak
* Fixed: Macos cpu coretemp for Intel, by @joske
* Added: New theme OneDark, by @vtmx
* Fixed: Fixed network graph scale int rollover
* Fixed: Suspected possibility of very rare stall in Input::clear()
## v1.1.2
* Fixed: SISEGV on macos Mojave, by @mgradowski
* Fixed: Small optimizations and fixes to Mem::collect() and Input::get()
* Fixed: Wrong unit for net_upload and net_download in config menu
* Fixed: UTF-8 detection on macos
* Fixed: coretemp iteration due to missing tempX_input, by @KFilipek
* Fixed: coretemp ordering
## v1.1.1
* Added: Partial static build (libgcc, libstdc++) for macos
* Changed: Continuous build macos switched to OSX 11.6 (Big Sur) and partial static build
* Changed: Release binaries for macos switched to OSX 12 (Monterey) and partial static build
## v1.1.0
* Added: Support for OSX, by @joske and @aristocratos
## v1.0.24
* Changed: Collection ordering
* Fixed: Restore all escape seq mouse modes on exit
* Fixed: SIGINT not cleaning up on exit
## v1.0.23
* Fixed: Config parser missing first value when not including version header
* Fixed: Vim keys menu lists selection
* Fixed: Stall when clearing input queue on exit and queue is >1
* Fixed: Inconsistent behaviour of "q" key in the menus
## v1.0.22
* Fixed: Bad values for disks and network on 32-bit
## v1.0.21
* Fixed: Removed extra spaces in cpu name
* Added: / as alternative bind for filter
* Fixed: Security issue when running with SUID bit set
## v1.0.20
* Added: Improved cpu sensor detection for Ryzen Mobile, by @adnanpri
* Changed: Updated makefile
* Changed: Regex for Fx::uncolor() changed to string search and replace
* Changed: Removed all use of regex with dedicated string functions
## v1.0.19
* Fixed: Makefile now tests compiler flag compatibility
## v1.0.18
* Fixed: Makefile g++ -dumpmachine failure to get platform on some distros
## v1.0.17
* Changed: Reverted mutexes back to custom atomic bool based locks
* Added: Static binaries switched to building with musl + more platforms, by @jan-guenter
* Fixed: Improved battery detection, by @jan-guenter
* Added: Displayed battery selectable in options menu
* Fixed: Battery error if non existent battery named is entered
## v1.0.16
* Fixed: atomic_wait() and atomic_lock{} use cpu pause instructions instead of thread sleep
* Fixed: Swapped from atomic bool spinlocks to mutexes to fix rare deadlock
* Added: Continuous Build workflow for OSX branch, by @ShrirajHegde
* Changed: Reverted thread mutex lock to atomic bool with wait and timeout
* Changed: Removed unnecessary async threads in Runner thread
* Added: Try to restart secondary thread in case of stall and additional error checks for ifstream in Proc::collect()
* Fixed: change [k]ill to [K]ill when enabling vim keys, by @jlopezcur
## v1.0.15
* Fixed: Extra "root" partition when running in snap
* Changed: Limit atomic_wait() to 1000ms to fix rare stall
* Fixed: Removed unneeded lock in Runner::run()
* Added: Toggle in options for enabling directional vim keys "h,j,k,l"
## v1.0.14
* Changed: Total system memory is checked at every update instead of once at start
* Added: Continuous Build workflow, by @ShrirajHegde
* Fixed: Uid -> User fallback to getpwuid() if failure for non static builds
* Fixed: snap root disk and changed to compiler flags instead of env variables for detection
* Added: Development branch for OSX, by @joske
## v1.0.13
* Changed: Graph empty symbol is now regular whitespace
## v1.0.12
* Fixed: Exception handling for faulty net download/upload speed
* Fixed: Cpu percent formatting if over 10'000
## v1.0.11
* Changed: atomic_wait to use while loop instead of wait() because of rare stall when a signal handler is triggered while waiting
* Fixed: Get real / mountpoint when running inside snap
* Fixed: UTF8 set LANG and LC_ALL to empty before UTF8 search and fixed empty error msg on exit before signal handler init
* Changed: Init will continue with a warning if UTF-8 locale are detected and it fails to set the locale
## v1.0.10
* Added: Wait for terminal size properties to be available at start
* Changed: Stop second thread before updating terminal size variables
* Changed: Moved check for valid terminal dimensions to before platform init
* Added: Check for empty percentage deques
* Changed: Cpu temp values check for existing values
* Fixed: Cpu percent cutting off above 1000 percent and added scaling with "k" prefix above 10'000
* Fixed: Crash when rapidly resizing terminal at start
## v1.0.9
* Added: ifstream check and try-catch for stod() in Tools::system_uptime()
* Fixed: Freeze on cin.ignore()
## v1.0.8
* Fixed: Additional NULL checks in UTF-8 detection
* Changed: Makefile: Only look for g++-11 if CXX=g++
* Fixed: Missing NULL check for ttyname
* Changed: Only log tty name if known
## v1.0.7
* Fixed: Crash when opening menu at too small size
* Fixed: Cores not constrained to cpu box and core numbers above 100 cut off
* Fixed: Scrollbar position incorrect in small lists and selection not working when filtering
## v1.0.6
* Fixed: Check that getenv("LANG") is not NULL in UTF-8 check
* Fixed: Processes not completely hidden when collapsed in tree mode
* Fixed: Changed wrong filename error.log to btop.log
## v1.0.5
* Fixed: Load AVG sizing when hiding temperatures
* Fixed: Sizing constraints bug on start and boxes can be toggled from size error screen
* Fixed: UTF-8 check crashing if LANG was set to non existent locale
## v1.0.4
* Fixed: Use /proc/pid/statm if RSS memory from /proc/pid/stat is faulty
## v1.0.3
* Fixed: stoi 0 literal pointer to nullptr and added more clamping for gradient array access
## v1.0.2
* Fixed: ARCH detection in Makefile
* Fixed: Color gradient array out of bounds, added clamp 0-100 for cpu percent values
* Fixed: Menu size and preset size issues and added warnings for small terminal size
* Fixed: Options menu page selection alignment
## v1.0.1
* Fixed: UTF-8 check to include UTF8
* Fixed: Added thread started check before joining in clean_quit()
* Fix documentation of --utf-force in README and --help. by @purinchu
## v1.0.0
* First release for Linux
================================================
FILE: CMakeLists.txt
================================================
# SPDX-License-Identifier: Apache-2.0
#
# CMake configuration for btop
#
cmake_minimum_required(VERSION 3.25)
# Disable in-source builds since they would override the Makefile
if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
message(FATAL_ERROR "In-source builds are not allowed")
endif()
project("btop"
DESCRIPTION "A monitor of resources"
HOMEPAGE_URL "https://github.com/aristocratos/btop"
LANGUAGES CXX
)
include(CheckIPOSupported)
include(CMakeDependentOption)
# Make our Find<Package>.cmake files available
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_COLOR_DIAGNOSTICS ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(BTOP_STATIC "Link btop statically" OFF)
option(BTOP_GPU "Enable GPU support" ON)
cmake_dependent_option(BTOP_RSMI_STATIC "Link statically to ROCm SMI" OFF "BTOP_GPU" OFF)
# Enable LTO in release builds by default
if(CMAKE_BUILD_TYPE MATCHES "Rel(ease|WithDebInfo)")
option(BTOP_LTO "Enable LTO" ON)
else()
option(BTOP_LTO "Enable LTO" OFF)
endif()
if(BTOP_STATIC AND NOT APPLE)
# Set this before calling find_package
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
endif()
add_executable(btop src/main.cpp)
add_library(libbtop OBJECT
src/btop.cpp
src/btop_cli.cpp
src/btop_config.cpp
src/btop_draw.cpp
src/btop_input.cpp
src/btop_log.cpp
src/btop_menu.cpp
src/btop_shared.cpp
src/btop_theme.cpp
src/btop_tools.cpp
)
target_link_libraries(btop libbtop)
if(BTOP_LTO)
check_ipo_supported()
set_target_properties(btop PROPERTIES INTERPROCEDURAL_OPTIMIZATION ON)
set_target_properties(libbtop PROPERTIES INTERPROCEDURAL_OPTIMIZATION ON)
endif()
if(APPLE)
target_sources(libbtop PRIVATE src/osx/btop_collect.cpp src/osx/sensors.cpp src/osx/smc.cpp)
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD")
target_sources(libbtop PRIVATE src/freebsd/btop_collect.cpp)
elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
target_sources(libbtop PRIVATE src/openbsd/btop_collect.cpp src/openbsd/sysctlbyname.cpp)
elseif(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
target_sources(libbtop PRIVATE src/netbsd/btop_collect.cpp)
elseif(LINUX)
target_sources(libbtop PRIVATE src/linux/btop_collect.cpp)
if(BTOP_GPU)
add_subdirectory(src/linux/intel_gpu_top)
endif()
else()
message(FATAL_ERROR "${CMAKE_SYSTEM_NAME} is not supported")
endif()
# Generate build info
execute_process(
COMMAND "git" "rev-parse" "--short" "HEAD"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_COMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
set(CONFIGURE_COMMAND
"cmake -DBTOP_STATIC=${BTOP_STATIC} -DBTOP_GPU=${BTOP_GPU}"
)
get_filename_component(CXX_COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
set(COMPILER "${CXX_COMPILER_BASENAME}")
set(COMPILER_VERSION "${CMAKE_CXX_COMPILER_VERSION}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY IMMEDIATE)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include(CheckCXXSourceCompiles)
include(CheckCXXSymbolExists)
check_cxx_source_compiles(
"
#include <version>
#if __cpp_lib_optional < 202110L
#error \"Missing __cpp_lib_optional < 202110L\"
#endif
int main() { return 0; }
"
HAS_CXX_OPTIONAL_MONADS
)
if(NOT HAS_CXX_OPTIONAL_MONADS)
message(FATAL_ERROR "The compiler doesn't support std::optional::and_then")
endif()
check_cxx_symbol_exists("__cpp_lib_expected" "version" HAS_CXX_EXPECTED)
if(NOT HAS_CXX_EXPECTED)
message(FATAL_ERROR "The compiler doesn't support std::expected")
endif()
check_cxx_symbol_exists("__cpp_lib_ranges" "version" HAS_CXX_RANGES)
if(NOT HAS_CXX_RANGES)
message(FATAL_ERROR "The compiler doesn't support std::ranges")
endif()
check_cxx_symbol_exists("__cpp_lib_ranges_to_container" "version" HAS_CXX_RANGES_TO_CONTAINER)
if(NOT HAS_CXX_RANGES_TO_CONTAINER)
message(FATAL_ERROR "The compiler doesn't support std::ranges::to")
endif()
check_cxx_symbol_exists("__cpp_lib_string_contains" "version" HAS_CXX_STRING_CONTAINS)
if(NOT HAS_CXX_STRING_CONTAINS)
message(FATAL_ERROR "The compiler doesn't support std::string::contains")
endif()
target_compile_options(libbtop PUBLIC -Wall -Wextra -Wpedantic)
include(CheckCXXCompilerFlag)
if(NOT APPLE)
target_compile_options(libbtop PUBLIC -fstack-clash-protection)
endif()
check_cxx_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR)
if(HAS_FSTACK_PROTECTOR)
target_compile_options(libbtop PUBLIC -fstack-protector)
endif()
check_cxx_compiler_flag(-fcf-protection HAS_FCF_PROTECTION)
if(HAS_FCF_PROTECTION)
target_compile_options(libbtop PUBLIC -fcf-protection)
endif()
target_compile_definitions(libbtop PUBLIC
FMT_HEADER_ONLY
_FILE_OFFSET_BITS=64
$<$<CONFIG:Debug>:_GLIBCXX_ASSERTIONS _LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG>
)
target_include_directories(libbtop SYSTEM PUBLIC include)
# Enable pthreads
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(libbtop Threads::Threads)
# Enable GPU support
if(LINUX AND BTOP_GPU)
target_compile_definitions(libbtop PUBLIC GPU_SUPPORT)
if(BTOP_RSMI_STATIC)
# ROCm doesn't properly add it's folders to the module path if `CMAKE_MODULE_PATH` is already
# set
# We could also manually append ROCm's path here
set(_CMAKE_MODULE_PATH CMAKE_MODULE_PATH)
unset(CMAKE_MODULE_PATH)
# NOTE: This might be problematic in the future if other sub projects depend on this or if
# btop starts producing libraries
# Build a static ROCm library
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
add_subdirectory(lib/rocm_smi_lib EXCLUDE_FROM_ALL)
add_library(ROCm INTERFACE)
# Export ROCm's properties to a target
target_compile_definitions(ROCm INTERFACE RSMI_STATIC)
target_include_directories(ROCm INTERFACE lib/rocm_smi_lib/include)
target_link_libraries(ROCm INTERFACE rocm_smi64)
set(CMAKE_MODULE_PATH _CMAKE_MODULE_PATH)
target_link_libraries(libbtop ROCm)
endif()
if(NOT BTOP_STATIC)
target_link_libraries(libbtop ${CMAKE_DL_LIBS})
endif()
endif()
if(BTOP_STATIC)
target_compile_definitions(libbtop PUBLIC STATIC_BUILD)
target_link_options(libbtop PUBLIC -static LINKER:--fatal-warnings)
endif()
# Enable GPU support on Apple Silicon
if(APPLE AND BTOP_GPU)
target_compile_definitions(libbtop PUBLIC GPU_SUPPORT)
endif()
# Other platform dependent flags
if(APPLE)
target_link_libraries(libbtop
$<LINK_LIBRARY:FRAMEWORK,CoreFoundation> $<LINK_LIBRARY:FRAMEWORK,IOKit>
)
if(BTOP_GPU)
find_library(IOREPORT_LIB IOReport)
if(IOREPORT_LIB)
target_link_libraries(libbtop ${IOREPORT_LIB})
endif()
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD")
# Avoid version mismatch for libstdc++ when a specific version of GCC is installed and not the
# default one since all use the default ones RPATH
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
string(REGEX MATCH "^[0-9]+" GCC_VERSION_MAJOR "${CMAKE_CXX_COMPILER_VERSION}")
set_target_properties(btop PROPERTIES
INSTALL_RPATH "/usr/local/lib/gcc${GCC_VERSION_MAJOR}"
BUILD_WITH_INSTALL_RPATH TRUE
)
# The gcc compiler wrapper doesn't add '--eh-frame-hdr' on FreeBSD with static builds
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278551
if(BTOP_STATIC)
target_link_options(libbtop PUBLIC LINKER:--eh-frame-hdr)
endif()
endif()
find_package(devstat REQUIRED)
find_package(kvm REQUIRED)
target_link_libraries(libbtop devstat::devstat kvm::kvm)
if(BTOP_STATIC)
find_package(elf REQUIRED)
target_link_libraries(libbtop elf::elf)
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(libbtop PUBLIC -static-libstdc++)
endif()
find_package(kvm REQUIRED)
target_link_libraries(libbtop kvm::kvm)
elseif(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(libbtop PUBLIC -static-libstdc++)
endif()
find_package(kvm REQUIRED)
find_package(proplib REQUIRED)
target_link_libraries(libbtop kvm::kvm proplib::proplib)
endif()
# Check if lowdown is installed
find_program(LOWDOWN_EXECUTABLE lowdown)
if(LOWDOWN_EXECUTABLE)
# Custom target to compile Markdown to man page using lowdown
add_custom_command(
OUTPUT btop.1
COMMAND lowdown -s -T man -o btop.1 ${CMAKE_CURRENT_SOURCE_DIR}/manpage.md
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/manpage.md
VERBATIM
)
add_custom_target(generate_manpage ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/btop.1)
# Install the man page
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/btop.1" DESTINATION "share/man/man1")
else()
message(STATUS "Command 'lowdown' not found: skipping generating man page btop.1")
endif()
install(TARGETS btop RUNTIME)
install(FILES "btop.desktop" DESTINATION "share/applications")
install(FILES "Img/icon.png" DESTINATION "share/icons/hicolor/48x48/apps" RENAME "btop.png")
install(FILES "Img/icon.svg" DESTINATION "share/icons/hicolor/scalable/apps" RENAME "btop.svg")
install(DIRECTORY "themes" DESTINATION "share/btop")
include(CTest)
if(BUILD_TESTING)
add_subdirectory(tests)
endif()
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant 3.0
## Our Pledge
We pledge to make our community welcoming, safe, and equitable for all.
We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant.
## Encouraged Behaviors
While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language.
With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including:
1. Respecting the **purpose of our community**, our activities, and our ways of gathering.
2. Engaging **kindly and honestly** with others.
3. Respecting **different viewpoints** and experiences.
4. **Taking responsibility** for our actions and contributions.
5. Gracefully giving and accepting **constructive feedback**.
6. Committing to **repairing harm** when it occurs.
7. Behaving in other ways that promote and sustain the **well-being of our community**.
## Restricted Behaviors
We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct.
1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop.
2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people.
3. **Stereotyping or discrimination.** Characterizing anyone’s personality or behavior on the basis of immutable identities or traits.
4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community.
5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission.
6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group.
7. Behaving in other ways that **threaten the well-being** of our community.
### Other Restrictions
1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions.
2. **Failing to credit sources.** Not properly crediting the sources of content you contribute.
3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community.
4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors.
## Reporting an Issue
Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm.
When an incident does occur, it is important to report it promptly. To report a possible violation, **[NOTE: describe your means of reporting here.]**
Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution.
## Addressing and Repairing Harm
**[NOTE: The remedies and repairs outlined below are suggestions based on best practices in code of conduct enforcement. If your community has its own established enforcement process, be sure to edit this section to describe your own policies.]**
If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident's impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped.
1) Warning
1) Event: A violation involving a single incident or series of incidents.
2) Consequence: A private, written warning from the Community Moderators.
3) Repair: Examples of repair include a private written apology, acknowledgement of responsibility, and seeking clarification on expectations.
2) Temporarily Limited Activities
1) Event: A repeated incidence of a violation that previously resulted in a warning, or the first incidence of a more serious violation.
2) Consequence: A private, written warning with a time-limited cooldown period designed to underscore the seriousness of the situation and give the community members involved time to process the incident. The cooldown period may be limited to particular communication channels or interactions with particular community members.
3) Repair: Examples of repair may include making an apology, using the cooldown period to reflect on actions and impact, and being thoughtful about re-entering community spaces after the period is over.
3) Temporary Suspension
1) Event: A pattern of repeated violation which the Community Moderators have tried to address with warnings, or a single serious violation.
2) Consequence: A private written warning with conditions for return from suspension. In general, temporary suspensions give the person being suspended time to reflect upon their behavior and possible corrective actions.
3) Repair: Examples of repair include respecting the spirit of the suspension, meeting the specified conditions for return, and being thoughtful about how to reintegrate with the community when the suspension is lifted.
4) Permanent Ban
1) Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member.
2) Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior.
3) Repair: There is no possible repair in cases of this severity.
This enforcement ladder is intended as a guideline. It does not limit the ability of Community Managers to use their discretion and judgment, in keeping with the best interests of our community.
## Scope
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public or other spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
## Attribution
This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/).
Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/)
For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of [Mozilla’s code of conduct team](https://github.com/mozilla/inclusion).
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing guidelines
## When submitting pull requests
* Explain your thinking in why a change or addition is needed.
* Is it a requested change or feature?
* If not, open a feature request to get feedback before making a pull request.
* Split up multiple unrelated changes in multiple pull requests.
* If it's a fix for a unreported bug, make a bug report and link the pull request.
* Purely cosmetic changes won't be accepted without a very good explanation of its value.
* Submissions where the majority of the code is AI generated must be marked with [AI generated].
* "Vibe coded" PR's where it seems like the author doesn't understand the generated code will be dismissed.
## Formatting
### Follow the current syntax design
* Indent type: Tabs
* Tab size: 4
* Alternative operators `and`, `or` and `not`.
* Opening curly braces `{` at the end of the same line as the statement/condition.
## General guidelines
* Don't force a programming style. Use object oriented, functional, data oriented, etc., where it's suitable.
* Use [RAII](https://en.cppreference.com/w/cpp/language/raii).
* Make use of the standard algorithms library, watch [C++ Seasoning](https://www.youtube.com/watch?v=W2tWOdzgXHA) and [105 STL Algorithms](https://www.youtube.com/watch?v=bFSnXNIsK4A) for inspiration.
* Use the included `fmt` library for string formatting, see issue [#535](https://github.com/aristocratos/btop/issues/535) for more info and examples.
* All new code should prefer `fmt::format` or `fmt::format_to` instead of
manually concatenating strings for better performance.
* Do not add includes if the same functionality can be achieved using the already included libraries.
* Use descriptive names for variables.
* Use comments if not very obvious what your code is doing.
* Add comments as labels for what's currently happening in bigger sections of code for better readability.
* Avoid writing to disk.
* If using the logger functions, be sensible, only call it if something of importance has changed.
* Benchmark your code and look for alternatives if they cause a noticeable negative impact.
For questions open a new discussion thread or send a mail to jakob@qvantnet.com
For proposing changes to this document create a [new issue](https://github.com/aristocratos/btop/issues/new/choose).
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README.md
================================================
# 
<a href="https://repology.org/project/btop/versions">
<img src="https://repology.org/badge/vertical-allrepos/btop.svg" alt="Packaging status" align="right">
</a>








[](https://paypal.me/aristocratos)
[](https://github.com/sponsors/aristocratos)
[](https://ko-fi.com/aristocratos)
[](https://snapcraft.io/btop)
[](https://github.com/aristocratos/btop/actions/workflows/continuous-build-linux.yml)
[](https://github.com/aristocratos/btop/actions/workflows/continuous-build-macos.yml)
[](https://github.com/aristocratos/btop/actions/workflows/continuous-build-freebsd.yml)
[](https://github.com/aristocratos/btop/actions/workflows/continuous-build-netbsd.yml)
[](https://github.com/aristocratos/btop/actions/workflows/continuous-build-openbsd.yml)
## Index
* [News](#news)
* [Documents](#documents)
* [Description](#description)
* [Features](#features)
* [Themes](#themes)
* [Support and funding](#support-and-funding)
* [Prerequisites](#prerequisites) (Read this if you are having issues!)
* [Screenshots](#screenshots)
* [Keybindings](#help-menu)
* [Installation Linux/macOS](#installation)
* [Compilation Linux](#compilation-linux)
* [Compilation macOS](#compilation-macos-osx)
* [Compilation FreeBSD](#compilation-freebsd)
* [Compilation NetBSD](#compilation-netbsd)
* [Compilation OpenBSD](#compilation-openbsd)
* [Testing](#testing)
* [GPU compatibility](#gpu-compatibility)
* [Installing the snap](#installing-the-snap)
* [Configurability](#configurability)
* [License](#license)
If you are considering donating, please first consider donating to:
[<img src="https://images.squarespace-cdn.com/content/v1/66fd17c779966209da4359da/9dcb67db-433e-41cb-94d7-cecba280dc0b/Picture+1.png" height="100px">](https://www.qm4ua.org/)
[<img src="https://secure2.convio.net/stccad/images/content/pagebuilder/stc-logo2022.png" width="400px">](https://donate.savethechildren.org)
## News
##### 4 December 2025
Since there is a increasing amount of AI generated/assisted PR's, the following guidlines have been added to CONTRIBUTING.md:
* Submissions where the majority of the code is AI generated must be marked with [AI generated].
* "Vibe coded" PR's where it seems like the author doesn't understand the generated code will be dismissed.
##### 22 September 2024
Btop release v1.4.0
Intel GPU support added, note that only GPU utilization, power usage and clock speed available to monitor. Thanks to [@bjia56](https://github.com/bjia56) for contributions.
NetBSD support added. Thanks to [@fraggerfox](https://github.com/fraggerfox) for contributions.
See [CHANGELOG.md](CHANGELOG.md) and latest [release](https://github.com/aristocratos/btop/releases/latest) for detailed list of new features, bug fixes and new themes.
##### 7 January 2024
Btop release v1.3.0
Big release with GPU support added for Linux and platform support for OpenBSD. Big thanks to [@romner-set](https://github.com/romner-set) (GPU support) and [@joske](https://github.com/joske) (OpenBSD support) for contributions.
And a multitude of bugfixes and small changes, see [CHANGELOG.md](CHANGELOG.md) and latest [release](https://github.com/aristocratos/btop/releases/latest) for detailed list and attributions.
See news entry below for more information regarding GPU support.
##### 25 November 2023
GPU monitoring added for Linux!
Compile from git main to try it out.
Use keys `5`, `6`, `7` and `0` to show/hide the gpu monitoring boxes. `5` = Gpu 1, `6` = Gpu 2, etc.
Gpu stats/graphs can also be displayed in the "Cpu box" (not as verbose), see the cpu options menu for info and configuration.
Note that the binaries provided on the release page (when released) and the continuous builds will not have gpu support enabled.
Because the GPU support relies on loading of dynamic gpu libraries, gpu support will not work when also static linking.
See [Compilation Linux](#compilation-linux) for more info on how to compile with gpu monitoring support.
Many thanks to [@romner-set](https://github.com/romner-set) who wrote the vast majority of the implementation for GPU support.
Big update with version bump to 1.3 coming soon.
##### 28 August 2022
[](https://github.com/aristocratos/btop4win)
First release of btop4win available at https://github.com/aristocratos/btop4win
<details>
<summary>More...</summary>
##### 16 January 2022
Release v1.2.0 with FreeBSD support. No release binaries for FreeBSD provided as of yet.
Again a big thanks to [@joske](https://github.com/joske) for his porting efforts!
Since compatibility with Linux, macOS and FreeBSD are done, the focus going forward will be on new features like GPU monitoring.
##### 13 November 2021
Release v1.1.0 with macOS support. Binaries in [continuous-build-macos](https://github.com/aristocratos/btop/actions/workflows/continuous-build-macos.yml) are only x86 for now.
macOS binaries + installer are included for both x86 and ARM64 (Apple Silicon) in the releases.
Big thank you to [@joske](https://github.com/joske) who wrote the vast majority of the implementation!
##### 30 October 2021
Work on the OSX [macOS] and FreeBSD branches, both initiated and mostly worked on by [@joske](https://github.com/joske), will likely be completed in the coming weeks.
The OSX [macOS] branch has some memory leaks that needs to be sorted out and both have some issues with the processes cpu usage calculation and other smaller issues that needs fixing.
If you want to help out, test for bugs/fix bugs or just try out the branches:
**macOS / OSX**
```bash
# Install and use Homebrew or MacPorts package managers for easy dependency installation
brew install coreutils make gcc@11 lowdown
git clone https://github.com/aristocratos/btop.git
cd btop
git checkout OSX
gmake
```
**FreeBSD**
```bash
sudo pkg install gmake gcc11 coreutils git lowdown
git clone https://github.com/aristocratos/btop.git
cd btop
git checkout freebsd
gmake
```
Note that GNU make (`gmake`) is recommended but not required for macOS/OSX but it is required on FreeBSD.
##### 6 October 2021
macOS development have been started by [@joske](https://github.com/joske), big thanks :)
See branch [OSX](https://github.com/aristocratos/btop/tree/OSX) for current progress.
##### 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 11 is required.
Please report any bugs to the [Issues](https://github.com/aristocratos/btop/issues/new?assignees=aristocratos&labels=bug&template=bug_report.md&title=%5BBUG%5D) page.
The development plan right now:
* 1.1.0 macOS [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 macOS/OSX.
</details>
## Documents
**[CHANGELOG.md](CHANGELOG.md)**
**[CONTRIBUTING.md](CONTRIBUTING.md)**
**[CODE_OF_CONDUCT.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](https://github.com/aristocratos/bashtop) and [bpytop](https://github.com/aristocratos/bpytop).
## Features
* Easy to use, with a game inspired menu system.
* Full mouse support: all buttons with a highlighted key are clickable and mouse scrolling works in process list and menu boxes.
* Fast and responsive UI with UP, DOWN key 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.
* Pause the process list.
* 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](https://github.com/aristocratos/btop/tree/main/themes) folder for available themes.
Btop searches the following directories for system themes:
* `../share/btop/themes` (this path is relative to the btop executable)
* `/usr/local/share/btop/themes`
* `/usr/share/btop/themes`
The first directory that exists and isn't empty is used as the system themes directory.
The user themes directory depends on which environment variables are set:
* If `$XDG_CONFIG_HOME` is set, the user themes directory is `$XDG_CONFIG_HOME/btop/themes`
* Otherwise, if `$HOME` is set, the user themes directory is `$HOME/.config/btop/themes`
* Otherwise, the user themes directory is `~/.config/btop/themes`
The `make install` command places the default themes in `[$PREFIX or /usr/local]/share/btop/themes`.
User created themes should be placed in the user themes directory.
Use the `--themes-dir` command-line option to specify a custom themes directory.
When specified, this directory takes priority over the default search paths.
Let me know if you want to contribute with new themes.
The new Process list pausing and Process following features introduce a few new theme attributes.
These attributes still need to be added to all of the existing themes (except the default one).
Process list banner attributes:
* proc_pause_bg: background color of the banner when the list is paused.
* proc_follow_bg: background color of the banner when the process following feature is active.
* proc_banner_bg: background color of the banner when the process following feature is active AND the list is paused.
* proc_banner_fg: foreground (text) color of the banner
Process following attributes:
* followed_bg: background color of the followed process in the list.
* followed_fg: foreground color of the followed process in the list.
## Support and funding
You can sponsor this project through GitHub. See [my sponsors page](https://github.com/sponsors/aristocratos) for options.
Or donate through [PayPal](https://paypal.me/aristocratos) or [ko-fi](https://ko-fi.com/aristocratos).
Any support is greatly appreciated!
## Prerequisites
For the best experience run within a terminal with support for:
* 24-bit truecolor ([See list of terminals with truecolor support](https://github.com/termstandard/colors))
* 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" arguments.
* Wide characters (Are sometimes problematic in web-based terminals)
Also necessary is a UTF8 locale and a font that includes:
* 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
### **Optional Dependencies (Needed for GPU monitoring) (Only Linux)**
GPU monitoring also requires a btop binary built with GPU support (`GPU_SUPPORT=true` flag).
See [GPU compatibility](#gpu-compatibility) section for more about compiling with GPU support.
* **NVIDIA**
If you have an NVIDIA GPU you must use an official NVIDIA driver, both the closed-source and open-source ones have been verified to work.
In addition to that you must also have the nvidia-ml dynamic library installed, which should be included with the driver package of your distribution.
* **AMD**
If you have an AMD GPU `rocm_smi_lib` is required, which may or may not be packaged for your distribution.
* **INTEL**
Requires a working C compiler if compiling from source.
Also requires the user to have permission to read from SYSFS.
Can be set with `make setcap` (preferred) or `make setuid` or by running btop with `sudo` or equivalent.
### **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](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Terminus/TerminessNerdFontMono-Regular.ttf) for an example of a font that includes the braille symbols.
* See comments by @sgleizes [link](https://github.com/aristocratos/bpytop/issues/100#issuecomment-684036827) and @XenHat [link](https://github.com/aristocratos/bpytop/issues/100#issuecomment-691585587) in issue #100 for possible solutions.
* If text is misaligned and you use Konsole or Yakuake, turning off "Bi-Directional text rendering" is a possible fix.
* Characters clipping into each other or text/border misalignments are 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 previously mentioned fixes don't work for you.
## Screenshots
#### Main UI showing details for a selected process

#### Main UI in TTY mode

#### Main UI with custom options

#### Main-menu

#### Options-menu

#### Help-menu

## Installation
**Binaries for Linux are statically compiled with musl and work on kernel releases 2.6.39 and newer**
1. **Download btop-(VERSION)-(ARCH)-(PLATFORM).tbz from [latest release](https://github.com/aristocratos/btop/releases/latest) and unpack to a new folder**
**Notice! Use x86_64 for 64-bit x86 systems, i486 and i686 are 32-bit!**
2. **Install (from created folder)**
* **Run:**
```bash
# 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/Required for Intel GPU and CPU wattage) Set extended capabilities or suid bit to btop**
Enables signal sending to any process without starting with `sudo` and can prevent /proc read permissions problems on some systems.
Is required for Intel GPU support and CPU wattage monitoring.
* **Run:**
```bash
# run after make install and use same PREFIX if any was used at install
sudo make setcap
```
* **or**
```bash
# 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:**
```bash
sudo make uninstall
```
* **Show help**
```bash
make help
```
**Binary release (from native os repo)**
* **openSUSE**
* **Tumbleweed:**
```bash
sudo zypper in btop
```
* For all other versions, see [openSUSE Software: btop](https://software.opensuse.org/package/btop)
* **Fedora**
```bash
sudo dnf install btop
```
* **RHEL/Rocky/AlmaLinux 8+**
```bash
sudo dnf install epel-release
sudo dnf install btop
```
* **FreeBSD**
```sh
pkg install btop
```
* **NetBSD**
```sh
pkg_add btop
```
**Binary release on Homebrew (macOS (x86_64 & ARM64) / Linux (x86_64))**
* **[Homebrew](https://formulae.brew.sh/formula/btop)**
```bash
brew install btop
```
## Compilation Linux
Requires at least GCC 14 or Clang 19.
The Makefile also needs GNU `coreutils` and `sed` (should already be installed on any modern distribution).
### GPU compatibility
Btop++ supports Nvidia and AMD GPUs and Intel IGPUs out of the box on Linux x86_64, provided you have the correct drivers and libraries.
Gpu support for Nvidia or AMD will not work when static linking glibc (or musl, etc.)!
For x86_64 Linux the flag `GPU_SUPPORT` is automatically set to `true`, to manually disable gpu support set the flag to false, like:
`make GPU_SUPPORT=false` (or `cmake -DBTOP_GPU=false` with CMake)
* **NVIDIA**
You must use an official NVIDIA driver, both the closed-source and [open-source](https://github.com/NVIDIA/open-gpu-kernel-modules) ones have been verified to work.
In addition to that you must also have the `nvidia-ml` dynamic library installed, which should be included with the driver package of your distribution.
* **AMD**
AMDGPU data is queried using the [ROCm SMI](https://github.com/rocm/rocm_smi_lib) library, which may or may not be packaged for your distribution. If your distribution doesn't provide a package, btop++ is statically linked to ROCm SMI with the `RSMI_STATIC=true` make flag.
This flag expects the ROCm SMI source code in `lib/rocm_smi_lib`, and compilation will fail if it's not there. The latest tested version is 5.6.x, which can be obtained with the following command:
```bash
git clone https://github.com/rocm/rocm_smi_lib.git --depth 1 -b rocm-5.6.x lib/rocm_smi_lib
```
<details>
<summary>
### With Make
</summary>
1. **Install dependencies (example for Ubuntu 24.04 Noble)**
```bash
sudo apt install coreutils sed git build-essential lowdown
```
2. **Clone repository**
```bash
git clone https://github.com/aristocratos/btop.git
cd btop
```
3. **Compile**
```bash
make
```
Options for make:
| Flag | Description |
|---------------------------------|-------------------------------------------------------------------------|
| `VERBOSE=true` | To display full compiler/linker commands |
| `STATIC=true` | For static compilation |
| `QUIET=true` | For less verbose output |
| `STRIP=true` | To force stripping of debug symbols (adds `-s` linker flag) |
| `DEBUG=true` | Sets OPTFLAGS to `-O0 -g` and enables more verbose debug logging |
| `ARCH=<architecture>` | To manually set the target architecture |
| `GPU_SUPPORT=<true\|false>` | Enable/disable GPU support (Enabled by default on X86_64 Linux) |
| `RSMI_STATIC=true` | To statically link the ROCm SMI library used for querying AMDGPU |
| `ADDFLAGS=<flags>` | For appending flags to both compiler and linker |
| `CXX=<compiler>` | Manually set which compiler to use |
Example: `make ADDFLAGS=-march=native` might give a performance boost if compiling only for your own system.
Notice! If using LDAP Authentication, usernames will show as UID number for LDAP users if compiling statically with glibc.
4. **Install**
```bash
sudo make install
```
Append `PREFIX=/target/dir` to set target, default: `/usr/local`
Notice! Only use "sudo" when installing to a NON user owned directory.
5. **(Optional/Required for Intel GPU support and CPU wattage) Set extended capabilities or suid bit to btop**
No need for `sudo` to enable signal sending to any process and to prevent /proc read permissions problems on some systems.
Also required for Intel GPU monitoring and CPU wattage monitoring.
Run after make install and use same PREFIX if any was used at install.
```bash
sudo make setcap
```
or
Set `SU_USER` and `SU_GROUP` to select user and group, default is `root` and `root`
```bash
sudo make setuid
```
* **Uninstall**
```bash
sudo make uninstall
```
* **Remove any object files from source dir**
```bash
make clean
```
* **Remove all object files, binaries and created directories in source dir**
```bash
make distclean
```
* **Show help**
```bash
make help
```
</details>
<details>
<summary>
### With CMake (Community maintained)
</summary>
1. **Install build dependencies**
Requires Clang / GCC, CMake, Ninja, Lowdown and Git
For example, with Debian Bookworm:
```bash
sudo apt install cmake git g++ ninja-build lowdown
```
2. **Clone the repository**
```bash
git clone https://github.com/aristocratos/btop.git && cd btop
``````
3. **Compile**
```bash
# Configure
cmake -B build -G Ninja
# Build
cmake --build build
```
This will automatically build a release version of btop.
Some useful options to pass to the configure step:
| Configure flag | Description |
|---------------------------------|-------------------------------------------------------------------------|
| `-DBTOP_STATIC=<ON\|OFF>` | Enables static linking (OFF by default) |
| `-DBTOP_LTO=<ON\|OFF>` | Enables link time optimization (ON by default) |
| `-DBTOP_GPU=<ON\|OFF>` | Enable GPU support (ON by default) |
| `-DBTOP_RSMI_STATIC=<ON\|OFF>` | Build and link the ROCm SMI library statically (OFF by default) |
| `-DCMAKE_INSTALL_PREFIX=<path>` | The installation prefix ('/usr/local' by default) |
To force any other compiler, run `CXX=<compiler> cmake -B build -G Ninja`
4. **Install**
```bash
cmake --install build
```
May require root privileges
5. **Uninstall**
CMake doesn't generate an uninstall target by default. To remove installed files, run
```
cat build/install_manifest.txt | xargs rm -irv
```
6. **Cleanup build directory**
```bash
cmake --build build -t clean
```
</details>
## Compilation macOS OSX
Requires at least GCC 14 or Clang 19.
The Makefile also needs GNU coreutils and `sed`.
Install and use Homebrew or MacPorts package managers for easy dependency installation
<details>
<summary>
### With Make
</summary>
1. **Install dependencies (example for Homebrew)**
```bash
brew install coreutils make gcc@15 lowdown
```
2. **Clone repository**
```bash
git clone https://github.com/aristocratos/btop.git
cd btop
```
3. **Compile**
```bash
gmake
```
Options for make:
| Flag | Description |
|---------------------------------|-------------------------------------------------------------------------|
| `VERBOSE=true` | To display full compiler/linker commands |
| `STATIC=true` | For static compilation (only libgcc and libstdc++) |
| `QUIET=true` | For less verbose output |
| `STRIP=true` | To force stripping of debug symbols (adds `-s` linker flag) |
| `DEBUG=true` | Sets OPTFLAGS to `-O0 -g` and enables more verbose debug logging |
| `ARCH=<architecture>` | To manually set the target architecture |
| `ADDFLAGS=<flags>` | For appending flags to both compiler and linker |
| `CXX=<compiler>` | Manually set which compiler to use |
Example: `gmake ADDFLAGS=-march=native` might give a performance boost if compiling only for your own system.
4. **Install**
```bash
sudo gmake install
```
Append `PREFIX=/target/dir` to set target, default: `/usr/local`
Notice! Only use "sudo" when installing to a NON user owned directory.
5. **(Recommended) Set suid bit to make btop always run as root (or other user)**
```bash
sudo gmake setuid
```
No need for `sudo` to see information for non user owned processes and to enable signal sending to any process.
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` and `wheel`
* **Uninstall**
```bash
sudo gmake uninstall
```
* **Remove any object files from source dir**
```bash
gmake clean
```
* **Remove all object files, binaries and created directories in source dir**
```bash
gmake distclean
```
* **Show help**
```bash
gmake help
```
</details>
<details>
<summary>
### With CMake (Community maintained)
</summary>
1. **Install build dependencies**
Requires Clang, CMake, Ninja, Lowdown and Git
```bash
brew update --quiet
brew install cmake git llvm ninja lowdown
```
2. **Clone the repository**
```bash
git clone https://github.com/aristocratos/btop.git && cd btop
```
3. **Compile**
```bash
# Configure
export LLVM_PREFIX="$(brew --prefix llvm)"
export CXX="$LLVM_PREFIX/bin/clang++"
export CPPFLAGS="-I$LLVM_PREFIX/include"
export LDFLAGS="-L$LLVM_PREFIX/lib -L$LLVM_PREFIX/lib/c++ -Wl,-rpath,$LLVM_PREFIX/lib/c++ -fuse-ld=$LLVM_PREFIX/bin/ld64.lld"
cmake -B build -G Ninja
# Build
cmake --build build
```
This will automatically build a release version of btop.
Some useful options to pass to the configure step:
| Configure flag | Description |
|---------------------------------|-------------------------------------------------------------------------|
| `-DBTOP_LTO=<ON\|OFF>` | Enables link time optimization (ON by default) |
| `-DCMAKE_INSTALL_PREFIX=<path>` | The installation prefix ('/usr/local' by default) |
To force any specific compiler, run `CXX=<compiler> cmake -B build -G Ninja`
4. **Install**
```bash
cmake --install build
```
May require root privileges
5. **Uninstall**
CMake doesn't generate an uninstall target by default. To remove installed files, run
```
cat build/install_manifest.txt | xargs rm -irv
```
6. **Cleanup build directory**
```bash
cmake --build build -t clean
```
</details>
## Compilation FreeBSD
Requires at least Clang 19 (default) or GCC 14.
Note that GNU make (`gmake`) is required to compile on FreeBSD.
<details>
<summary>
### With gmake
</summary>
1. **Install dependencies**
```bash
sudo pkg install gmake coreutils git lowdown
```
2. **Clone repository**
```bash
git clone https://github.com/aristocratos/btop.git
cd btop
```
3. **Compile**
```bash
gmake
```
Options for make:
| Flag | Description |
|---------------------------------|-------------------------------------------------------------------------|
| `VERBOSE=true` | To display full compiler/linker commands |
| `STATIC=true` | For static compilation (only libgcc and libstdc++) |
| `QUIET=true` | For less verbose output |
| `STRIP=true` | To force stripping of debug symbols (adds `-s` linker flag) |
| `DEBUG=true` | Sets OPTFLAGS to `-O0 -g` and enables more verbose debug logging |
| `ARCH=<architecture>` | To manually set the target architecture |
| `ADDFLAGS=<flags>` | For appending flags to both compiler and linker |
| `CXX=<compiler>` | Manually set which compiler to use |
Example: `gmake ADDFLAGS=-march=native` might give a performance boost if compiling only for your own system.
4. **Install**
```bash
sudo gmake install
```
Append `PREFIX=/target/dir` to set target, default: `/usr/local`
Notice! Only use "sudo" when installing to a NON user owned directory.
5. **(Recommended) Set suid bit to make btop always run as root (or other user)**
```bash
sudo gmake setuid
```
No need for `sudo` to see information for non user owned processes and to enable signal sending to any process.
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` and `wheel`
* **Uninstall**
```bash
sudo gmake uninstall
```
* **Remove any object files from source dir**
```bash
gmake clean
```
* **Remove all object files, binaries and created directories in source dir**
```bash
gmake distclean
```
* **Show help**
```bash
gmake help
```
</details>
<details>
<summary>
### With CMake (Community maintained)
</summary>
1. **Install build dependencies**
Requires Clang / GCC, CMake, Ninja, Lowdown and Git
```bash
pkg install cmake ninja lowdown
```
2. **Clone the repository**
```bash
git clone https://github.com/aristocratos/btop.git && cd btop
```
3. **Compile**
```bash
# Configure
cmake -B build -G Ninja
# Build
cmake --build build
```
This will automatically build a release version of btop.
Some useful options to pass to the configure step:
| Configure flag | Description |
|---------------------------------|-------------------------------------------------------------------------|
| `-DBTOP_STATIC=<ON\|OFF>` | Enables static linking (OFF by default) |
| `-DBTOP_LTO=<ON\|OFF>` | Enables link time optimization (ON by default) |
| `-DCMAKE_INSTALL_PREFIX=<path>` | The installation prefix ('/usr/local' by default) |
_**Note:** Static linking does not work with GCC._
To force any other compiler, run `CXX=<compiler> cmake -B build -G Ninja`
4. **Install**
```bash
cmake --install build
```
May require root privileges
5. **Uninstall**
CMake doesn't generate an uninstall target by default. To remove installed files, run
```
cat build/install_manifest.txt | xargs rm -irv
```
6. **Cleanup build directory**
```bash
cmake --build build -t clean
```
</details>
## Compilation NetBSD
Requires at least GCC 14.
Note that GNU make (`gmake`) is required to compile on NetBSD.
<details>
<summary>
### With gmake
</summary>
1. **Install dependencies**
```bash
/usr/sbin/pkg_add pkgin
pkgin install -y coregutils gcc14 git gmake
```
2. **Clone repository**
```bash
git clone https://github.com/aristocratos/btop.git
cd btop
```
3. **Compile**
```bash
CXX=/usr/pkg/gcc14/bin/g++ gmake CXXFLAGS="-DNDEBUG"
```
Options for make:
| Flag | Description |
|---------------------------------|-------------------------------------------------------------------------|
| `VERBOSE=true` | To display full compiler/linker commands |
| `STATIC=true` | For static compilation (only libgcc and libstdc++) |
| `QUIET=true` | For less verbose output |
| `STRIP=true` | To force stripping of debug symbols (adds `-s` linker flag) |
| `DEBUG=true` | Sets OPTFLAGS to `-O0 -g` and enables more verbose debug logging |
| `ARCH=<architecture>` | To manually set the target architecture |
| `ADDFLAGS=<flags>` | For appending flags to both compiler and linker |
| `CXX=<compiler>` | Manually set which compiler to use |
Example: `gmake ADDFLAGS=-march=native` might give a performance boost if compiling only for your own system.
4. **Install**
```bash
sudo gmake install
```
Append `PREFIX=/target/dir` to set target, default: `/usr/local`
Notice! Only use "sudo" when installing to a NON user owned directory.
5. **(Recommended) Set suid bit to make btop always run as root (or other user)**
```bash
sudo gmake setuid
```
No need for `sudo` to see information for non user owned processes and to enable signal sending to any process.
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` and `wheel`
* **Uninstall**
```bash
sudo gmake uninstall
```
* **Remove any object files from source dir**
```bash
gmake clean
```
* **Remove all object files, binaries and created directories in source dir**
```bash
gmake distclean
```
* **Show help**
```bash
gmake help
```
</details>
<details>
<summary>
### With CMake (Community maintained)
</summary>
1. **Install build dependencies**
Requires GCC, CMake, Ninja and Git
```bash
/usr/sbin/pkg_add pkgin
pkgin install cmake ninja-build gcc14 git
```
2. **Clone the repository**
```bash
git clone https://github.com/aristocratos/btop.git && cd btop
```
3. **Compile**
```bash
# Configure
CXX="/usr/pkg/gcc14/bin/g++" cmake -B build -G Ninja
# Build
cmake --build build
```
This will automatically build a release version of btop.
Some useful options to pass to the configure step:
| Configure flag | Description |
|---------------------------------|-------------------------------------------------------------------------|
| `-DBTOP_LTO=<ON\|OFF>` | Enables link time optimization (ON by default) |
| `-DCMAKE_INSTALL_PREFIX=<path>` | The installation prefix ('/usr/local' by default) |
To force any other compiler, run `CXX=<compiler> cmake -B build -G Ninja`
4. **Install**
```bash
cmake --install build
```
May require root privileges
5. **Uninstall**
CMake doesn't generate an uninstall target by default. To remove installed files, run
```
cat build/install_manifest.txt | xargs rm -irv
```
6. **Cleanup build directory**
```bash
cmake --build build -t clean
```
</details>
## Compilation OpenBSD
Note that GNU make (`gmake`) is required to compile on OpenBSD.
<details>
<summary>
### With gmake
</summary>
1. **Install dependencies**
```bash
pkg_add coreutils git gmake lowdown
```
2. **Clone repository**
```bash
git clone https://github.com/aristocratos/btop.git
cd btop
```
3. **Compile**
```bash
gmake
```
Options for make:
| Flag | Description |
|---------------------------------|-------------------------------------------------------------------------|
| `VERBOSE=true` | To display full compiler/linker commands |
| `STATIC=true` | For static compilation (only libgcc and libstdc++) |
| `QUIET=true` | For less verbose output |
| `STRIP=true` | To force stripping of debug symbols (adds `-s` linker flag) |
| `DEBUG=true` | Sets OPTFLAGS to `-O0 -g` and enables more verbose debug logging |
| `ARCH=<architecture>` | To manually set the target architecture |
| `ADDFLAGS=<flags>` | For appending flags to both compiler and linker |
| `CXX=<compiler>` | Manually set which compiler to use |
Example: `gmake ADDFLAGS=-march=native` might give a performance boost if compiling only for your own system.
4. **Install**
```bash
sudo gmake install
```
Append `PREFIX=/target/dir` to set target, default: `/usr/local`
Notice! Only use "sudo" when installing to a NON user owned directory.
5. **(Recommended) Set suid bit to make btop always run as root (or other user)**
```bash
sudo gmake setuid
```
No need for `sudo` to see information for non user owned processes and to enable signal sending to any process.
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` and `wheel`
* **Uninstall**
```bash
sudo gmake uninstall
```
* **Remove any object files from source dir**
```bash
gmake clean
```
* **Remove all object files, binaries and created directories in source dir**
```bash
gmake distclean
```
* **Show help**
```bash
gmake help
```
</details>
<details>
<summary>
### With CMake (Community maintained)
</summary>
1. **Install build dependencies**
Requires GCC, CMake, Ninja, Lowdown and Git
_**Note:** LLVM's libc++ shipped with OpenBSD 7.4 is too old and cannot compile btop._
```bash
pkg_add cmake git ninja lowdown
```
2. **Clone the repository**
```bash
git clone https://github.com/aristocratos/btop.git && cd btop
```
3. **Compile**
```bash
# Configure
cmake -B build -G Ninja
# Build
cmake --build build
```
This will automatically build a release version of btop.
Some useful options to pass to the configure step:
| Configure flag | Description |
|---------------------------------|-------------------------------------------------------------------------|
| `-DBTOP_LTO=<ON\|OFF>` | Enables link time optimization (ON by default) |
| `-DCMAKE_INSTALL_PREFIX=<path>` | The installation prefix ('/usr/local' by default) |
To force any other compiler, run `CXX=<compiler> cmake -B build -G Ninja`
4. **Install**
```bash
cmake --install build
```
May require root privileges
5. **Uninstall**
CMake doesn't generate an uninstall target by default. To remove installed files, run
```
cat build/install_manifest.txt | xargs rm -irv
```
6. **Cleanup build directory**
```bash
cmake --build build -t clean
```
</details>
## Testing
Testing requires [CMake](cmake.org). Tests are build by default and can be run with `ctest --test-dir <build>`.
If you want to disable building tests, pass `-DBUILD_TESTING=OFF` to the configure step.
## Installing the snap
[](https://snapcraft.io/btop)
### Note: there are now two snaps available: `btop` and `btop-desktop`. The desktop version is much larger and includes the desktop entries needed to allow for launching `btop` with a click.
* **Install the snap**
```bash
sudo snap install btop
or
sudo snap install btop-desktop
```
* **Install the latest snap from the edge channel**
```
sudo snap install btop --edge
or
sudo snap install btop-desktop --edge
```
* **Connect the interface**
```bash
sudo snap connect btop:removable-media
or
sudo snap connect btop-desktop:removable-media
```
## Configurability
All options changeable from within UI.
Config and log files stored in `$XDG_CONFIG_HOME/btop` or `$HOME/.config/btop` folder
#### btop.conf: (auto generated if not found)
```toml
#? Config file for btop v.1.4.5
#* 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 = true
#* 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 positions, G=graph symbol to use for box.
#* Use whitespace " " as separator 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"
#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists.
#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift.
vim_keys = false
#* Rounded corners on boxes, is ignored if TTY mode is ON.
rounded_corners = true
#* Use terminal synchronized output sequences to reduce flickering on supported terminals.
terminal_sync = 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" and "gpu0" through "gpu5", 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 direct",
#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" 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 = false
#* Show process memory as bytes instead of percent.
proc_mem_bytes = true
#* Show cpu graph for each process.
proc_cpu_graphs = 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
#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop).
proc_filter_kernel = false
#* Should the process list follow the selected process when detailed view is open.
proc_follow_detailed = true
#* In tree-view, always accumulate child process resources in the parent process.
proc_aggregate = false
#* Should cpu and memory usage display be preserved for dead processes when paused.
keep_dead_proc_usage = 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 = "Auto"
#* 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 = "Auto"
#* 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
#* Shows the CPU package current power consumption in watts. Requires running `make setcap` or `make setuid` or running with sudo.
show_cpu_watts = 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"
#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024.
base_10_sizes = false
#* Show CPU frequency.
show_cpu_freq = true
#* How to calculate CPU frequency, available values: "first", "range", "lowest", "highest" and "average".
freq_mode = "first"
#* 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 = "%X"
#* 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 " ".
#* Only disks matching the filter will be shown. Prepend exclude= to only show disks not matching the filter. Examples: disk_filter="/boot /home/user", disks_filter="exclude=/boot /home/user"
disks_filter = ""
#* Show graphs instead of meters for memory values.
mem_graphs = true
#* Show mem box below net box instead of above.
mem_below_net = false
#* Count ZFS ARC in cached and available memory.
zfs_arc_cached = true
#* 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 = true
#* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool)
zfs_hide_datasets = false
#* Set to true to show available disk space for privileged users.
disk_free_priv = 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 = true
#* Starts with the Network Interface specified here.
net_iface = ""
#* "True" shows bitrates in base 10 (Kbps, Mbps). "False" shows bitrates in binary sizes (Kibps, Mibps, etc.). "Auto" uses base_10_sizes.
base_10_bitrate = "Auto"
#* Show battery stats in top right if battery is present.
show_battery = true
#* Which battery to use if multiple are present. "Auto" for auto detection.
selected_battery = "Auto"
#* Show power stats of battery next to charge indicator.
show_battery_watts = true
#* Set loglevel for "~/.local/state/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info.
log_level = "WARNING"
```
#### Command line options
```text
Usage: btop [OPTIONS]
Options:
-c, --config <file> Path to a config file
-d, --debug Start in debug mode with additional logs and metrics
-f, --filter <filter> Set an initial process filter
--force-utf Override automatic UTF locale detection
-l, --low-color Disable true color, 256 colors only
-p, --preset <id> Start with a preset (0-9)
-t, --tty Force tty mode with ANSI graph symbols and 16 colors only
--no-tty Force disable tty mode
-u, --update <ms> Set an initial update rate in milliseconds
--default-config Print default config to standard output
-h, --help Show this help message and exit
-V, --version Show a version message and exit (more with --version)
```
## LICENSE
[Apache License 2.0](LICENSE)
================================================
FILE: btop.desktop
================================================
[Desktop Entry]
Type=Application
Version=1.0
Name=btop++
GenericName=System Monitor
GenericName[it]=Monitor di sistema
GenericName[zh_TW]=系統監視器
GenericName[pt_BR]=Monitor de sistema
Comment=Resource monitor that shows usage and stats for processor, memory, disks, network and processes
Comment[it]=Monitoraggio delle risorse: mostra utilizzo e statistiche per CPU, dischi, rete e processi
Comment[zh_TW]=顯示處理器、主記憶體、磁碟、網路與進程的使用與統計數據的資源監視器應用程式
Comment[pt_BR]=Monitoramente de atividades com estatisticas e graficos por CPU, disco, rede e processos
Icon=btop
Exec=btop
Terminal=true
Categories=System;Monitor;ConsoleOnly;
Keywords=system;process;task
Keywords[zh_TW]=系統;進程;處理程序;任務
Keywords[pt_BR]=sistema;processos;tarefas
================================================
FILE: cmake/Finddevstat.cmake
================================================
# SPDX-License-Identifier: Apache-2.0
#
# Find devstat, the Device Statistics Library
#
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD")
find_path(devstat_INCLUDE_DIR NAMES devstat.h)
find_library(devstat_LIBRARY NAMES devstat)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(devstat REQUIRED_VARS devstat_LIBRARY devstat_INCLUDE_DIR)
if(devstat_FOUND AND NOT TARGET devstat::devstat)
add_library(devstat::devstat UNKNOWN IMPORTED)
set_target_properties(devstat::devstat PROPERTIES
IMPORTED_LOCATION "${devstat_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${devstat_INCLUDE_DIR}"
)
endif()
mark_as_advanced(devstat_INCLUDE_DIR devstat_LIBRARY)
endif()
================================================
FILE: cmake/Findelf.cmake
================================================
# SPDX-License-Identifier: Apache-2.0
#
# Find libelf, the ELF Access Library
#
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD")
find_path(elf_INCLUDE_DIR NAMES libelf.h)
find_library(elf_LIBRARY NAMES elf)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(elf REQUIRED_VARS elf_LIBRARY elf_INCLUDE_DIR)
if(elf_FOUND AND NOT TARGET elf::elf)
add_library(elf::elf UNKNOWN IMPORTED)
set_target_properties(elf::elf PROPERTIES
IMPORTED_LOCATION "${elf_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${elf_INCLUDE_DIR}"
)
endif()
mark_as_advanced(elf_INCLUDE_DIR elf_LIBRARY)
endif()
================================================
FILE: cmake/Findkvm.cmake
================================================
# SPDX-License-Identifier: Apache-2.0
#
# Find libkvm, the Kernel Data Access Library
#
if(BSD)
find_path(kvm_INCLUDE_DIR NAMES kvm.h)
find_library(kvm_LIBRARY NAMES kvm)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(kvm REQUIRED_VARS kvm_LIBRARY kvm_INCLUDE_DIR)
if(kvm_FOUND AND NOT TARGET kvm::kvm)
add_library(kvm::kvm UNKNOWN IMPORTED)
set_target_properties(kvm::kvm PROPERTIES
IMPORTED_LOCATION "${kvm_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${kvm_INCLUDE_DIR}"
)
endif()
mark_as_advanced(kvm_INCLUDE_DIR kvm_LIBRARY)
endif()
================================================
FILE: cmake/Findproplib.cmake
================================================
# SPDX-License-Identifier: Apache-2.0
#
# Find proplib – property container object library
#
if(BSD)
find_path(proplib_INCLUDE_DIR NAMES prop/proplib.h)
find_library(proplib_LIBRARY NAMES libprop prop)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(proplib REQUIRED_VARS proplib_LIBRARY proplib_INCLUDE_DIR)
if(proplib_FOUND AND NOT TARGET proplib::proplib)
add_library(proplib::proplib UNKNOWN IMPORTED)
set_target_properties(proplib::proplib PROPERTIES
IMPORTED_LOCATION "${proplib_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${proplib_INCLUDE_DIR}"
)
endif()
mark_as_advanced(proplib_INCLUDE_DIR proplib_LIBRARY)
endif()
================================================
FILE: include/fmt/LICENSE.rst
================================================
Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--- Optional exception to the license ---
As an exception, if, as a result of your compiling your source code, portions
of this Software are embedded into a machine-executable object form of such
source code, you may redistribute such embedded portions in such object form
without including the above copyright and permission notices.
================================================
FILE: include/fmt/args.h
================================================
// Formatting library for C++ - dynamic argument lists
//
// Copyright (c) 2012 - present, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
#ifndef FMT_ARGS_H_
#define FMT_ARGS_H_
#ifndef FMT_MODULE
# include <functional> // std::reference_wrapper
# include <memory> // std::unique_ptr
# include <vector>
#endif
#include "format.h" // std_string_view
FMT_BEGIN_NAMESPACE
namespace detail {
template <typename T> struct is_reference_wrapper : std::false_type {};
template <typename T>
struct is_reference_wrapper<std::reference_wrapper<T>> : std::true_type {};
template <typename T> auto unwrap(const T& v) -> const T& { return v; }
template <typename T>
auto unwrap(const std::reference_wrapper<T>& v) -> const T& {
return static_cast<const T&>(v);
}
// node is defined outside dynamic_arg_list to workaround a C2504 bug in MSVC
// 2022 (v17.10.0).
//
// Workaround for clang's -Wweak-vtables. Unlike for regular classes, for
// templates it doesn't complain about inability to deduce single translation
// unit for placing vtable. So node is made a fake template.
template <typename = void> struct node {
virtual ~node() = default;
std::unique_ptr<node<>> next;
};
class dynamic_arg_list {
template <typename T> struct typed_node : node<> {
T value;
template <typename Arg>
FMT_CONSTEXPR typed_node(const Arg& arg) : value(arg) {}
template <typename Char>
FMT_CONSTEXPR typed_node(const basic_string_view<Char>& arg)
: value(arg.data(), arg.size()) {}
};
std::unique_ptr<node<>> head_;
public:
template <typename T, typename Arg> auto push(const Arg& arg) -> const T& {
auto new_node = std::unique_ptr<typed_node<T>>(new typed_node<T>(arg));
auto& value = new_node->value;
new_node->next = std::move(head_);
head_ = std::move(new_node);
return value;
}
};
} // namespace detail
/**
* A dynamic list of formatting arguments with storage.
*
* It can be implicitly converted into `fmt::basic_format_args` for passing
* into type-erased formatting functions such as `fmt::vformat`.
*/
FMT_EXPORT template <typename Context> class dynamic_format_arg_store {
private:
using char_type = typename Context::char_type;
template <typename T> struct need_copy {
static constexpr detail::type mapped_type =
detail::mapped_type_constant<T, char_type>::value;
enum {
value = !(detail::is_reference_wrapper<T>::value ||
std::is_same<T, basic_string_view<char_type>>::value ||
std::is_same<T, detail::std_string_view<char_type>>::value ||
(mapped_type != detail::type::cstring_type &&
mapped_type != detail::type::string_type &&
mapped_type != detail::type::custom_type))
};
};
template <typename T>
using stored_t = conditional_t<
std::is_convertible<T, std::basic_string<char_type>>::value &&
!detail::is_reference_wrapper<T>::value,
std::basic_string<char_type>, T>;
// Storage of basic_format_arg must be contiguous.
std::vector<basic_format_arg<Context>> data_;
std::vector<detail::named_arg_info<char_type>> named_info_;
// Storage of arguments not fitting into basic_format_arg must grow
// without relocation because items in data_ refer to it.
detail::dynamic_arg_list dynamic_args_;
friend class basic_format_args<Context>;
auto data() const -> const basic_format_arg<Context>* {
return named_info_.empty() ? data_.data() : data_.data() + 1;
}
template <typename T> void emplace_arg(const T& arg) {
data_.emplace_back(arg);
}
template <typename T>
void emplace_arg(const detail::named_arg<char_type, T>& arg) {
if (named_info_.empty())
data_.insert(data_.begin(), basic_format_arg<Context>(nullptr, 0));
data_.emplace_back(detail::unwrap(arg.value));
auto pop_one = [](std::vector<basic_format_arg<Context>>* data) {
data->pop_back();
};
std::unique_ptr<std::vector<basic_format_arg<Context>>, decltype(pop_one)>
guard{&data_, pop_one};
named_info_.push_back({arg.name, static_cast<int>(data_.size() - 2u)});
data_[0] = {named_info_.data(), named_info_.size()};
guard.release();
}
public:
constexpr dynamic_format_arg_store() = default;
operator basic_format_args<Context>() const {
return basic_format_args<Context>(data(), static_cast<int>(data_.size()),
!named_info_.empty());
}
/**
* Adds an argument into the dynamic store for later passing to a formatting
* function.
*
* Note that custom types and string types (but not string views) are copied
* into the store dynamically allocating memory if necessary.
*
* **Example**:
*
* fmt::dynamic_format_arg_store<fmt::format_context> store;
* store.push_back(42);
* store.push_back("abc");
* store.push_back(1.5f);
* std::string result = fmt::vformat("{} and {} and {}", store);
*/
template <typename T> void push_back(const T& arg) {
if (detail::const_check(need_copy<T>::value))
emplace_arg(dynamic_args_.push<stored_t<T>>(arg));
else
emplace_arg(detail::unwrap(arg));
}
/**
* Adds a reference to the argument into the dynamic store for later passing
* to a formatting function.
*
* **Example**:
*
* fmt::dynamic_format_arg_store<fmt::format_context> store;
* char band[] = "Rolling Stones";
* store.push_back(std::cref(band));
* band[9] = 'c'; // Changing str affects the output.
* std::string result = fmt::vformat("{}", store);
* // result == "Rolling Scones"
*/
template <typename T> void push_back(std::reference_wrapper<T> arg) {
static_assert(
need_copy<T>::value,
"objects of built-in types and string views are always copied");
emplace_arg(arg.get());
}
/**
* Adds named argument into the dynamic store for later passing to a
* formatting function. `std::reference_wrapper` is supported to avoid
* copying of the argument. The name is always copied into the store.
*/
template <typename T>
void push_back(const detail::named_arg<char_type, T>& arg) {
const char_type* arg_name =
dynamic_args_.push<std::basic_string<char_type>>(arg.name).c_str();
if (detail::const_check(need_copy<T>::value)) {
emplace_arg(
fmt::arg(arg_name, dynamic_args_.push<stored_t<T>>(arg.value)));
} else {
emplace_arg(fmt::arg(arg_name, arg.value));
}
}
/// Erase all elements from the store.
void clear() {
data_.clear();
named_info_.clear();
dynamic_args_ = {};
}
/// Reserves space to store at least `new_cap` arguments including
/// `new_cap_named` named arguments.
void reserve(size_t new_cap, size_t new_cap_named) {
FMT_ASSERT(new_cap >= new_cap_named,
"set of arguments includes set of named arguments");
data_.reserve(new_cap);
named_info_.reserve(new_cap_named);
}
/// Returns the number of elements in the store.
auto size() const noexcept -> size_t { return data_.size(); }
};
FMT_END_NAMESPACE
#endif // FMT_ARGS_H_
================================================
FILE: include/fmt/base.h
================================================
// Formatting library for C++ - the base API for char/UTF-8
//
// Copyright (c) 2012 - present, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
#ifndef FMT_BASE_H_
#define FMT_BASE_H_
#if defined(FMT_IMPORT_STD) && !defined(FMT_MODULE)
# define FMT_MODULE
#endif
#ifndef FMT_MODULE
# include <limits.h> // CHAR_BIT
# include <stdio.h> // FILE
# include <string.h> // memcmp
# include <type_traits> // std::enable_if
#endif
// The fmt library version in the form major * 10000 + minor * 100 + patch.
#define FMT_VERSION 120000
// Detect compiler versions.
#if defined(__clang__) && !defined(__ibmxl__)
# define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__)
#else
# define FMT_CLANG_VERSION 0
#endif
#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
# define FMT_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
#else
# define FMT_GCC_VERSION 0
#endif
#if defined(__ICL)
# define FMT_ICC_VERSION __ICL
#elif defined(__INTEL_COMPILER)
# define FMT_ICC_VERSION __INTEL_COMPILER
#else
# define FMT_ICC_VERSION 0
#endif
#if defined(_MSC_VER)
# define FMT_MSC_VERSION _MSC_VER
#else
# define FMT_MSC_VERSION 0
#endif
// Detect standard library versions.
#ifdef _GLIBCXX_RELEASE
# define FMT_GLIBCXX_RELEASE _GLIBCXX_RELEASE
#else
# define FMT_GLIBCXX_RELEASE 0
#endif
#ifdef _LIBCPP_VERSION
# define FMT_LIBCPP_VERSION _LIBCPP_VERSION
#else
# define FMT_LIBCPP_VERSION 0
#endif
#ifdef _MSVC_LANG
# define FMT_CPLUSPLUS _MSVC_LANG
#else
# define FMT_CPLUSPLUS __cplusplus
#endif
// Detect __has_*.
#ifdef __has_feature
# define FMT_HAS_FEATURE(x) __has_feature(x)
#else
# define FMT_HAS_FEATURE(x) 0
#endif
#ifdef __has_include
# define FMT_HAS_INCLUDE(x) __has_include(x)
#else
# define FMT_HAS_INCLUDE(x) 0
#endif
#ifdef __has_builtin
# define FMT_HAS_BUILTIN(x) __has_builtin(x)
#else
# define FMT_HAS_BUILTIN(x) 0
#endif
#ifdef __has_cpp_attribute
# define FMT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
#else
# define FMT_HAS_CPP_ATTRIBUTE(x) 0
#endif
#define FMT_HAS_CPP14_ATTRIBUTE(attribute) \
(FMT_CPLUSPLUS >= 201402L && FMT_HAS_CPP_ATTRIBUTE(attribute))
#define FMT_HAS_CPP17_ATTRIBUTE(attribute) \
(FMT_CPLUSPLUS >= 201703L && FMT_HAS_CPP_ATTRIBUTE(attribute))
// Detect C++14 relaxed constexpr.
#ifdef FMT_USE_CONSTEXPR
// Use the provided definition.
#elif FMT_GCC_VERSION >= 702 && FMT_CPLUSPLUS >= 201402L
// GCC only allows constexpr member functions in non-literal types since 7.2:
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66297.
# define FMT_USE_CONSTEXPR 1
#elif FMT_ICC_VERSION
# define FMT_USE_CONSTEXPR 0 // https://github.com/fmtlib/fmt/issues/1628
#elif FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VERSION >= 1912
# define FMT_USE_CONSTEXPR 1
#else
# define FMT_USE_CONSTEXPR 0
#endif
#if FMT_USE_CONSTEXPR
# define FMT_CONSTEXPR constexpr
#else
# define FMT_CONSTEXPR
#endif
// Detect consteval, C++20 constexpr extensions and std::is_constant_evaluated.
#if !defined(__cpp_lib_is_constant_evaluated)
# define FMT_USE_CONSTEVAL 0
#elif FMT_CPLUSPLUS < 201709L
# define FMT_USE_CONSTEVAL 0
#elif FMT_GLIBCXX_RELEASE && FMT_GLIBCXX_RELEASE < 10
# define FMT_USE_CONSTEVAL 0
#elif FMT_LIBCPP_VERSION && FMT_LIBCPP_VERSION < 10000
# define FMT_USE_CONSTEVAL 0
#elif defined(__apple_build_version__) && __apple_build_version__ < 14000029L
# define FMT_USE_CONSTEVAL 0 // consteval is broken in Apple clang < 14.
#elif FMT_MSC_VERSION && FMT_MSC_VERSION < 1929
# define FMT_USE_CONSTEVAL 0 // consteval is broken in MSVC VS2019 < 16.10.
#elif defined(__cpp_consteval)
# define FMT_USE_CONSTEVAL 1
#elif FMT_GCC_VERSION >= 1002 || FMT_CLANG_VERSION >= 1101
# define FMT_USE_CONSTEVAL 1
#else
# define FMT_USE_CONSTEVAL 0
#endif
#if FMT_USE_CONSTEVAL
# define FMT_CONSTEVAL consteval
# define FMT_CONSTEXPR20 constexpr
#else
# define FMT_CONSTEVAL
# define FMT_CONSTEXPR20
#endif
// Check if exceptions are disabled.
#ifdef FMT_USE_EXCEPTIONS
// Use the provided definition.
#elif defined(__GNUC__) && !defined(__EXCEPTIONS)
# define FMT_USE_EXCEPTIONS 0
#elif defined(__clang__) && !defined(__cpp_exceptions)
# define FMT_USE_EXCEPTIONS 0
#elif FMT_MSC_VERSION && !_HAS_EXCEPTIONS
# define FMT_USE_EXCEPTIONS 0
#else
# define FMT_USE_EXCEPTIONS 1
#endif
#if FMT_USE_EXCEPTIONS
# define FMT_TRY try
# define FMT_CATCH(x) catch (x)
#else
# define FMT_TRY if (true)
# define FMT_CATCH(x) if (false)
#endif
#ifdef FMT_NO_UNIQUE_ADDRESS
// Use the provided definition.
#elif FMT_CPLUSPLUS < 202002L
// Not supported.
#elif FMT_HAS_CPP_ATTRIBUTE(no_unique_address)
# define FMT_NO_UNIQUE_ADDRESS [[no_unique_address]]
// VS2019 v16.10 and later except clang-cl (https://reviews.llvm.org/D110485).
#elif FMT_MSC_VERSION >= 1929 && !FMT_CLANG_VERSION
# define FMT_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
#endif
#ifndef FMT_NO_UNIQUE_ADDRESS
# define FMT_NO_UNIQUE_ADDRESS
#endif
#if FMT_HAS_CPP17_ATTRIBUTE(fallthrough)
# define FMT_FALLTHROUGH [[fallthrough]]
#elif defined(__clang__)
# define FMT_FALLTHROUGH [[clang::fallthrough]]
#elif FMT_GCC_VERSION >= 700 && \
(!defined(__EDG_VERSION__) || __EDG_VERSION__ >= 520)
# define FMT_FALLTHROUGH [[gnu::fallthrough]]
#else
# define FMT_FALLTHROUGH
#endif
// Disable [[noreturn]] on MSVC/NVCC because of bogus unreachable code warnings.
#if FMT_HAS_CPP_ATTRIBUTE(noreturn) && !FMT_MSC_VERSION && !defined(__NVCC__)
# define FMT_NORETURN [[noreturn]]
#else
# define FMT_NORETURN
#endif
#ifdef FMT_NODISCARD
// Use the provided definition.
#elif FMT_HAS_CPP17_ATTRIBUTE(nodiscard)
# define FMT_NODISCARD [[nodiscard]]
#else
# define FMT_NODISCARD
#endif
#if FMT_GCC_VERSION || FMT_CLANG_VERSION
# define FMT_VISIBILITY(value) __attribute__((visibility(value)))
#else
# define FMT_VISIBILITY(value)
#endif
// Detect pragmas.
#define FMT_PRAGMA_IMPL(x) _Pragma(#x)
#if FMT_GCC_VERSION >= 504 && !defined(__NVCOMPILER)
// Workaround a _Pragma bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59884
// and an nvhpc warning: https://github.com/fmtlib/fmt/pull/2582.
# define FMT_PRAGMA_GCC(x) FMT_PRAGMA_IMPL(GCC x)
#else
# define FMT_PRAGMA_GCC(x)
#endif
#if FMT_CLANG_VERSION
# define FMT_PRAGMA_CLANG(x) FMT_PRAGMA_IMPL(clang x)
#else
# define FMT_PRAGMA_CLANG(x)
#endif
#if FMT_MSC_VERSION
# define FMT_MSC_WARNING(...) __pragma(warning(__VA_ARGS__))
#else
# define FMT_MSC_WARNING(...)
#endif
// Enable minimal optimizations for more compact code in debug mode.
FMT_PRAGMA_GCC(push_options)
#if !defined(__OPTIMIZE__) && !defined(__CUDACC__) && !defined(FMT_MODULE)
FMT_PRAGMA_GCC(optimize("Og"))
# define FMT_GCC_OPTIMIZED
#endif
FMT_PRAGMA_CLANG(diagnostic push)
#ifdef FMT_ALWAYS_INLINE
// Use the provided definition.
#elif FMT_GCC_VERSION || FMT_CLANG_VERSION
# define FMT_ALWAYS_INLINE inline __attribute__((always_inline))
#else
# define FMT_ALWAYS_INLINE inline
#endif
// A version of FMT_ALWAYS_INLINE to prevent code bloat in debug mode.
#if defined(NDEBUG) || defined(FMT_GCC_OPTIMIZED)
# define FMT_INLINE FMT_ALWAYS_INLINE
#else
# define FMT_INLINE inline
#endif
#ifndef FMT_BEGIN_NAMESPACE
# define FMT_BEGIN_NAMESPACE \
namespace fmt { \
inline namespace v12 {
# define FMT_END_NAMESPACE \
} \
}
#endif
#ifndef FMT_EXPORT
# define FMT_EXPORT
# define FMT_BEGIN_EXPORT
# define FMT_END_EXPORT
#endif
#ifdef _WIN32
# define FMT_WIN32 1
#else
# define FMT_WIN32 0
#endif
#if !defined(FMT_HEADER_ONLY) && FMT_WIN32
# if defined(FMT_LIB_EXPORT)
# define FMT_API __declspec(dllexport)
# elif defined(FMT_SHARED)
# define FMT_API __declspec(dllimport)
# endif
#elif defined(FMT_LIB_EXPORT) || defined(FMT_SHARED)
# define FMT_API FMT_VISIBILITY("default")
#endif
#ifndef FMT_API
# define FMT_API
#endif
#ifndef FMT_OPTIMIZE_SIZE
# define FMT_OPTIMIZE_SIZE 0
#endif
// FMT_BUILTIN_TYPE=0 may result in smaller library size at the cost of higher
// per-call binary size by passing built-in types through the extension API.
#ifndef FMT_BUILTIN_TYPES
# define FMT_BUILTIN_TYPES 1
#endif
#define FMT_APPLY_VARIADIC(expr) \
using unused = int[]; \
(void)unused { 0, (expr, 0)... }
FMT_BEGIN_NAMESPACE
// Implementations of enable_if_t and other metafunctions for older systems.
template <bool B, typename T = void>
using enable_if_t = typename std::enable_if<B, T>::type;
template <bool B, typename T, typename F>
using conditional_t = typename std::conditional<B, T, F>::type;
template <bool B> using bool_constant = std::integral_constant<bool, B>;
template <typename T>
using remove_reference_t = typename std::remove_reference<T>::type;
template <typename T>
using remove_const_t = typename std::remove_const<T>::type;
template <typename T>
using remove_cvref_t = typename std::remove_cv<remove_reference_t<T>>::type;
template <typename T>
using make_unsigned_t = typename std::make_unsigned<T>::type;
template <typename T>
using underlying_t = typename std::underlying_type<T>::type;
template <typename T> using decay_t = typename std::decay<T>::type;
using nullptr_t = decltype(nullptr);
#if (FMT_GCC_VERSION && FMT_GCC_VERSION < 500) || FMT_MSC_VERSION
// A workaround for gcc 4.9 & MSVC v141 to make void_t work in a SFINAE context.
template <typename...> struct void_t_impl {
using type = void;
};
template <typename... T> using void_t = typename void_t_impl<T...>::type;
#else
template <typename...> using void_t = void;
#endif
struct monostate {
constexpr monostate() {}
};
// An enable_if helper to be used in template parameters which results in much
// shorter symbols: https://godbolt.org/z/sWw4vP. Extra parentheses are needed
// to workaround a bug in MSVC 2019 (see #1140 and #1186).
#ifdef FMT_DOC
# define FMT_ENABLE_IF(...)
#else
# define FMT_ENABLE_IF(...) fmt::enable_if_t<(__VA_ARGS__), int> = 0
#endif
template <typename T> constexpr auto min_of(T a, T b) -> T {
return a < b ? a : b;
}
template <typename T> constexpr auto max_of(T a, T b) -> T {
return a > b ? a : b;
}
FMT_NORETURN FMT_API void assert_fail(const char* file, int line,
const char* message);
namespace detail {
// Suppresses "unused variable" warnings with the method described in
// https://herbsutter.com/2009/10/18/mailbag-shutting-up-compiler-warnings/.
// (void)var does not work on many Intel compilers.
template <typename... T> FMT_CONSTEXPR void ignore_unused(const T&...) {}
constexpr auto is_constant_evaluated(bool default_value = false) noexcept
-> bool {
// Workaround for incompatibility between clang 14 and libstdc++ consteval-based
// std::is_constant_evaluated: https://github.com/fmtlib/fmt/issues/3247.
#if FMT_CPLUSPLUS >= 202002L && FMT_GLIBCXX_RELEASE >= 12 && \
(FMT_CLANG_VERSION >= 1400 && FMT_CLANG_VERSION < 1500)
ignore_unused(default_value);
return __builtin_is_constant_evaluated();
#elif defined(__cpp_lib_is_constant_evaluated)
ignore_unused(default_value);
return std::is_constant_evaluated();
#else
return default_value;
#endif
}
// Suppresses "conditional expression is constant" warnings.
template <typename T> FMT_ALWAYS_INLINE constexpr auto const_check(T val) -> T {
return val;
}
FMT_NORETURN FMT_API void assert_fail(const char* file, int line,
const char* message);
#if defined(FMT_ASSERT)
// Use the provided definition.
#elif defined(NDEBUG)
// FMT_ASSERT is not empty to avoid -Wempty-body.
# define FMT_ASSERT(condition, message) \
fmt::detail::ignore_unused((condition), (message))
#else
# define FMT_ASSERT(condition, message) \
((condition) /* void() fails with -Winvalid-constexpr on clang 4.0.1 */ \
? (void)0 \
: ::fmt::assert_fail(__FILE__, __LINE__, (message)))
#endif
#ifdef FMT_USE_INT128
// Use the provided definition.
#elif defined(__SIZEOF_INT128__) && !defined(__NVCC__) && \
!(FMT_CLANG_VERSION && FMT_MSC_VERSION)
# define FMT_USE_INT128 1
using int128_opt = __int128_t; // An optional native 128-bit integer.
using uint128_opt = __uint128_t;
inline auto map(int128_opt x) -> int128_opt { return x; }
inline auto map(uint128_opt x) -> uint128_opt { return x; }
#else
# define FMT_USE_INT128 0
#endif
#if !FMT_USE_INT128
enum class int128_opt {};
enum class uint128_opt {};
// Reduce template instantiations.
inline auto map(int128_opt) -> monostate { return {}; }
inline auto map(uint128_opt) -> monostate { return {}; }
#endif
#ifndef FMT_USE_BITINT
# define FMT_USE_BITINT (FMT_CLANG_VERSION >= 1500)
#endif
#if FMT_USE_BITINT
FMT_PRAGMA_CLANG(diagnostic ignored "-Wbit-int-extension")
template <int N> using bitint = _BitInt(N);
template <int N> using ubitint = unsigned _BitInt(N);
#else
template <int N> struct bitint {};
template <int N> struct ubitint {};
#endif // FMT_USE_BITINT
// Casts a nonnegative integer to unsigned.
template <typename Int>
FMT_CONSTEXPR auto to_unsigned(Int value) -> make_unsigned_t<Int> {
FMT_ASSERT(std::is_unsigned<Int>::value || value >= 0, "negative value");
return static_cast<make_unsigned_t<Int>>(value);
}
template <typename Char>
using unsigned_char = conditional_t<sizeof(Char) == 1, unsigned char, unsigned>;
// A heuristic to detect std::string and std::[experimental::]string_view.
// It is mainly used to avoid dependency on <[experimental/]string_view>.
template <typename T, typename Enable = void>
struct is_std_string_like : std::false_type {};
template <typename T>
struct is_std_string_like<T, void_t<decltype(std::declval<T>().find_first_of(
typename T::value_type(), 0))>>
: std::is_convertible<decltype(std::declval<T>().data()),
const typename T::value_type*> {};
// Check if the literal encoding is UTF-8.
enum { is_utf8_enabled = "\u00A7"[1] == '\xA7' };
enum { use_utf8 = !FMT_WIN32 || is_utf8_enabled };
#ifndef FMT_UNICODE
# define FMT_UNICODE 1
#endif
static_assert(!FMT_UNICODE || use_utf8,
"Unicode support requires compiling with /utf-8");
template <typename T> constexpr auto narrow(T*) -> char* { return nullptr; }
constexpr FMT_ALWAYS_INLINE auto narrow(const char* s) -> const char* {
return s;
}
template <typename Char>
FMT_CONSTEXPR auto compare(const Char* s1, const Char* s2, size_t n) -> int {
if (!is_constant_evaluated() && sizeof(Char) == 1) return memcmp(s1, s2, n);
for (; n != 0; ++s1, ++s2, --n) {
if (*s1 < *s2) return -1;
if (*s1 > *s2) return 1;
}
return 0;
}
namespace adl {
using namespace std;
template <typename Container>
auto invoke_back_inserter()
-> decltype(back_inserter(std::declval<Container&>()));
} // namespace adl
template <typename It, typename Enable = std::true_type>
struct is_back_insert_iterator : std::false_type {};
template <typename It>
struct is_back_insert_iterator<
It, bool_constant<std::is_same<
decltype(adl::invoke_back_inserter<typename It::container_type>()),
It>::value>> : std::true_type {};
// Extracts a reference to the container from *insert_iterator.
template <typename OutputIt>
inline FMT_CONSTEXPR20 auto get_container(OutputIt it) ->
typename OutputIt::container_type& {
struct accessor : OutputIt {
FMT_CONSTEXPR20 accessor(OutputIt base) : OutputIt(base) {}
using OutputIt::container;
};
return *accessor(it).container;
}
} // namespace detail
// Parsing-related public API and forward declarations.
FMT_BEGIN_EXPORT
/**
* An implementation of `std::basic_string_view` for pre-C++17. It provides a
* subset of the API. `fmt::basic_string_view` is used for format strings even
* if `std::basic_string_view` is available to prevent issues when a library is
* compiled with a different `-std` option than the client code (which is not
* recommended).
*/
template <typename Char> class basic_string_view {
private:
const Char* data_;
size_t size_;
public:
using value_type = Char;
using iterator = const Char*;
constexpr basic_string_view() noexcept : data_(nullptr), size_(0) {}
/// Constructs a string view object from a C string and a size.
constexpr basic_string_view(const Char* s, size_t count) noexcept
: data_(s), size_(count) {}
constexpr basic_string_view(nullptr_t) = delete;
/// Constructs a string view object from a C string.
#if FMT_GCC_VERSION
FMT_ALWAYS_INLINE
#endif
FMT_CONSTEXPR20 basic_string_view(const Char* s) : data_(s) {
#if FMT_HAS_BUILTIN(__builtin_strlen) || FMT_GCC_VERSION || FMT_CLANG_VERSION
if (std::is_same<Char, char>::value && !detail::is_constant_evaluated()) {
size_ = __builtin_strlen(detail::narrow(s)); // strlen is not constexpr.
return;
}
#endif
size_t len = 0;
while (*s++) ++len;
size_ = len;
}
/// Constructs a string view from a `std::basic_string` or a
/// `std::basic_string_view` object.
template <typename S,
FMT_ENABLE_IF(detail::is_std_string_like<S>::value&& std::is_same<
typename S::value_type, Char>::value)>
FMT_CONSTEXPR basic_string_view(const S& s) noexcept
: data_(s.data()), size_(s.size()) {}
/// Returns a pointer to the string data.
constexpr auto data() const noexcept -> const Char* { return data_; }
/// Returns the string size.
constexpr auto size() const noexcept -> size_t { return size_; }
constexpr auto begin() const noexcept -> iterator { return data_; }
constexpr auto end() const noexcept -> iterator { return data_ + size_; }
constexpr auto operator[](size_t pos) const noexcept -> const Char& {
return data_[pos];
}
FMT_CONSTEXPR void remove_prefix(size_t n) noexcept {
data_ += n;
size_ -= n;
}
FMT_CONSTEXPR auto starts_with(basic_string_view<Char> sv) const noexcept
-> bool {
return size_ >= sv.size_ && detail::compare(data_, sv.data_, sv.size_) == 0;
}
FMT_CONSTEXPR auto starts_with(Char c) const noexcept -> bool {
return size_ >= 1 && *data_ == c;
}
FMT_CONSTEXPR auto starts_with(const Char* s) const -> bool {
return starts_with(basic_string_view<Char>(s));
}
FMT_CONSTEXPR auto compare(basic_string_view other) const -> int {
int result =
detail::compare(data_, other.data_, min_of(size_, other.size_));
if (result != 0) return result;
return size_ == other.size_ ? 0 : (size_ < other.size_ ? -1 : 1);
}
FMT_CONSTEXPR friend auto operator==(basic_string_view lhs,
basic_string_view rhs) -> bool {
return lhs.compare(rhs) == 0;
}
friend auto operator!=(basic_string_view lhs, basic_string_view rhs) -> bool {
return lhs.compare(rhs) != 0;
}
friend auto operator<(basic_string_view lhs, basic_string_view rhs) -> bool {
return lhs.compare(rhs) < 0;
}
friend auto operator<=(basic_string_view lhs, basic_string_view rhs) -> bool {
return lhs.compare(rhs) <= 0;
}
friend auto operator>(basic_string_view lhs, basic_string_view rhs) -> bool {
return lhs.compare(rhs) > 0;
}
friend auto operator>=(basic_string_view lhs, basic_string_view rhs) -> bool {
return lhs.compare(rhs) >= 0;
}
};
using string_view = basic_string_view<char>;
template <typename T> class basic_appender;
using appender = basic_appender<char>;
// Checks whether T is a container with contiguous storage.
template <typename T> struct is_contiguous : std::false_type {};
class context;
template <typename OutputIt, typename Char> class generic_context;
template <typename Char> class parse_context;
// Longer aliases for C++20 compatibility.
template <typename Char> using basic_format_parse_context = parse_context<Char>;
using format_parse_context = parse_context<char>;
template <typename OutputIt, typename Char>
using basic_format_context =
conditional_t<std::is_same<OutputIt, appender>::value, context,
generic_context<OutputIt, Char>>;
using format_context = context;
template <typename Char>
using buffered_context =
conditional_t<std::is_same<Char, char>::value, context,
generic_context<basic_appender<Char>, Char>>;
template <typename Context> class basic_format_arg;
template <typename Context> class basic_format_args;
// A separate type would result in shorter symbols but break ABI compatibility
// between clang and gcc on ARM (#1919).
using format_args = basic_format_args<context>;
// A formatter for objects of type T.
template <typename T, typename Char = char, typename Enable = void>
struct formatter {
// A deleted default constructor indicates a disabled formatter.
formatter() = delete;
};
/// Reports a format error at compile time or, via a `format_error` exception,
/// at runtime.
// This function is intentionally not constexpr to give a compile-time error.
FMT_NORETURN FMT_API void report_error(const char* message);
enum class presentation_type : unsigned char {
// Common specifiers:
none = 0,
debug = 1, // '?'
string = 2, // 's' (string, bool)
// Integral, bool and character specifiers:
dec = 3, // 'd'
hex, // 'x' or 'X'
oct, // 'o'
bin, // 'b' or 'B'
chr, // 'c'
// String and pointer specifiers:
pointer = 3, // 'p'
// Floating-point specifiers:
exp = 1, // 'e' or 'E' (1 since there is no FP debug presentation)
fixed, // 'f' or 'F'
general, // 'g' or 'G'
hexfloat // 'a' or 'A'
};
enum class align { none, left, right, center, numeric };
enum class sign { none, minus, plus, space };
enum class arg_id_kind { none, index, name };
// Basic format specifiers for built-in and string types.
class basic_specs {
private:
// Data is arranged as follows:
//
// 0 1 2 3
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
// |type |align| w | p | s |u|#|L| f | unused |
// +-----+-----+---+---+---+-+-+-+-----+---------------------------+
//
// w - dynamic width info
// p - dynamic precision info
// s - sign
// u - uppercase (e.g. 'X' for 'x')
// # - alternate form ('#')
// L - localized
// f - fill size
//
// Bitfields are not used because of compiler bugs such as gcc bug 61414.
enum : unsigned {
type_mask = 0x00007,
align_mask = 0x00038,
width_mask = 0x000C0,
precision_mask = 0x00300,
sign_mask = 0x00C00,
uppercase_mask = 0x01000,
alternate_mask = 0x02000,
localized_mask = 0x04000,
fill_size_mask = 0x38000,
align_shift = 3,
width_shift = 6,
precision_shift = 8,
sign_shift = 10,
fill_size_shift = 15,
max_fill_size = 4
};
unsigned data_ = 1 << fill_size_shift;
static_assert(sizeof(basic_specs::data_) * CHAR_BIT >= 18, "");
// Character (code unit) type is erased to prevent template bloat.
char fill_data_[max_fill_size] = {' '};
FMT_CONSTEXPR void set_fill_size(size_t size) {
data_ = (data_ & ~fill_size_mask) |
(static_cast<unsigned>(size) << fill_size_shift);
}
public:
constexpr auto type() const -> presentation_type {
return static_cast<presentation_type>(data_ & type_mask);
}
FMT_CONSTEXPR void set_type(presentation_type t) {
data_ = (data_ & ~type_mask) | static_cast<unsigned>(t);
}
constexpr auto align() const -> align {
return static_cast<fmt::align>((data_ & align_mask) >> align_shift);
}
FMT_CONSTEXPR void set_align(fmt::align a) {
data_ = (data_ & ~align_mask) | (static_cast<unsigned>(a) << align_shift);
}
constexpr auto dynamic_width() const -> arg_id_kind {
return static_cast<arg_id_kind>((data_ & width_mask) >> width_shift);
}
FMT_CONSTEXPR void set_dynamic_width(arg_id_kind w) {
data_ = (data_ & ~width_mask) | (static_cast<unsigned>(w) << width_shift);
}
FMT_CONSTEXPR auto dynamic_precision() const -> arg_id_kind {
return static_cast<arg_id_kind>((data_ & precision_mask) >>
precision_shift);
}
FMT_CONSTEXPR void set_dynamic_precision(arg_id_kind p) {
data_ = (data_ & ~precision_mask) |
(static_cast<unsigned>(p) << precision_shift);
}
constexpr auto dynamic() const -> bool {
return (data_ & (width_mask | precision_mask)) != 0;
}
constexpr auto sign() const -> sign {
return static_cast<fmt::sign>((data_ & sign_mask) >> sign_shift);
}
FMT_CONSTEXPR void set_sign(fmt::sign s) {
data_ = (data_ & ~sign_mask) | (static_cast<unsigned>(s) << sign_shift);
}
constexpr auto upper() const -> bool { return (data_ & uppercase_mask) != 0; }
FMT_CONSTEXPR void set_upper() { data_ |= uppercase_mask; }
constexpr auto alt() const -> bool { return (data_ & alternate_mask) != 0; }
FMT_CONSTEXPR void set_alt() { data_ |= alternate_mask; }
FMT_CONSTEXPR void clear_alt() { data_ &= ~alternate_mask; }
constexpr auto localized() const -> bool {
return (data_ & localized_mask) != 0;
}
FMT_CONSTEXPR void set_localized() { data_ |= localized_mask; }
constexpr auto fill_size() const -> size_t {
return (data_ & fill_size_mask) >> fill_size_shift;
}
template <typename Char, FMT_ENABLE_IF(std::is_same<Char, char>::value)>
constexpr auto fill() const -> const Char* {
return fill_data_;
}
template <typename Char, FMT_ENABLE_IF(!std::is_same<Char, char>::value)>
constexpr auto fill() const -> const Char* {
return nullptr;
}
template <typename Char> constexpr auto fill_unit() const -> Char {
using uchar = unsigned char;
return static_cast<Char>(static_cast<uchar>(fill_data_[0]) |
(static_cast<uchar>(fill_data_[1]) << 8) |
(static_cast<uchar>(fill_data_[2]) << 16));
}
FMT_CONSTEXPR void set_fill(char c) {
fill_data_[0] = c;
set_fill_size(1);
}
template <typename Char>
FMT_CONSTEXPR void set_fill(basic_string_view<Char> s) {
auto size = s.size();
set_fill_size(size);
if (size == 1) {
unsigned uchar = static_cast<detail::unsigned_char<Char>>(s[0]);
fill_data_[0] = static_cast<char>(uchar);
fill_data_[1] = static_cast<char>(uchar >> 8);
fill_data_[2] = static_cast<char>(uchar >> 16);
return;
}
FMT_ASSERT(size <= max_fill_size, "invalid fill");
for (size_t i = 0; i < size; ++i)
fill_data_[i & 3] = static_cast<char>(s[i]);
}
FMT_CONSTEXPR void copy_fill_from(const basic_specs& specs) {
set_fill_size(specs.fill_size());
for (size_t i = 0; i < max_fill_size; ++i)
fill_data_[i] = specs.fill_data_[i];
}
};
// Format specifiers for built-in and string types.
struct format_specs : basic_specs {
int width;
int precision;
constexpr format_specs() : width(0), precision(-1) {}
};
/**
* Parsing context consisting of a format string range being parsed and an
* argument counter for automatic indexing.
*/
template <typename Char = char> class parse_context {
private:
basic_string_view<Char> fmt_;
int next_arg_id_;
enum { use_constexpr_cast = !FMT_GCC_VERSION || FMT_GCC_VERSION >= 1200 };
FMT_CONSTEXPR void do_check_arg_id(int arg_id);
public:
using char_type = Char;
using iterator = const Char*;
constexpr explicit parse_context(basic_string_view<Char> fmt,
int next_arg_id = 0)
: fmt_(fmt), next_arg_id_(next_arg_id) {}
/// Returns an iterator to the beginning of the format string range being
/// parsed.
constexpr auto begin() const noexcept -> iterator { return fmt_.begin(); }
/// Returns an iterator past the end of the format string range being parsed.
constexpr auto end() const noexcept -> iterator { return fmt_.end(); }
/// Advances the begin iterator to `it`.
FMT_CONSTEXPR void advance_to(iterator it) {
fmt_.remove_prefix(detail::to_unsigned(it - begin()));
}
/// Reports an error if using the manual argument indexing; otherwise returns
/// the next argument index and switches to the automatic indexing.
FMT_CONSTEXPR auto next_arg_id() -> int {
if (next_arg_id_ < 0) {
report_error("cannot switch from manual to automatic argument indexing");
return 0;
}
int id = next_arg_id_++;
do_check_arg_id(id);
return id;
}
/// Reports an error if using the automatic argument indexing; otherwise
/// switches to the manual indexing.
FMT_CONSTEXPR void check_arg_id(int id) {
if (next_arg_id_ > 0) {
report_error("cannot switch from automatic to manual argument indexing");
return;
}
next_arg_id_ = -1;
do_check_arg_id(id);
}
FMT_CONSTEXPR void check_arg_id(basic_string_view<Char>) {
next_arg_id_ = -1;
}
FMT_CONSTEXPR void check_dynamic_spec(int arg_id);
};
#ifndef FMT_USE_LOCALE
# define FMT_USE_LOCALE (FMT_OPTIMIZE_SIZE <= 1)
#endif
// A type-erased reference to std::locale to avoid the heavy <locale> include.
class locale_ref {
#if FMT_USE_LOCALE
private:
const void* locale_; // A type-erased pointer to std::locale.
public:
constexpr locale_ref() : locale_(nullptr) {}
template <typename Locale, FMT_ENABLE_IF(sizeof(Locale::collate) != 0)>
locale_ref(const Locale& loc);
inline explicit operator bool() const noexcept { return locale_ != nullptr; }
#endif // FMT_USE_LOCALE
public:
template <typename Locale> auto get() const -> Locale;
};
FMT_END_EXPORT
namespace detail {
// Specifies if `T` is a code unit type.
template <typename T> struct is_code_unit : std::false_type {};
template <> struct is_code_unit<char> : std::true_type {};
template <> struct is_code_unit<wchar_t> : std::true_type {};
template <> struct is_code_unit<char16_t> : std::true_type {};
template <> struct is_code_unit<char32_t> : std::true_type {};
#ifdef __cpp_char8_t
template <> struct is_code_unit<char8_t> : bool_constant<is_utf8_enabled> {};
#endif
// Constructs fmt::basic_string_view<Char> from types implicitly convertible
// to it, deducing Char. Explicitly convertible types such as the ones returned
// from FMT_STRING are intentionally excluded.
template <typename Char, FMT_ENABLE_IF(is_code_unit<Char>::value)>
constexpr auto to_string_view(const Char* s) -> basic_string_view<Char> {
return s;
}
template <typename T, FMT_ENABLE_IF(is_std_string_like<T>::value)>
constexpr auto to_string_view(const T& s)
-> basic_string_view<typename T::value_type> {
return s;
}
template <typename Char>
constexpr auto to_string_view(basic_string_view<Char> s)
-> basic_string_view<Char> {
return s;
}
template <typename T, typename Enable = void>
struct has_to_string_view : std::false_type {};
// detail:: is intentional since to_string_view is not an extension point.
template <typename T>
struct has_to_string_view<
T, void_t<decltype(detail::to_string_view(std::declval<T>()))>>
: std::true_type {};
/// String's character (code unit) type. detail:: is intentional to prevent ADL.
template <typename S,
typename V = decltype(detail::to_string_view(std::declval<S>()))>
using char_t = typename V::value_type;
enum class type {
none_type,
// Integer types should go first,
int_type,
uint_type,
long_long_type,
ulong_long_type,
int128_type,
uint128_type,
bool_type,
char_type,
last_integer_type = char_type,
// followed by floating-point types.
float_type,
double_type,
long_double_type,
last_numeric_type = long_double_type,
cstring_type,
string_type,
pointer_type,
custom_type
};
// Maps core type T to the corresponding type enum constant.
template <typename T, typename Char>
struct type_constant : std::integral_constant<type, type::custom_type> {};
#define FMT_TYPE_CONSTANT(Type, constant) \
template <typename Char> \
struct type_constant<Type, Char> \
: std::integral_constant<type, type::constant> {}
FMT_TYPE_CONSTANT(int, int_type);
FMT_TYPE_CONSTANT(unsigned, uint_type);
FMT_TYPE_CONSTANT(long long, long_long_type);
FMT_TYPE_CONSTANT(unsigned long long, ulong_long_type);
FMT_TYPE_CONSTANT(int128_opt, int128_type);
FMT_TYPE_CONSTANT(uint128_opt, uint128_type);
FMT_TYPE_CONSTANT(bool, bool_type);
FMT_TYPE_CONSTANT(Char, char_type);
FMT_TYPE_CONSTANT(float, float_type);
FMT_TYPE_CONSTANT(double, double_type);
FMT_TYPE_CONSTANT(long double, long_double_type);
FMT_TYPE_CONSTANT(const Char*, cstring_type);
FMT_TYPE_CONSTANT(basic_string_view<Char>, string_type);
FMT_TYPE_CONSTANT(const void*, pointer_type);
constexpr auto is_integral_type(type t) -> bool {
return t > type::none_type && t <= type::last_integer_type;
}
constexpr auto is_arithmetic_type(type t) -> bool {
return t > type::none_type && t <= type::last_numeric_type;
}
constexpr auto set(type rhs) -> int { return 1 << static_cast<int>(rhs); }
constexpr auto in(type t, int set) -> bool {
return ((set >> static_cast<int>(t)) & 1) != 0;
}
// Bitsets of types.
enum {
sint_set =
set(type::int_type) | set(type::long_long_type) | set(type::int128_type),
uint_set = set(type::uint_type) | set(type::ulong_long_type) |
set(type::uint128_type),
bool_set = set(type::bool_type),
char_set = set(type::char_type),
float_set = set(type::float_type) | set(type::double_type) |
set(type::long_double_type),
string_set = set(type::string_type),
cstring_set = set(type::cstring_type),
pointer_set = set(type::pointer_type)
};
struct view {};
template <typename T, typename Enable = std::true_type>
struct is_view : std::false_type {};
template <typename T>
struct is_view<T, bool_constant<sizeof(T) != 0>> : std::is_base_of<view, T> {};
template <typename Char, typename T> struct named_arg;
template <typename T> struct is_named_arg : std::false_type {};
template <typename T> struct is_static_named_arg : std::false_type {};
template <typename Char, typename T>
struct is_named_arg<named_arg<Char, T>> : std::true_type {};
template <typename Char, typename T> struct named_arg : view {
const Char* name;
const T& value;
named_arg(const Char* n, const T& v) : name(n), value(v) {}
static_assert(!is_named_arg<T>::value, "nested named arguments");
};
template <bool B = false> constexpr auto count() -> int { return B ? 1 : 0; }
template <bool B1, bool B2, bool... Tail> constexpr auto count() -> int {
return (B1 ? 1 : 0) + count<B2, Tail...>();
}
template <typename... T> constexpr auto count_named_args() -> int {
return count<is_named_arg<T>::value...>();
}
template <typename... T> constexpr auto count_static_named_args() -> int {
return count<is_static_named_arg<T>::value...>();
}
template <typename Char> struct named_arg_info {
const Char* name;
int id;
};
// named_args is non-const to suppress a bogus -Wmaybe-uninitialized in gcc 13.
template <typename Char>
FMT_CONSTEXPR void check_for_duplicate(named_arg_info<Char>* named_args,
int named_arg_index,
basic_string_view<Char> arg_name) {
for (int i = 0; i < named_arg_index; ++i) {
if (named_args[i].name == arg_name) report_error("duplicate named arg");
}
}
template <typename Char, typename T, FMT_ENABLE_IF(!is_named_arg<T>::value)>
void init_named_arg(named_arg_info<Char>*, int& arg_index, int&, const T&) {
++arg_index;
}
template <typename Char, typename T, FMT_ENABLE_IF(is_named_arg<T>::value)>
void init_named_arg(named_arg_info<Char>* named_args, int& arg_index,
int& named_arg_index, const T& arg) {
check_for_duplicate<Char>(named_args, named_arg_index, arg.name);
named_args[named_arg_index++] = {arg.name, arg_index++};
}
template <typename T, typename Char,
FMT_ENABLE_IF(!is_static_named_arg<T>::value)>
FMT_CONSTEXPR void init_static_named_arg(named_arg_info<Char>*, int& arg_index,
int&) {
++arg_index;
}
template <typename T, typename Char,
FMT_ENABLE_IF(is_static_named_arg<T>::value)>
FMT_CONSTEXPR void init_static_named_arg(named_arg_info<Char>* named_args,
int& arg_index, int& named_arg_index) {
check_for_duplicate<Char>(named_args, named_arg_index, T::name);
named_args[named_arg_index++] = {T::name, arg_index++};
}
// To minimize the number of types we need to deal with, long is translated
// either to int or to long long depending on its size.
enum { long_short = sizeof(long) == sizeof(int) && FMT_BUILTIN_TYPES };
using long_type = conditional_t<long_short, int, long long>;
using ulong_type = conditional_t<long_short, unsigned, unsigned long long>;
template <typename T>
using format_as_result =
remove_cvref_t<decltype(format_as(std::declval<const T&>()))>;
template <typename T>
using format_as_member_result =
remove_cvref_t<decltype(formatter<T>::format_as(std::declval<const T&>()))>;
template <typename T, typename Enable = std::true_type>
struct use_format_as : std::false_type {};
// format_as member is only used to avoid injection into the std namespace.
template <typename T, typename Enable = std::true_type>
struct use_format_as_member : std::false_type {};
// Only map owning types because mapping views can be unsafe.
template <typename T>
struct use_format_as<
T, bool_constant<std::is_arithmetic<format_as_result<T>>::value>>
: std::true_type {};
template <typename T>
struct use_format_as_member<
T, bool_constant<std::is_arithmetic<format_as_member_result<T>>::value>>
: std::true_type {};
template <typename T, typename U = remove_const_t<T>>
using use_formatter =
bool_constant<(std::is_class<T>::value || std::is_enum<T>::value ||
std::is_union<T>::value || std::is_array<T>::value) &&
!has_to_string_view<T>::value && !is_named_arg<T>::value &&
!use_format_as<T>::value && !use_format_as_member<U>::value>;
template <typename Char, typename T, typename U = remove_const_t<T>>
auto has_formatter_impl(T* p, buffered_context<Char>* ctx = nullptr)
-> decltype(formatter<U, Char>().format(*p, *ctx), std::true_type());
template <typename Char> auto has_formatter_impl(...) -> std::false_type;
// T can be const-qualified to check if it is const-formattable.
template <typename T, typename Char> constexpr auto has_formatter() -> bool {
return decltype(has_formatter_impl<Char>(static_cast<T*>(nullptr)))::value;
}
// Maps formatting argument types to natively supported types or user-defined
// types with formatters. Returns void on errors to be SFINAE-friendly.
template <typename Char> struct type_mapper {
static auto map(signed char) -> int;
static auto map(unsigned char) -> unsigned;
static auto map(short) -> int;
static auto map(unsigned short) -> unsigned;
static auto map(int) -> int;
static auto map(unsigned) -> unsigned;
static auto map(long) -> long_type;
static auto map(unsigned long) -> ulong_type;
static auto map(long long) -> long long;
static auto map(unsigned long long) -> unsigned long long;
static auto map(int128_opt) -> int128_opt;
static auto map(uint128_opt) -> uint128_opt;
static auto map(bool) -> bool;
template <int N>
static auto map(bitint<N>) -> conditional_t<N <= 64, long long, void>;
template <int N>
static auto map(ubitint<N>)
-> conditional_t<N <= 64, unsigned long long, void>;
template <typename T, FMT_ENABLE_IF(is_code_unit<T>::value)>
static auto map(T) -> conditional_t<
std::is_same<T, char>::value || std::is_same<T, Char>::value, Char, void>;
static auto map(float) -> float;
static auto map(double) -> double;
static auto map(long double) -> long double;
static auto map(Char*) -> const Char*;
static auto map(const Char*) -> const Char*;
template <typename T, typename C = char_t<T>,
FMT_ENABLE_IF(!std::is_pointer<T>::value)>
static auto map(const T&) -> conditional_t<std::is_same<C, Char>::value,
basic_string_view<C>, void>;
static auto map(void*) -> const void*;
static auto map(const void*) -> const void*;
static auto map(volatile void*) -> const void*;
static auto map(const volatile void*) -> const void*;
static auto map(nullptr_t) -> const void*;
template <typename T, FMT_ENABLE_IF(std::is_pointer<T>::value ||
std::is_member_pointer<T>::value)>
static auto map(const T&) -> void;
template <typename T, FMT_ENABLE_IF(use_format_as<T>::value)>
static auto map(const T& x) -> decltype(map(format_as(x)));
template <typename T, FMT_ENABLE_IF(use_format_as_member<T>::value)>
static auto map(const T& x) -> decltype(map(formatter<T>::format_as(x)));
template <typename T, FMT_ENABLE_IF(use_formatter<T>::value)>
static auto map(T&) -> conditional_t<has_formatter<T, Char>(), T&, void>;
template <typename T, FMT_ENABLE_IF(is_named_arg<T>::value)>
static auto map(const T& named_arg) -> decltype(map(named_arg.value));
};
// detail:: is used to workaround a bug in MSVC 2017.
template <typename T, typename Char>
using mapped_t = decltype(detail::type_mapper<Char>::map(std::declval<T&>()));
// A type constant after applying type_mapper.
template <typename T, typename Char = char>
using mapped_type_constant = type_constant<mapped_t<T, Char>, Char>;
template <typename T, typename Context,
type TYPE =
mapped_type_constant<T, typename Context::char_type>::value>
using stored_type_constant = std::integral_constant<
type, Context::builtin_types || TYPE == type::int_type ? TYPE
: type::custom_type>;
// A parse context with extra data used only in compile-time checks.
template <typename Char>
class compile_parse_context : public parse_context<Char> {
private:
int num_args_;
const type* types_;
using base = parse_context<Char>;
public:
FMT_CONSTEXPR explicit compile_parse_context(basic_string_view<Char> fmt,
int num_args, const type* types,
int next_arg_id = 0)
: base(fmt, next_arg_id), num_args_(num_args), types_(types) {}
constexpr auto num_args() const -> int { return num_args_; }
constexpr auto arg_type(int id) const -> type { return types_[id]; }
FMT_CONSTEXPR auto next_arg_id() -> int {
int id = base::next_arg_id();
if (id >= num_args_) report_error("argument not found");
return id;
}
FMT_CONSTEXPR void check_arg_id(int id) {
base::check_arg_id(id);
if (id >= num_args_) report_error("argument not found");
}
using base::check_arg_id;
FMT_CONSTEXPR void check_dynamic_spec(int arg_id) {
ignore_unused(arg_id);
if (arg_id < num_args_ && types_ && !is_integral_type(types_[arg_id]))
report_error("width/precision is not integer");
}
};
// An argument reference.
template <typename Char> union arg_ref {
FMT_CONSTEXPR arg_ref(int idx = 0) : index(idx) {}
FMT_CONSTEXPR arg_ref(basic_string_view<Char> n) : name(n) {}
int index;
basic_string_view<Char> name;
};
// Format specifiers with width and precision resolved at formatting rather
// than parsing time to allow reusing the same parsed specifiers with
// different sets of arguments (precompilation of format strings).
template <typename Char = char> struct dynamic_format_specs : format_specs {
arg_ref<Char> width_ref;
arg_ref<Char> precision_ref;
};
// Converts a character to ASCII. Returns '\0' on conversion failure.
template <typename Char, FMT_ENABLE_IF(std::is_integral<Char>::value)>
constexpr auto to_ascii(Char c) -> char {
return c <= 0xff ? static_cast<char>(c) : '\0';
}
// Returns the number of code units in a code point or 1 on error.
template <typename Char>
FMT_CONSTEXPR auto code_point_length(const Char* begin) -> int {
if (const_check(sizeof(Char) != 1)) return 1;
auto c = static_cast<unsigned char>(*begin);
return static_cast<int>((0x3a55000000000000ull >> (2 * (c >> 3))) & 3) + 1;
}
// Parses the range [begin, end) as an unsigned integer. This function assumes
// that the range is non-empty and the first character is a digit.
template <typename Char>
FMT_CONSTEXPR auto parse_nonnegative_int(const Char*& begin, const Char* end,
int error_value) noexcept -> int {
FMT_ASSERT(begin != end && '0' <= *begin && *begin <= '9', "");
unsigned value = 0, prev = 0;
auto p = begin;
do {
prev = value;
value = value * 10 + unsigned(*p - '0');
++p;
} while (p != end && '0' <= *p && *p <= '9');
auto num_digits = p - begin;
begin = p;
int digits10 = static_cast<int>(sizeof(int) * CHAR_BIT * 3 / 10);
if (num_digits <= digits10) return static_cast<int>(value);
// Check for overflow.
unsigned max = INT_MAX;
return num_digits == digits10 + 1 &&
prev * 10ull + unsigned(p[-1] - '0') <= max
? static_cast<int>(value)
: error_value;
}
FMT_CONSTEXPR inline auto parse_align(char c) -> align {
switch (c) {
case '<': return align::left;
case '>': return align::right;
case '^': return align::center;
}
return align::none;
}
template <typename Char> constexpr auto is_name_start(Char c) -> bool {
return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '_';
}
template <typename Char, typename Handler>
FMT_CONSTEXPR auto parse_arg_id(const Char* begin, const Char* end,
Handler&& handler) -> const Char* {
Char c = *begin;
if (c >= '0' && c <= '9') {
int index = 0;
if (c != '0')
index = parse_nonnegative_int(begin, end, INT_MAX);
else
++begin;
if (begin == end || (*begin != '}' && *begin != ':'))
report_error("invalid format string");
else
handler.on_index(index);
return begin;
}
if (FMT_OPTIMIZE_SIZE > 1 || !is_name_start(c)) {
report_error("invalid format string");
return begin;
}
auto it = begin;
do {
++it;
} while (it != end && (is_name_start(*it) || ('0' <= *it && *it <= '9')));
handler.on_name({begin, to_unsigned(it - begin)});
return it;
}
template <typename Char> struct dynamic_spec_handler {
parse_context<Char>& ctx;
arg_ref<Char>& ref;
arg_id_kind& kind;
FMT_CONSTEXPR void on_index(int id) {
ref = id;
kind = arg_id_kind::index;
ctx.check_arg_id(id);
ctx.check_dynamic_spec(id);
}
FMT_CONSTEXPR void on_name(basic_string_view<Char> id) {
ref = id;
kind = arg_id_kind::name;
ctx.check_arg_id(id);
}
};
template <typename Char> struct parse_dynamic_spec_result {
const Char* end;
arg_id_kind kind;
};
// Parses integer | "{" [arg_id] "}".
template <typename Char>
FMT_CONSTEXPR auto parse_dynamic_spec(const Char* begin, const Char* end,
int& value, arg_ref<Char>& ref,
parse_context<Char>& ctx)
-> parse_dynamic_spec_result<Char> {
FMT_ASSERT(begin != end, "");
auto kind = arg_id_kind::none;
if ('0' <= *begin && *begin <= '9') {
int val = parse_nonnegative_int(begin, end, -1);
if (val == -1) report_error("number is too big");
value = val;
} else {
if (*begin == '{') {
++begin;
if (begin != end) {
Char c = *begin;
if (c == '}' || c == ':') {
int id = ctx.next_arg_id();
ref = id;
kind = arg_id_kind::index;
ctx.check_dynamic_spec(id);
} else {
begin = parse_arg_id(begin, end,
dynamic_spec_handler<Char>{ctx, ref, kind});
}
}
if (begin != end && *begin == '}') return {++begin, kind};
}
report_error("invalid format string");
}
return {begin, kind};
}
template <typename Char>
FMT_CONSTEXPR auto parse_width(const Char* begin, const Char* end,
format_specs& specs, arg_ref<Char>& width_ref,
parse_context<Char>& ctx) -> const Char* {
auto result = parse_dynamic_spec(begin, end, specs.width, width_ref, ctx);
specs.set_dynamic_width(result.kind);
return result.end;
}
template <typename Char>
FMT_CONSTEXPR auto parse_precision(const Char* begin, const Char* end,
format_specs& specs,
arg_ref<Char>& precision_ref,
parse_context<Char>& ctx) -> const Char* {
++begin;
if (begin == end) {
report_error("invalid precision");
return begin;
}
auto result =
parse_dynamic_spec(begin, end, specs.precision, precision_ref, ctx);
specs.set_dynamic_precision(result.kind);
return result.end;
}
enum class state { start, align, sign, hash, zero, width, precision, locale };
// Parses standard format specifiers.
template <typename Char>
FMT_CONSTEXPR auto parse_format_specs(const Char* begin, const Char* end,
dynamic_format_specs<Char>& specs,
parse_context<Char>& ctx, type arg_type)
-> const Char* {
auto c = '\0';
if (end - begin > 1) {
auto next = to_ascii(begin[1]);
c = parse_align(next) == align::none ? to_ascii(*begin) : '\0';
} else {
if (begin == end) return begin;
c = to_ascii(*begin);
}
struct {
state current_state = state::start;
FMT_CONSTEXPR void operator()(state s, bool valid = true) {
if (current_state >= s || !valid)
report_error("invalid format specifier");
current_state = s;
}
} enter_state;
using pres = presentation_type;
constexpr auto integral_set = sint_set | uint_set | bool_set | char_set;
struct {
const Char*& begin;
format_specs& specs;
type arg_type;
FMT_CONSTEXPR auto operator()(pres pres_type, int set) -> const Char* {
if (!in(arg_type, set)) report_error("invalid format specifier");
specs.set_type(pres_type);
return begin + 1;
}
} parse_presentation_type{begin, specs, arg_type};
for (;;) {
switch (c) {
case '<':
case '>':
case '^':
enter_state(state::align);
specs.set_align(parse_align(c));
++begin;
break;
case '+':
case ' ':
specs.set_sign(c == ' ' ? sign::space : sign::plus);
FMT_FALLTHROUGH;
case '-':
enter_state(state::sign, in(arg_type, sint_set | float_set));
++begin;
break;
case '#':
enter_state(state::hash, is_arithmetic_type(arg_type));
specs.set_alt();
++begin;
break;
case '0':
enter_state(state::zero);
if (!is_arithmetic_type(arg_type))
report_error("format specifier requires numeric argument");
if (specs.align() == align::none) {
// Ignore 0 if align is specified for compatibility with std::format.
specs.set_align(align::numeric);
specs.set_fill('0');
}
++begin;
break;
// clang-format off
case '1': case '2': case '3': case '4': case '5':
case '6': case '7': case '8': case '9': case '{':
// clang-format on
enter_state(state::width);
begin = parse_width(begin, end, specs, specs.width_ref, ctx);
break;
case '.':
enter_state(state::precision,
in(arg_type, float_set | string_set | cstring_set));
begin = parse_precision(begin, end, specs, specs.precision_ref, ctx);
break;
case 'L':
enter_state(state::locale, is_arithmetic_type(arg_type));
specs.set_localized();
++begin;
break;
case 'd': return parse_presentation_type(pres::dec, integral_set);
case 'X': specs.set_upper(); FMT_FALLTHROUGH;
case 'x': return parse_presentation_type(pres::hex, integral_set);
case 'o': return parse_presentation_type(pres::oct, integral_set);
case 'B': specs.set_upper(); FMT_FALLTHROUGH;
case 'b': return parse_presentation_type(pres::bin, integral_set);
case 'E': specs.set_upper(); FMT_FALLTHROUGH;
case 'e': return parse_presentation_type(pres::exp, float_set);
case 'F': specs.set_upper(); FMT_FALLTHROUGH;
case 'f': return parse_presentation_type(pres::fixed, float_set);
case 'G': specs.set_upper(); FMT_FALLTHROUGH;
case 'g': return parse_presentation_type(pres::general, float_set);
case 'A': specs.set_upper(); FMT_FALLTHROUGH;
case 'a': return parse_presentation_type(pres::hexfloat, float_set);
case 'c':
if (arg_type == type::bool_type) report_error("invalid format specifier");
return parse_presentation_type(pres::chr, integral_set);
case 's':
return parse_presentation_type(pres::string,
bool_set | string_set | cstring_set);
case 'p':
return parse_presentation_type(pres::pointer, pointer_set | cstring_set);
case '?':
return parse_presentation_type(pres::debug,
char_set | string_set | cstring_set);
case '}': return begin;
default: {
if (*begin == '}') return begin;
// Parse fill and alignment.
auto fill_end = begin + code_point_length(begin);
if (end - fill_end <= 0) {
report_error("invalid format specifier");
return begin;
}
if (*begin == '{') {
report_error("invalid fill character '{'");
return begin;
}
auto alignment = parse_align(to_ascii(*fill_end));
enter_state(state::align, alignment != align::none);
specs.set_fill(
basic_string_view<Char>(begin, to_unsigned(fill_end - begin)));
specs.set_align(alignment);
begin = fill_end + 1;
}
}
if (begin == end) return begin;
c = to_ascii(*begin);
}
}
template <typename Char, typename Handler>
FMT_CONSTEXPR FMT_INLINE auto parse_replacement_field(const Char* begin,
gitextract_90er4fjl/
├── .editorconfig
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ ├── renovate.json5
│ └── workflows/
│ ├── cmake-freebsd.yml
│ ├── cmake-linux.yml
│ ├── cmake-macos.yml
│ ├── cmake-netbsd.yml
│ ├── cmake-openbsd.yml
│ ├── continuous-build-freebsd.yml
│ ├── continuous-build-gpu.yml
│ ├── continuous-build-linux.yml
│ ├── continuous-build-macos.yml
│ ├── continuous-build-netbsd.yml
│ ├── continuous-build-openbsd.yml
│ └── test-snap-can-build.yml
├── .gitignore
├── CHANGELOG.md
├── CMakeLists.txt
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── btop.desktop
├── cmake/
│ ├── Finddevstat.cmake
│ ├── Findelf.cmake
│ ├── Findkvm.cmake
│ └── Findproplib.cmake
├── include/
│ ├── fmt/
│ │ ├── LICENSE.rst
│ │ ├── args.h
│ │ ├── base.h
│ │ ├── chrono.h
│ │ ├── color.h
│ │ ├── compile.h
│ │ ├── core.h
│ │ ├── format-inl.h
│ │ ├── format.h
│ │ ├── os.h
│ │ ├── ostream.h
│ │ ├── printf.h
│ │ ├── ranges.h
│ │ ├── std.h
│ │ └── xchar.h
│ └── widechar_width.hpp
├── manpage.md
├── snap/
│ └── snapcraft.yaml
├── src/
│ ├── btop.cpp
│ ├── btop.hpp
│ ├── btop_cli.cpp
│ ├── btop_cli.hpp
│ ├── btop_config.cpp
│ ├── btop_config.hpp
│ ├── btop_draw.cpp
│ ├── btop_draw.hpp
│ ├── btop_input.cpp
│ ├── btop_input.hpp
│ ├── btop_log.cpp
│ ├── btop_log.hpp
│ ├── btop_menu.cpp
│ ├── btop_menu.hpp
│ ├── btop_shared.cpp
│ ├── btop_shared.hpp
│ ├── btop_theme.cpp
│ ├── btop_theme.hpp
│ ├── btop_tools.cpp
│ ├── btop_tools.hpp
│ ├── config.h.in
│ ├── freebsd/
│ │ └── btop_collect.cpp
│ ├── linux/
│ │ ├── btop_collect.cpp
│ │ └── intel_gpu_top/
│ │ ├── CMakeLists.txt
│ │ ├── drm.h
│ │ ├── drm_mode.h
│ │ ├── i915_drm.h
│ │ ├── i915_pciids.h
│ │ ├── i915_pciids_local.h
│ │ ├── igt_perf.c
│ │ ├── igt_perf.h
│ │ ├── intel_chipset.h
│ │ ├── intel_device_info.c
│ │ ├── intel_gpu_top.c
│ │ ├── intel_gpu_top.h
│ │ ├── intel_name_lookup_shim.c
│ │ ├── source.txt
│ │ └── xe_pciids.h
│ ├── main.cpp
│ ├── netbsd/
│ │ └── btop_collect.cpp
│ ├── openbsd/
│ │ ├── btop_collect.cpp
│ │ ├── internal.h
│ │ ├── sysctlbyname.cpp
│ │ └── sysctlbyname.h
│ └── osx/
│ ├── btop_collect.cpp
│ ├── sensors.cpp
│ ├── sensors.hpp
│ ├── smc.cpp
│ └── smc.hpp
├── tests/
│ ├── CMakeLists.txt
│ └── tools.cpp
└── themes/
├── HotPurpleTrafficLight.theme
├── adapta.theme
├── adwaita-dark.theme
├── adwaita.theme
├── ayu.theme
├── dracula.theme
├── dusklight.theme
├── elementarish.theme
├── everforest-dark-hard.theme
├── everforest-dark-medium.theme
├── everforest-light-medium.theme
├── flat-remix-light.theme
├── flat-remix.theme
├── flexoki-dark.theme
├── flexoki-light.theme
├── gotham.theme
├── greyscale.theme
├── gruvbox_dark.theme
├── gruvbox_dark_v2.theme
├── gruvbox_light.theme
├── gruvbox_material_dark.theme
├── horizon.theme
├── kanagawa-lotus.theme
├── kanagawa-wave.theme
├── kyli0x.theme
├── matcha-dark-sea.theme
├── monokai.theme
├── night-owl.theme
├── nord.theme
├── onedark.theme
├── orange.theme
├── paper.theme
├── phoenix-night.theme
├── solarized_dark.theme
├── solarized_light.theme
├── tokyo-night.theme
├── tokyo-storm.theme
├── tomorrow-night.theme
├── twilight.theme
└── whiteout.theme
SYMBOL INDEX (1262 symbols across 56 files)
FILE: include/fmt/args.h
function FMT_BEGIN_NAMESPACE (line 19) | FMT_BEGIN_NAMESPACE
function class (line 43) | class dynamic_arg_list {
function FMT_EXPORT (line 74) | FMT_EXPORT template <typename Context> class dynamic_format_arg_store {
function pop_one (line 121) | auto pop_one = [](std::vector<basic_format_arg<Context>>* data) {
function operator (line 134) | operator basic_format_args<Context>() const {
function clear (line 199) | void clear() {
function reserve (line 207) | void reserve(size_t new_cap, size_t new_cap_named) {
FILE: include/fmt/base.h
function max_of (line 331) | struct monostate {
function namespace (line 354) | namespace detail {
function T (line 377) | constexpr auto const_check(T val) -> T {
function int128_opt (line 404) | inline auto map(int128_opt x) -> int128_opt { return x; }
function uint128_opt (line 405) | inline auto map(uint128_opt x) -> uint128_opt { return x; }
function int128_opt (line 410) | enum class int128_opt {}
function uint128_opt (line 411) | enum class uint128_opt {}
function monostate (line 413) | inline auto map(int128_opt) -> monostate { return {}; }
function monostate (line 414) | inline auto map(uint128_opt) -> monostate { return {}; }
function Int (line 432) | auto to_unsigned(Int value) -> make_unsigned_t<Int> {
function typename (line 448) | typename T::value_type*> {}
function FMT_ALWAYS_INLINE (line 462) | constexpr FMT_ALWAYS_INLINE auto narrow(const char* s) -> const char* {
function namespace (line 476) | namespace adl {
function FMT_CONSTEXPR20 (line 495) | FMT_CONSTEXPR20 auto get_container(OutputIt it) ->
function FMT_BEGIN_EXPORT (line 506) | FMT_BEGIN_EXPORT
function size (line 557) | constexpr auto data() const noexcept -> const Char* { return data_; }
function operator (line 565) | constexpr auto operator[](size_t pos) const noexcept -> const Char& {
function FMT_CONSTEXPR (line 569) | FMT_CONSTEXPR void remove_prefix(size_t n) noexcept {
function FMT_CONSTEXPR (line 574) | FMT_CONSTEXPR auto starts_with(basic_string_view<Char> sv) const noexcept
function FMT_CONSTEXPR (line 578) | FMT_CONSTEXPR auto starts_with(Char c) const noexcept -> bool {
function FMT_CONSTEXPR (line 581) | FMT_CONSTEXPR auto starts_with(const Char* s) const -> bool {
function FMT_CONSTEXPR (line 585) | FMT_CONSTEXPR auto compare(basic_string_view other) const -> int {
function presentation_type (line 658) | enum class presentation_type : unsigned char {
function type (line 1257) | constexpr auto arg_type(int id) const -> type { return types_[id]; }
function FMT_CONSTEXPR (line 1259) | FMT_CONSTEXPR auto next_arg_id() -> int {
function FMT_CONSTEXPR (line 1271) | FMT_CONSTEXPR void check_dynamic_spec(int arg_id) {
function FMT_CONSTEXPR (line 1281) | FMT_CONSTEXPR arg_ref(basic_string_view<Char> n) : name(n) {}
function FMT_CONSTEXPR (line 1334) | FMT_CONSTEXPR inline auto parse_align(char c) -> align {
function FMT_CONSTEXPR (line 1380) | FMT_CONSTEXPR void on_index(int id) {
function state (line 1457) | enum class state { start, align, sign, hash, zero, width, precision, loc...
type compile_string (line 1680) | struct compile_string {}
function FMT_CONSTEXPR (line 1722) | FMT_CONSTEXPR auto on_arg_id(int id) -> int {
function FMT_CONSTEXPR (line 1726) | FMT_CONSTEXPR auto on_arg_id(basic_string_view<Char> id) -> int {
function FMT_CONSTEXPR (line 1734) | FMT_CONSTEXPR void on_replacement_field(int id, const Char* begin) {
function on_error (line 1756) | void on_error(const char* message) {
function FMT_CONSTEXPR (line 1786) | FMT_CONSTEXPR void set(T* buf_data, size_t buf_capacity) noexcept {
function size (line 1801) | auto begin() const noexcept -> const T* { return ptr_; }
function FMT_CONSTEXPR (line 1811) | FMT_CONSTEXPR auto data() noexcept -> T* { return ptr_; }
function FMT_CONSTEXPR (line 1815) | FMT_CONSTEXPR void clear() { size_ = 0; }
function FMT_CONSTEXPR (line 1819) | FMT_CONSTEXPR void try_resize(size_t count) {
function FMT_CONSTEXPR (line 1828) | FMT_CONSTEXPR void try_reserve(size_t new_capacity) {
function FMT_CONSTEXPR (line 1832) | FMT_CONSTEXPR void push_back(const T& value) {
function append (line 1844) | void
function count (line 1868) | struct buffer_traits {
function FMT_CONSTEXPR (line 1882) | FMT_CONSTEXPR auto limit(size_t size) -> size_t {
function flush (line 1901) | void flush() {
function flush (line 1942) | void flush() {
type custom_tag (line 2154) | struct custom_tag {}
function FMT_INLINE (line 2186) | constexpr FMT_INLINE value() : no_value() {}
function FMT_INLINE (line 2240) | FMT_INLINE value(void* x FMT_BUILTIN) : pointer(x) {}
function FMT_INLINE (line 2241) | FMT_INLINE value(const void* x FMT_BUILTIN) : pointer(x) {}
function FMT_INLINE (line 2242) | FMT_INLINE value(volatile void* x FMT_BUILTIN)
function FMT_INLINE (line 2244) | FMT_INLINE value(const volatile void* x FMT_BUILTIN)
function FMT_INLINE (line 2246) | FMT_INLINE value(nullptr_t) : pointer(nullptr) {}
type is_output_iterator (line 2321) | struct is_output_iterator
function named_arg_store (line 2351) | struct named_arg_store {
function vprint_mojibake (line 2442) | inline void vprint_mojibake(FILE*, string_view, const format_args&, bool...
function FMT_BEGIN_EXPORT (line 2465) | FMT_BEGIN_EXPORT
function FMT_CONSTEXPR20 (line 2482) | FMT_CONSTEXPR20 auto operator*() -> basic_appender& { return *this; }
function custom_ (line 2504) | custom_(custom) {}
function format (line 2506) | void format(parse_context<char_type>& parse_ctx, Context& ctx) const {
function FMT_INLINE (line 2529) | FMT_INLINE auto visit(Visitor&& vis) const -> decltype(vis(0)) {
function FMT_CONSTEXPR (line 2594) | FMT_CONSTEXPR auto type(int index) const -> detail::type {
function FMT_CONSTEXPR (line 2631) | FMT_CONSTEXPR auto get(int id) const -> format_arg {
function class (line 2668) | class context {
function runtime_format_string (line 2718) | inline auto runtime(string_view s) -> runtime_format_string<> { return {...
function FMT_ALWAYS_INLINE (line 2739) | FMT_ALWAYS_INLINE fstring(const char (&s)[N]) : str(s, N - 1) {
function FMT_ALWAYS_INLINE (line 2753) | FMT_ALWAYS_INLINE fstring(const S& s) : str(s) {
function str (line 2766) | fstring(const S&) : str(S()) {
function string_view (line 2775) | const string_view&() const { return str; }
function FMT_ALWAYS_INLINE (line 2809) | constexpr FMT_ALWAYS_INLINE auto make_format_args(T&... args)
type format_to_result (line 2894) | struct format_to_result {
FILE: include/fmt/chrono.h
function namespace (line 39) | namespace safe_duration_cast {
type Factor (line 168) | struct Factor
function min1 (line 198) | constexpr auto min1 = std::numeric_limits<IntermediateRep>::lowest() /
function namespace (line 225) | namespace detail {
function namespace (line 268) | namespace detail {
function buffer_ (line 290) | buffer_(buf) {}
function FMT_NORETURN (line 417) | FMT_NORETURN inline void throw_duration_error() {
function FMT_BEGIN_EXPORT (line 493) | FMT_BEGIN_EXPORT
function namespace (line 540) | namespace detail {
function else (line 997) | else if (precision > 0) {
function write1 (line 1133) | void write1(int value) {
function write2 (line 1136) | void write2(int value) {
function write2 (line 1141) | void write2(int value, pad_type pad) {
function write_year_extended (line 1153) | void write_year_extended(long long year, pad_type pad) {
function write_year (line 1169) | void write_year(long long year, pad_type pad) {
function write_utc_offset (line 1173) | void write_utc_offset(long long offset, numeric_system ns) {
function FMT_CONSTEXPR (line 1219) | FMT_CONSTEXPR void on_text(const Char* begin, const Char* end) {
function on_abbr_weekday (line 1223) | void on_abbr_weekday() {
function on_full_weekday (line 1229) | void on_full_weekday() {
function on_dec0_weekday (line 1235) | void on_dec0_weekday(numeric_system ns) {
function on_dec1_weekday (line 1239) | void on_dec1_weekday(numeric_system ns) {
function on_abbr_month (line 1248) | void on_abbr_month() {
function on_full_month (line 1254) | void on_full_month() {
function on_datetime (line 1261) | void on_datetime(numeric_system ns) {
function on_loc_date (line 1276) | void on_loc_date(numeric_system ns) {
function on_loc_time (line 1282) | void on_loc_time(numeric_system ns) {
function on_us_date (line 1288) | void on_us_date() {
function on_iso_date (line 1295) | void on_iso_date() {
function on_utc_offset (line 1312) | void on_utc_offset(numeric_system ns) { format_utc_offset(tm_, ns); }
function on_tz_name (line 1313) | void on_tz_name() { format_tz_name(tm_); }
function on_year (line 1315) | void on_year(numeric_system ns, pad_type pad) {
function on_short_year (line 1320) | void on_short_year(numeric_system ns) {
function on_offset_year (line 1325) | void on_offset_year() {
function on_century (line 1330) | void on_century(numeric_system ns) {
function on_dec_month (line 1348) | void on_dec_month(numeric_system ns, pad_type pad) {
function on_dec0_week_of_year (line 1354) | void on_dec0_week_of_year(numeric_system ns, pad_type pad) {
function on_dec1_week_of_year (line 1360) | void on_dec1_week_of_year(numeric_system ns, pad_type pad) {
function on_iso_week_of_year (line 1371) | void on_iso_week_of_year(numeric_system ns, pad_type pad) {
function on_iso_week_based_year (line 1377) | void on_iso_week_based_year() {
function on_iso_week_based_short_year (line 1380) | void on_iso_week_based_short_year() {
function on_day_of_year (line 1384) | void on_day_of_year(pad_type pad) {
function on_day_of_month (line 1394) | void on_day_of_month(numeric_system ns, pad_type pad) {
function on_24_hour (line 1400) | void on_24_hour(numeric_system ns, pad_type pad) {
function on_12_hour (line 1405) | void on_12_hour(numeric_system ns, pad_type pad) {
function on_minute (line 1410) | void on_minute(numeric_system ns, pad_type pad) {
function on_second (line 1416) | void on_second(numeric_system ns, pad_type pad) {
function on_12_hour_time (line 1437) | void on_12_hour_time() {
function on_24_hour_time (line 1449) | void on_24_hour_time() {
function on_iso_time (line 1454) | void on_iso_time() {
function on_am_pm (line 1460) | void on_am_pm() {
function on_duration_value (line 1470) | void on_duration_value() {}
function on_duration_unit (line 1471) | void on_duration_unit() {}
function chrono_format_checker (line 1474) | struct chrono_format_checker : null_chrono_spec_handler<chrono_format_ch...
function FMT_CONSTEXPR (line 1494) | FMT_CONSTEXPR void on_duration_unit() {}
function class (line 1588) | class get_locale {
function write_sign (line 1679) | void write_sign() {
function write_nan (line 1697) | void write_nan() { std::copy_n("nan", 3, out); }
function on_text (line 1708) | void on_text(const Char* begin, const Char* end) {
function on_abbr_weekday (line 1713) | void on_abbr_weekday() {}
function on_full_weekday (line 1714) | void on_full_weekday() {}
function on_dec0_weekday (line 1715) | void on_dec0_weekday(numeric_system) {}
function on_dec1_weekday (line 1716) | void on_dec1_weekday(numeric_system) {}
function on_abbr_month (line 1717) | void on_abbr_month() {}
function on_full_month (line 1718) | void on_full_month() {}
function on_datetime (line 1719) | void on_datetime(numeric_system) {}
function on_loc_date (line 1720) | void on_loc_date(numeric_system) {}
function on_loc_time (line 1721) | void on_loc_time(numeric_system) {}
function on_us_date (line 1722) | void on_us_date() {}
function on_iso_date (line 1723) | void on_iso_date() {}
function on_utc_offset (line 1724) | void on_utc_offset(numeric_system) {}
function on_tz_name (line 1725) | void on_tz_name() {}
function on_year (line 1726) | void on_year(numeric_system, pad_type) {}
function on_short_year (line 1727) | void on_short_year(numeric_system) {}
function on_offset_year (line 1728) | void on_offset_year() {}
function on_century (line 1729) | void on_century(numeric_system) {}
function on_iso_week_based_year (line 1730) | void on_iso_week_based_year() {}
function on_iso_week_based_short_year (line 1731) | void on_iso_week_based_short_year() {}
function on_dec_month (line 1732) | void on_dec_month(numeric_system, pad_type) {}
function on_dec0_week_of_year (line 1733) | void on_dec0_week_of_year(numeric_system, pad_type) {}
function on_dec1_week_of_year (line 1734) | void on_dec1_week_of_year(numeric_system, pad_type) {}
function on_iso_week_of_year (line 1735) | void on_iso_week_of_year(numeric_system, pad_type) {}
function on_day_of_month (line 1736) | void on_day_of_month(numeric_system, pad_type) {}
function on_day_of_year (line 1738) | void on_day_of_year(pad_type) {
function on_24_hour (line 1743) | void on_24_hour(numeric_system ns, pad_type pad) {
function on_12_hour (line 1752) | void on_12_hour(numeric_system ns, pad_type pad) {
function on_minute (line 1761) | void on_minute(numeric_system ns, pad_type pad) {
function on_second (line 1770) | void on_second(numeric_system ns, pad_type pad) {
function on_12_hour_time (line 1794) | void on_12_hour_time() {
function on_24_hour_time (line 1799) | void on_24_hour_time() {
function on_iso_time (line 1811) | void on_iso_time() {
function on_am_pm (line 1818) | void on_am_pm() {
function on_duration_value (line 1823) | void on_duration_value() {
function on_duration_unit (line 1829) | void on_duration_unit() { out = format_duration_unit<Char, Period>(out); }
function class (line 1842) | class weekday {
function class (line 1853) | class day {
function class (line 1864) | class month {
function class (line 1875) | class year {
function class (line 1885) | class year_month_day {
function FMT_CONSTEXPR (line 2107) | FMT_CONSTEXPR void set_localized() { specs_.set_localized(); }
FILE: include/fmt/color.h
function color (line 16) | enum class color : uint32_t {
function vprint (line 497) | inline void vprint(FILE* f, text_style ts, string_view fmt, format_args ...
function T (line 629) | auto styled(const T& value, text_style ts)
FILE: include/fmt/compile.h
function class (line 20) | class compiled_string {}
function namespace (line 55) | inline namespace literals {
function namespace (line 62) | namespace detail {
function FMT_INLINE (line 469) | FMT_INLINE auto format_to(OutputIt out, const CompiledFormat& cf,
function FMT_CONSTEXPR_STRING (line 476) | FMT_CONSTEXPR_STRING auto format(const S&, T&&... args)
function FMT_CONSTEXPR (line 555) | FMT_CONSTEXPR static_format_result(const S& fmt, T&&... args) {
FILE: include/fmt/format-inl.h
function FMT_FUNC (line 36) | FMT_FUNC void assert_fail(const char* file, int line, const char* messag...
function namespace (line 45) | namespace detail {
function locale_ (line 52) | locale_ref(const Locale& loc) : locale_(&loc) {
function namespace (line 56) | namespace detail {
function namespace (line 76) | namespace detail {
function noexcept (line 217) | inline auto floor_log10_pow2_minus_log10_4_over_3(int e) noexcept -> int {
function FMT_INLINE_VARIABLE (line 222) | FMT_INLINE_VARIABLE constexpr struct div_small_pow10_infos_struct {
function noexcept (line 265) | inline auto divide_by_10_to_kappa_plus_1(uint32_t n) noexcept -> uint32_t {
function noexcept (line 270) | inline auto divide_by_10_to_kappa_plus_1(uint64_t n) noexcept -> uint64_t {
function float (line 278) | struct cache_accessor<float> {
function noexcept (line 332) | static auto compute_delta(const cache_entry_type& cache, int beta) noexcept
function carrier_uint (line 349) | static auto compute_left_endpoint_for_shorter_interval_case(
function carrier_uint (line 356) | static auto compute_right_endpoint_for_shorter_interval_case(
function carrier_uint (line 363) | static auto compute_round_up_for_shorter_interval_case(
function double (line 372) | struct cache_accessor<double> {
function bigint (line 1389) | struct formatter<detail::bigint> {
function FMT_FUNC (line 1415) | FMT_FUNC detail::utf8_to_utf16::utf8_to_utf16(string_view s) {
function FMT_FUNC (line 1430) | FMT_FUNC void format_system_error(detail::buffer<char>& out, int error_c...
function FMT_FUNC (line 1441) | FMT_FUNC void report_system_error(int error_code,
function FMT_FUNC (line 1446) | FMT_FUNC auto vformat(string_view fmt, format_args args) -> std::string {
function namespace (line 1454) | namespace detail {
function operator (line 1498) | operator F*() const { return file_; }
function unget (line 1509) | void unget(char c) {
function flush (line 1514) | void flush() { fflush(this->file_); }
function init_buffer (line 1532) | void init_buffer() {
function span (line 1546) | auto get_write_buffer() const -> span<char> {
function advance_write_buffer (line 1551) | void advance_write_buffer(size_t size) { this->file_->_IO_write_ptr += s...
function flush (line 1560) | void flush() { fflush_unlocked(this->file_); }
function init_buffer (line 1578) | void init_buffer() {
function advance_write_buffer (line 1597) | void advance_write_buffer(size_t size) {
function init_buffer (line 1620) | void init_buffer() {}
function unget (line 1635) | void unget(char c) {
function grow (line 1673) | static void grow(buffer<char>& base, size_t) {
function FMT_FUNC (line 1700) | FMT_FUNC auto write_console(int, string_view) -> bool { return false; }
function FMT_FUNC (line 1706) | FMT_FUNC bool write_console(int fd, string_view text) {
function FMT_FUNC (line 1715) | FMT_FUNC void vprint_mojibake(std::FILE* f, string_view fmt, format_args...
function FMT_FUNC (line 1724) | FMT_FUNC void print(std::FILE* f, string_view text) {
function FMT_FUNC (line 1736) | FMT_FUNC void vprint_buffered(std::FILE* f, string_view fmt, format_args...
function FMT_FUNC (line 1742) | FMT_FUNC void vprint(std::FILE* f, string_view fmt, format_args args) {
function FMT_FUNC (line 1749) | FMT_FUNC void vprintln(std::FILE* f, string_view fmt, format_args args) {
function FMT_FUNC (line 1756) | FMT_FUNC void vprint(string_view fmt, format_args args) {
function namespace (line 1760) | namespace detail {
function FMT_FUNC (line 1799) | FMT_FUNC auto is_printable(uint32_t cp) -> bool {
FILE: include/fmt/format.h
function namespace (line 157) | namespace std {
function namespace (line 196) | namespace detail {
function operator (line 350) | auto operator*(const uint128_fallback& lhs, uint32_t rhs)
function uint128_fallback (line 387) | uint64_t n) noexcept -> uint128_fallback& {
function To (line 437) | auto bit_cast(const From& from) -> To {
function FMT_INLINE (line 475) | FMT_INLINE void assume(bool condition) {
function FMT_CONSTEXPR20 (line 490) | __attribute__((no_sanitize("undefined")))
function T (line 501) | inline auto reserve(basic_appender<T> it, size_t n)
function FMT_NOINLINE (line 568) | FMT_NOINLINE auto copy_noinline(InputIt begin, InputIt end,
function FMT_CONSTEXPR (line 590) | FMT_CONSTEXPR inline auto utf8_decode(const char* s, uint32_t* c, int* e)
function for_each_codepoint (line 632) | void for_each_codepoint(string_view s, F f) {
function true_type (line 689) | struct is_integral<int128_opt> : std::true_type {}
function true_type (line 690) | struct is_integral<uint128_t> : std::true_type {}
type float128 (line 716) | struct float128 {}
function true_type (line 722) | struct is_floating_point<float128> : std::true_type {}
function deallocate (line 752) | void deallocate(T* p, size_t) { std::free(p); }
function FMT_BEGIN_EXPORT (line 764) | FMT_BEGIN_EXPORT
function FMT_CONSTEXPR (line 895) | FMT_CONSTEXPR void resize(size_t count) { this->try_resize(count); }
function reserve (line 898) | void reserve(size_t new_capacity) { this->try_reserve(new_capacity); }
function append (line 902) | void append(const ContiguousRange& range) {
function string (line 910) | auto to_string(const basic_memory_buffer<char, SIZE>& buf)
function class (line 918) | class writer {
function class (line 940) | class string_buffer {
function FMT_END_EXPORT (line 967) | FMT_END_EXPORT
function namespace (line 973) | namespace detail {
function Char (line 991) | constexpr auto compile_string_to_view(basic_string_view<Char> s)
function char (line 1024) | inline auto digits2(size_t value) -> const char* {
function Char (line 1036) | auto getsign(sign s) -> Char {
function FMT_CONSTEXPR (line 1056) | FMT_CONSTEXPR inline auto count_digits(uint128_opt n) -> int {
function FMT_CONSTEXPR20 (line 1084) | FMT_CONSTEXPR20 inline auto count_digits(uint64_t n) -> int {
function FMT_INLINE (line 1111) | FMT_INLINE auto do_count_digits(uint32_t n) -> int {
function FMT_CONSTEXPR20 (line 1134) | FMT_CONSTEXPR20 inline auto count_digits(uint32_t n) -> int {
function wchar_t (line 1160) | inline auto thousands_sep(locale_ref loc) -> thousands_sep_result<wchar_...
function Char (line 1166) | auto decimal_point(locale_ref loc) -> Char {
function wchar_t (line 1169) | inline auto decimal_point(locale_ref loc) -> wchar_t {
function FMT_API (line 1180) | FMT_API auto decimal_point_impl(locale_ref) -> wchar_t;
function write2digits (line 1194) | void write2digits(Char* out, size_t value) {
function class (line 1288) | class utf8_to_utf16 {
function FMT_INLINE (line 1374) | FMT_INLINE auto umul128(uint64_t x, uint64_t y) noexcept -> uint128_fall...
function namespace (line 1402) | namespace dragonbox {
function float (line 1442) | struct float_info<float> {
function double (line 1454) | struct float_info<double> {
function FMT_CONSTEXPR (line 1620) | FMT_CONSTEXPR inline auto multiply(uint64_t lhs, uint64_t rhs) -> uint64...
function FMT_CONSTEXPR (line 1637) | FMT_CONSTEXPR inline auto operator*(fp x, fp y) -> fp {
function T (line 1646) | auto convert_float(T value) -> convert_float_result<T> {
function FMT_NOINLINE (line 1660) | FMT_NOINLINE auto fill(OutputIt it, size_t n,
function OutputIt (line 1702) | auto write_bytes(OutputIt out, string_view bytes,
function write (line 1716) | auto write = [=](reserve_iterator<OutputIt> it) {
type next_state (line 1861) | struct next_state {
type size_padding (line 2029) | struct size_padding {
function FMT_INLINE (line 2050) | FMT_INLINE auto write_int(OutputIt out, write_int_arg<T> arg,
function FMT_NOINLINE (line 2114) | FMT_NOINLINE auto write_int_noinline(OutputIt out,
function FMT_INLINE (line 2125) | FMT_INLINE auto write(basic_appender<Char> out, T value,
function FMT_INLINE (line 2139) | FMT_INLINE auto write(OutputIt out, T value,
function OutputIt (line 2147) | auto write(OutputIt out, Char value, const format_specs& specs,
type bounded_output_iterator (line 2212) | struct bounded_output_iterator {
function operator (line 2217) | auto operator++() -> bounded_output_iterator& {
type big_decimal_fp (line 2355) | struct big_decimal_fp {
function write (line 2577) | auto write = [=](reserve_iterator<OutputIt> it) {
function FMT_CONSTEXPR (line 2631) | FMT_CONSTEXPR auto signbit(T value) -> bool {
function class (line 2651) | class bigint {
function FMT_CONSTEXPR (line 2756) | FMT_CONSTEXPR auto num_bigits() const -> int {
function FMT_CONSTEXPR20 (line 2817) | FMT_CONSTEXPR20 void assign_pow10(int exp) {
function FMT_CONSTEXPR20 (line 2834) | FMT_CONSTEXPR20 void square() {
function FMT_CONSTEXPR (line 2864) | FMT_CONSTEXPR void align(const bigint& other) {
function FMT_CONSTEXPR (line 2877) | FMT_CONSTEXPR auto divmod_assign(const bigint& divisor) -> int {
type dragon (line 2892) | enum dragon {
function format_hexfloat (line 3037) | void format_hexfloat(Float value, format_specs specs,
function format_hexfloat (line 3117) | void format_hexfloat(Float value, format_specs specs,
function OutputIt (line 3434) | auto write(OutputIt out, T value, format_specs specs,
function OutputIt (line 3593) | auto write(OutputIt out, T value, const format_specs& specs = {},
type dynamic_spec_getter (line 3686) | struct dynamic_spec_getter {
function handle_dynamic_spec (line 3700) | void handle_dynamic_spec(
function value (line 3720) | static_named_arg(const T& v) : value(v) {}
function on_text (line 3752) | void on_text(const Char* begin, const Char* end) {
function FMT_CONSTEXPR (line 3757) | FMT_CONSTEXPR auto on_arg_id(int id) -> int {
function FMT_CONSTEXPR (line 3761) | FMT_CONSTEXPR auto on_arg_id(basic_string_view<Char> id) -> int {
function FMT_INLINE (line 3768) | FMT_INLINE void on_replacement_field(int id, const Char*) {
function FMT_NORETURN (line 3792) | FMT_NORETURN void on_error(const char* message) { report_error(message); }
function generic_context (line 3842) | constexpr auto arg(int id) const -> basic_format_arg<generic_context> {
function generic_context (line 3845) | auto arg(basic_string_view<Char> name) const
function advance_to (line 3855) | void advance_to(iterator it) {
function Char (line 3938) | long, Char> {}
function Enum (line 3977) | auto underlying(Enum e) noexcept -> underlying_t<Enum> {
function namespace (line 3981) | namespace enums {
function format (line 4001) | struct bytes {
function namespace (line 4131) | inline namespace literals {
function class (line 4153) | class format_int {
function FMT_INLINE (line 4335) | FMT_INLINE auto format(format_string<T...> fmt, T&&... args)
function FMT_CONSTEXPR_STRING (line 4348) | FMT_CONSTEXPR_STRING auto to_string(T value) -> std::string {
function FMT_CONSTEXPR_STRING (line 4356) | FMT_CONSTEXPR_STRING auto to_string(const T& value)
function FMT_CONSTEXPR_STRING (line 4363) | FMT_CONSTEXPR_STRING auto to_string(const T& value)
FILE: include/fmt/os.h
function FMT_API (line 115) | FMT_API const std::error_category& system_category() noexcept;
function class (line 174) | class buffered_file {
function descriptor (line 211) | inline auto get() const noexcept -> FILE* { return file_; }
function pipe (line 313) | struct FMT_API pipe {
function detail (line 323) | auto getpagesize() -> long;
function operator (line 380) | operator writer() {
function flush (line 385) | inline void flush() {
function close (line 394) | inline void close() {
FILE: include/fmt/ostream.h
function FMT_BEGIN_NAMESPACE (line 33) | FMT_BEGIN_NAMESPACE
function T (line 112) | auto streamed(const T& value) -> detail::streamed_view<T> {
function vprint (line 116) | inline void vprint(std::ostream& os, string_view fmt, format_args args) {
FILE: include/fmt/printf.h
function advance_to (line 41) | void advance_to(basic_appender<Char>) {}
function basic_printf_context (line 45) | auto arg(int id) const -> basic_format_arg<basic_printf_context> {
function namespace (line 50) | namespace detail {
type int_checker (line 78) | struct int_checker
type printf_precision_handler (line 86) | struct printf_precision_handler {
type is_zero_int (line 102) | struct is_zero_int {
function bool (line 116) | struct make_unsigned_or_bool<bool> {
function arg_ (line 176) | arg_(arg) {}
function class (line 196) | class printf_width_handler {
function get_arg (line 401) | auto get_arg = [&](int arg_index) {
FILE: include/fmt/ranges.h
function range_format (line 24) | enum class range_format { disabled, map, set, sequence, string, debug_st...
function FMT_CONSTEXPR (line 135) | static FMT_CONSTEXPR auto size() -> size_t { return sizeof...(N); }
function namespace (line 203) | namespace tuple {
function FMT_EXPORT (line 282) | FMT_EXPORT
type is_tuple_formattable (line 289) | struct is_tuple_formattable {
type is_range (line 346) | struct is_range {
function namespace (line 351) | namespace detail {
function FMT_CONSTEXPR (line 409) | FMT_CONSTEXPR auto underlying() -> detail::range_formatter_type<Char, T>& {
function FMT_CONSTEXPR (line 508) | FMT_CONSTEXPR formatter() {
function typename (line 731) | const ->
FILE: include/fmt/std.h
function FMT_BEGIN_NAMESPACE (line 79) | FMT_BEGIN_NAMESPACE
FILE: include/fmt/xchar.h
function FMT_BEGIN_NAMESPACE (line 23) | FMT_BEGIN_NAMESPACE
function FMT_ALWAYS_INLINE (line 97) | FMT_ALWAYS_INLINE basic_fstring(const S& s) : str_(s) {
function str_ (line 104) | basic_fstring(const S&) : str_(S()) {
function operator (line 112) | operator basic_string_view<Char>() const { return str_; }
function wchar_t (line 121) | inline auto runtime(wstring_view s) -> runtime_format_string<wchar_t> {
function namespace (line 132) | inline namespace literals {
function vprint (line 290) | inline void vprint(std::FILE* f, wstring_view fmt, wformat_args args) {
function vprint (line 298) | inline void vprint(wstring_view fmt, wformat_args args) {
function vprint (line 333) | inline void vprint(std::wostream& os, wstring_view fmt, wformat_args arg...
function wstring (line 350) | auto to_wstring(const T& value) -> std::wstring {
FILE: include/widechar_width.hpp
type widechar_range (line 43) | struct widechar_range {
type widechar_range (line 49) | struct widechar_range
type widechar_range (line 54) | struct widechar_range
type widechar_range (line 61) | struct widechar_range
type widechar_range (line 89) | struct widechar_range
type widechar_range (line 420) | struct widechar_range
type widechar_range (line 426) | struct widechar_range
type widechar_range (line 504) | struct widechar_range
type widechar_range (line 687) | struct widechar_range
type widechar_range (line 1447) | struct widechar_range
type widechar_range (line 1469) | struct widechar_range
function widechar_in_table (line 1539) | bool widechar_in_table(const Collection &arr, uint32_t c) {
function widechar_wcwidth (line 1546) | int widechar_wcwidth(uint32_t c) {
FILE: src/btop.cpp
type Global (line 88) | namespace Global {
type Runner (line 128) | namespace Runner {
function clean_quit (line 212) | void clean_quit(int sig) {
function _sleep (line 266) | static void _sleep() {
function _resume (line 273) | static void _resume() {
function _exit_handler (line 278) | static void _exit_handler() {
function _crash_handler (line 282) | static void _crash_handler(const int sig) {
function _signal_handler (line 292) | static void _signal_handler(const int sig) {
function init_config (line 331) | void init_config(bool low_color, std::optional<std::string>& filter) {
function set_active (line 367) | static inline auto set_active(bool value) noexcept {
function thread_wait (line 375) | inline void thread_wait() { do_work.acquire(); }
function thread_trigger (line 376) | inline void thread_trigger() { do_work.release(); }
class gain_priv (line 379) | class gain_priv {
method gain_priv (line 382) | gain_priv() {
method gain_priv (line 390) | gain_priv(const gain_priv& other) = delete;
method gain_priv (line 391) | gain_priv& operator=(const gain_priv& other) = delete;
method gain_priv (line 392) | gain_priv(gain_priv&& other) = delete;
method gain_priv (line 393) | gain_priv& operator=(gain_priv&& other) = delete;
type debug_actions (line 402) | enum debug_actions {
type debug_array (line 410) | enum debug_array {
class MyNumPunct (line 418) | class MyNumPunct : public std::numpunct<char>
method do_thousands_sep (line 421) | virtual char do_thousands_sep() const override { return '\''; }
method do_grouping (line 422) | virtual std::string do_grouping() const override { return "\03"; }
type runner_conf (line 426) | struct runner_conf {
type runner_conf (line 435) | struct runner_conf
function debug_timer (line 437) | static void debug_timer(const char* name, const int action) {
function run (line 739) | void run(const string& box, bool no_update, bool force_redraw) {
function stop (line 791) | void stop() {
function configure_tty_mode (line 822) | static auto configure_tty_mode(std::optional<bool> force_tty) {
function btop_main (line 844) | [[nodiscard]] auto btop_main(const std::span<const std::string_view> arg...
FILE: src/btop_cli.cpp
function version (line 36) | static void version() noexcept {
function build_info (line 44) | static void build_info() noexcept {
function error (line 49) | static void error(std::string_view msg) noexcept {
type Cli (line 53) | namespace Cli {
function parse (line 54) | [[nodiscard]] auto parse(const std::span<const std::string_view> args)...
function default_config (line 201) | auto default_config() noexcept -> Result {
function usage (line 245) | void usage() noexcept {
function help (line 249) | void help() noexcept {
function help_hint (line 269) | void help_hint() noexcept {
FILE: src/btop_cli.hpp
type Cli (line 12) | namespace Cli {
type Cli (line 16) | struct Cli {
FILE: src/btop_config.cpp
type Config (line 51) | namespace Config {
function get_config_dir (line 381) | [[nodiscard]] std::optional<fs::path> get_config_dir() noexcept {
function _locked (line 438) | bool _locked(const std::string_view name) {
function presetsValid (line 454) | bool presetsValid(const string& presets) {
function apply_preset (line 493) | bool apply_preset(const string& preset) {
function lock (line 530) | void lock() {
function intValid (line 537) | bool intValid(const std::string_view name, const string& value) {
function validBoxSizes (line 567) | bool validBoxSizes(const string& boxes) {
function stringValid (line 572) | bool stringValid(const std::string_view name, const string& value) {
function string (line 642) | string getAsString(const std::string_view name) {
function flip (line 652) | void flip(const std::string_view name) {
function unlock (line 660) | void unlock() {
function set_boxes (line 696) | bool set_boxes(const string& boxes) {
function toggle_box (line 711) | bool toggle_box(const string& box) {
function load (line 736) | void load(const fs::path& conf_file, vector<string>& load_warnings) {
function write (line 808) | void write() {
function get_xdg_state_dir (line 819) | static constexpr auto get_xdg_state_dir() -> std::optional<fs::path> {
function get_log_file (line 845) | auto get_log_file() -> std::optional<fs::path> {
function current_config (line 849) | auto current_config() -> std::string {
FILE: src/btop_config.hpp
type Config (line 32) | namespace Config {
function getB (line 89) | inline bool getB(const std::string_view name) { return bools.at(name); }
function string (line 95) | inline const string& getS(const std::string_view name) { return string...
function set (line 105) | inline void set(const std::string_view name, bool value) {
function set (line 111) | inline void set(const std::string_view name, const int value) {
function set (line 117) | inline void set(const std::string_view name, const string& value) {
FILE: src/btop_draw.cpp
type Symbols (line 57) | namespace Symbols {
type Draw (line 109) | namespace Draw {
function string (line 111) | string banner_gen(int y, int x, bool centered, bool redraw) {
function string (line 212) | string TextEdit::operator()(const size_t limit) {
function string (line 252) | string createBox(
function update_clock (line 306) | bool update_clock(bool force) {
function string (line 376) | string Meter::operator()(int value) {
function string (line 494) | string& Graph::operator()(const deque<long long>& data, bool data_same) {
function string (line 511) | string& Graph::operator()() {
function calcSizes (line 2214) | void calcSizes() {
type Gpu (line 996) | namespace Gpu {
function string (line 1016) | string draw(const gpu_info& gpu, unsigned long index, bool force_redra...
type Mem (line 1188) | namespace Mem {
function string (line 1203) | string draw(const mem_info& mem, bool force_redraw, bool data_same) {
type Net (line 1454) | namespace Net {
function string (line 1465) | string draw(const net_info& net, bool force_redraw, bool data_same) {
type Proc (line 1569) | namespace Proc {
function selection (line 1593) | int selection(const std::string_view cmd_key) {
function string (line 1673) | string draw(const vector<proc_info>& plist, bool force_redraw, bool da...
type Draw (line 2213) | namespace Draw {
function string (line 111) | string banner_gen(int y, int x, bool centered, bool redraw) {
function string (line 212) | string TextEdit::operator()(const size_t limit) {
function string (line 252) | string createBox(
function update_clock (line 306) | bool update_clock(bool force) {
function string (line 376) | string Meter::operator()(int value) {
function string (line 494) | string& Graph::operator()(const deque<long long>& data, bool data_same) {
function string (line 511) | string& Graph::operator()() {
function calcSizes (line 2214) | void calcSizes() {
FILE: src/btop_draw.hpp
type Symbols (line 33) | namespace Symbols {
type Draw (line 62) | namespace Draw {
class TextEdit (line 68) | class TextEdit {
class Meter (line 90) | class Meter {
class Graph (line 104) | class Graph {
type Proc (line 137) | namespace Proc {
FILE: src/btop_input.cpp
type Input (line 41) | namespace Input {
function poll (line 95) | bool poll(const uint64_t timeout) {
function string (line 123) | string get() {
function string (line 201) | string wait() {
function interrupt (line 206) | void interrupt() {
function clear (line 210) | void clear() {
function process (line 214) | void process(const std::string_view key) {
FILE: src/btop_input.hpp
type Input (line 40) | namespace Input {
type Mouse_loc (line 42) | struct Mouse_loc {
FILE: src/btop_log.cpp
type Logger (line 32) | namespace Logger {
type State (line 36) | struct State {
function get_state (line 43) | [[nodiscard]] auto get_state() -> State& {
function rotate_log_file (line 48) | auto rotate_log_file(fs::path& path) {
class DropPrivilegeGuard (line 63) | class DropPrivilegeGuard {
method DropPrivilegeGuard (line 68) | DropPrivilegeGuard() {
method DropPrivilegeGuard (line 88) | DropPrivilegeGuard(const DropPrivilegeGuard&) = delete;
method DropPrivilegeGuard (line 89) | DropPrivilegeGuard& operator=(const DropPrivilegeGuard&) = delete;
function init (line 93) | void init(const fs::path& path) {
function set_log_level (line 99) | void set_log_level(Level level) {
function set_log_level (line 105) | void set_log_level(const std::string_view level) {
type detail (line 114) | namespace detail {
function is_enabled (line 115) | [[nodiscard]] auto is_enabled(Level level) -> bool {
function log_write (line 120) | void log_write(Level level, const std::string_view msg) {
FILE: src/btop_log.hpp
type Logger (line 15) | namespace Logger {
type Level (line 16) | enum class Level : std::uint8_t {
type detail (line 26) | namespace detail {
function error (line 39) | inline void error(fmt::format_string<T...> fmt, T&&... args) {
function warning (line 47) | inline void warning(fmt::format_string<T...> fmt, T&&... args) {
function info (line 55) | inline void info(fmt::format_string<T...> fmt, T&&... args) {
function debug (line 63) | inline void debug(fmt::format_string<T...> fmt, T&&... args) {
FILE: src/btop_menu.cpp
function string (line 915) | string msgBox::operator()() {
type menuReturnCodes (line 976) | enum menuReturnCodes {
function signalChoose (line 983) | static int signalChoose(const string& key) {
function sizeError (line 1091) | static int sizeError(const string& key) {
function signalSend (line 1113) | static int signalSend(const string& key) {
function signalReturn (line 1153) | static int signalReturn(const string& key) {
function mainMenu (line 1185) | static int mainMenu(const string& key) {
type Predispositions (line 1265) | enum Predispositions { isBool, isInt, isString, is2D, isBrowsable, isEdi...
function helpMenu (line 1660) | static int helpMenu(const string& key) {
function reniceMenu (line 1713) | static int reniceMenu(const string& key) {
function process (line 1814) | void process(const std::string_view key) {
function show (line 1867) | void show(int menu, int signal) {
FILE: src/btop_menu.hpp
type Menu (line 34) | namespace Menu {
class msgBox (line 48) | class msgBox {
type BoxTypes (line 57) | enum BoxTypes { OK, YES_NO, NO_YES }
type msgReturn (line 58) | enum msgReturn {
method getX (line 75) | int getX() const { return x; }
method getY (line 76) | int getY() const { return y; }
type Menus (line 82) | enum Menus {
FILE: src/btop_shared.cpp
type Cpu (line 34) | namespace Cpu {
function string (line 37) | string trim_name(string name) {
type Gpu (line 83) | namespace Gpu {
type Proc (line 95) | namespace Proc {
function set_priority (line 96) | bool set_priority(pid_t pid, int priority) {
function proc_sorter (line 103) | void proc_sorter(vector<proc_info>& proc_vec, const string& sorting, b...
function tree_sort (line 147) | void tree_sort(vector<tree_proc>& proc_vec, const string& sorting, boo...
function matches_filter (line 175) | auto matches_filter(const proc_info& proc, const std::string& filter) ...
function _tree_gen (line 195) | void _tree_gen(proc_info& cur_proc, vector<proc_info>& in_procs, vecto...
function _collect_prefixes (line 260) | void _collect_prefixes(tree_proc &t, const bool is_last, const string ...
function detect_container (line 274) | auto detect_container() -> std::optional<std::string> {
FILE: src/btop_shared.hpp
type Global (line 59) | namespace Global {
type Runner (line 73) | namespace Runner {
type Tools (line 86) | namespace Tools {
type Shared (line 91) | namespace Shared {
type KvmDeleter (line 98) | struct KvmDeleter {
type Gpu (line 109) | namespace Gpu {
type gpu_info_supported (line 132) | struct gpu_info_supported {
type gpu_info (line 148) | struct gpu_info {
type Nvml (line 180) | namespace Nvml {
type Rsmi (line 183) | namespace Rsmi {
type AppleSilicon (line 187) | namespace AppleSilicon {
type Cpu (line 201) | namespace Cpu {
type cpu_info (line 211) | struct cpu_info {
type Mem (line 258) | namespace Mem {
type disk_info (line 266) | struct disk_info {
type mem_info (line 283) | struct mem_info {
type Net (line 305) | namespace Net {
type net_stat (line 314) | struct net_stat {
type net_info (line 323) | struct net_info {
class IfAddrsPtr (line 331) | class IfAddrsPtr {
type ifaddrs (line 332) | struct ifaddrs
method IfAddrsPtr (line 335) | IfAddrsPtr() { status = getifaddrs(&ifaddr); }
method IfAddrsPtr (line 337) | IfAddrsPtr(const IfAddrsPtr &) = delete;
method IfAddrsPtr (line 338) | IfAddrsPtr& operator=(IfAddrsPtr& other) = delete;
method IfAddrsPtr (line 339) | IfAddrsPtr(IfAddrsPtr &&) = delete;
method IfAddrsPtr (line 340) | IfAddrsPtr& operator=(IfAddrsPtr&& other) = delete;
type ifaddrs (line 341) | struct ifaddrs
method get (line 342) | [[nodiscard]] constexpr auto get() -> struct ifaddrs* { return ifadd...
method get_status (line 343) | [[nodiscard]] constexpr auto get_status() const noexcept -> int { re...
type Proc (line 355) | namespace Proc {
type proc_info (line 396) | struct proc_info {
type detail_container (line 421) | struct detail_container {
type tree_proc (line 443) | struct tree_proc {
FILE: src/btop_theme.cpp
type Theme (line 41) | namespace Theme {
function truecolor_to_256 (line 155) | int truecolor_to_256(const int& r, const int& g, const int& b) {
function string (line 167) | string hex_to_color(string hexa, bool t_to_256, const string& depth) {
function string (line 206) | string dec_to_color(int r, int g, int b, bool t_to_256, const string& ...
function hex_to_dec (line 217) | array<int, 3> hex_to_dec(string hexa) {
function generateColors (line 241) | void generateColors(const std::unordered_map<string, string>& source) {
function generateGradients (line 305) | void generateGradients() {
function generateTTYColors (line 365) | void generateTTYColors() {
function loadFile (line 388) | auto loadFile(const string& filename) {
function updateThemes (line 428) | void updateThemes() {
function setTheme (line 445) | void setTheme() {
FILE: src/btop_theme.hpp
type Theme (line 31) | namespace Theme {
function string (line 62) | inline const string& c(const string& name) { return colors.at(name); }
FILE: src/btop_tools.cpp
type Term (line 55) | namespace Term {
type termios (line 63) | struct termios
function echo (line 66) | bool echo(bool on=true) {
function linebuffered (line 75) | bool linebuffered(bool on=true) {
function refresh (line 91) | bool refresh(bool only_check) {
function get_min_size (line 119) | auto get_min_size(const string& boxes) -> array<int, 2> {
function init (line 150) | bool init() {
function restore (line 176) | void restore() {
type Tools (line 212) | namespace Tools {
function string (line 214) | string replace_ascii_control(string str, const char replacement) {
function wide_ulen (line 237) | size_t wide_ulen(const std::string_view str) {
function wide_ulen (line 256) | size_t wide_ulen(const vector<wchar_t> w_str) {
function string (line 266) | string uresize(string str, const size_t len, bool wide) {
function string (line 299) | string luresize(string str, const size_t len, bool wide) {
function string (line 321) | string s_replace(const string& str, const string& from, const string& ...
function string_view (line 329) | string_view ltrim(string_view str, const string_view t_str) {
function string_view (line 336) | string_view rtrim(string_view str, const string_view t_str) {
function string (line 343) | string ljust(string str, const size_t x, bool utf, bool wide, bool lim...
function string (line 359) | string rjust(string str, const size_t x, bool utf, bool wide, bool lim...
function string (line 375) | string cjust(string str, const size_t x, bool utf, bool wide, bool lim...
function string (line 391) | string trans(const string& str) {
function string (line 405) | string sec_to_dhms(size_t seconds, bool no_days, bool no_seconds) {
function string (line 416) | string floating_humanizer(uint64_t value, bool shorten, size_t start, ...
function string (line 533) | string strf_time(const string& strf) {
function atomic_wait (line 541) | void atomic_wait(const atomic<bool>& atom, bool old) noexcept {
function atomic_wait_for (line 545) | void atomic_wait_for(const atomic<bool>& atom, bool old, const uint64_...
function string (line 561) | string readfile(const std::filesystem::path& path, const string& fallb...
function celsius_to (line 575) | auto celsius_to(const long long& celsius, const string& scale) -> tupl...
function string (line 587) | string hostname() {
function string (line 594) | string username() {
FILE: src/btop_tools.hpp
type Fx (line 68) | namespace Fx {
function string (line 96) | inline string uncolor(const string& s) { return std::regex_replace(s, ...
type Mv (line 102) | namespace Mv {
function string (line 104) | inline string to(int line, int col) { return Fx::e + to_string(line) +...
function string (line 107) | inline string r(int x) { return Fx::e + to_string(x) + 'C'; }
function string (line 110) | inline string l(int x) { return Fx::e + to_string(x) + 'D'; }
function string (line 113) | inline string u(int x) { return Fx::e + to_string(x) + 'A'; }
function string (line 116) | inline string d(int x) { return Fx::e + to_string(x) + 'B'; }
type Term (line 126) | namespace Term {
type Tools (line 161) | namespace Tools {
class MyNumPunct (line 164) | class MyNumPunct : public std::numpunct<char> {
method do_thousands_sep (line 166) | virtual char do_thousands_sep() const override { return '\''; }
method do_grouping (line 167) | virtual std::string do_grouping() const override { return "\03"; }
function ulen (line 174) | inline size_t ulen(const std::string_view str, bool wide = false) {
function string (line 191) | inline string capitalize(string str) {
function str_to_upper (line 197) | inline auto str_to_upper(string str) {
function str_to_lower (line 203) | inline auto str_to_lower(string str) {
function v_contains (line 210) | inline bool v_contains(const vector<T>& vec, const T2& find_val) {
function s_contains_ic (line 215) | inline bool s_contains_ic(const std::string_view str, const std::strin...
function v_index (line 226) | inline size_t v_index(const vector<T>& vec, const T& find_val) {
function is_in (line 232) | inline bool is_in(const First& first, const T& ... t) {
function time_s (line 237) | inline uint64_t time_s() {
function time_ms (line 242) | inline uint64_t time_ms() {
function time_micros (line 247) | inline uint64_t time_micros() {
function isbool (line 252) | inline bool isbool(const std::string_view str) {
function stobool (line 257) | inline bool stobool(const std::string_view str) {
function isint (line 262) | constexpr bool isint(const std::string_view str) {
function string_view (line 273) | inline string_view trim(string_view str, string_view t_str = " ") {
function ssplit (line 278) | constexpr auto ssplit(std::string_view str, char delim = ' ') {
function sleep_ms (line 284) | inline void sleep_ms(const size_t& ms) {
function sleep_micros (line 289) | inline void sleep_micros(const size_t& micros) {
function T (line 319) | const T& safeVal(const std::unordered_map<K, T>& map, const K& key, co...
function T (line 328) | const T& safeVal(const std::unordered_map<K, T>& map, const K& key, co...
function T (line 340) | const T& safeVal(const std::vector<T>& vec, const size_t& index, const...
function T (line 349) | const T& safeVal(const std::vector<T>& vec, const size_t& index, const...
class atomic_lock (line 372) | class atomic_lock {
method atomic_lock (line 378) | atomic_lock(const atomic_lock& other) = delete;
method atomic_lock (line 379) | atomic_lock& operator=(const atomic_lock& other) = delete;
method atomic_lock (line 380) | atomic_lock(atomic_lock&& other) = delete;
method atomic_lock (line 381) | atomic_lock& operator=(atomic_lock&& other) = delete;
class DebugTimer (line 397) | class DebugTimer {
method DebugTimer (line 406) | DebugTimer() = default;
method DebugTimer (line 409) | DebugTimer(const DebugTimer& other) = delete;
method DebugTimer (line 410) | DebugTimer& operator=(const DebugTimer& other) = delete;
method DebugTimer (line 411) | DebugTimer(DebugTimer&& other) = delete;
method DebugTimer (line 412) | DebugTimer& operator=(DebugTimer&& other) = delete;
type Tools (line 391) | namespace Tools {
class MyNumPunct (line 164) | class MyNumPunct : public std::numpunct<char> {
method do_thousands_sep (line 166) | virtual char do_thousands_sep() const override { return '\''; }
method do_grouping (line 167) | virtual std::string do_grouping() const override { return "\03"; }
function ulen (line 174) | inline size_t ulen(const std::string_view str, bool wide = false) {
function string (line 191) | inline string capitalize(string str) {
function str_to_upper (line 197) | inline auto str_to_upper(string str) {
function str_to_lower (line 203) | inline auto str_to_lower(string str) {
function v_contains (line 210) | inline bool v_contains(const vector<T>& vec, const T2& find_val) {
function s_contains_ic (line 215) | inline bool s_contains_ic(const std::string_view str, const std::strin...
function v_index (line 226) | inline size_t v_index(const vector<T>& vec, const T& find_val) {
function is_in (line 232) | inline bool is_in(const First& first, const T& ... t) {
function time_s (line 237) | inline uint64_t time_s() {
function time_ms (line 242) | inline uint64_t time_ms() {
function time_micros (line 247) | inline uint64_t time_micros() {
function isbool (line 252) | inline bool isbool(const std::string_view str) {
function stobool (line 257) | inline bool stobool(const std::string_view str) {
function isint (line 262) | constexpr bool isint(const std::string_view str) {
function string_view (line 273) | inline string_view trim(string_view str, string_view t_str = " ") {
function ssplit (line 278) | constexpr auto ssplit(std::string_view str, char delim = ' ') {
function sleep_ms (line 284) | inline void sleep_ms(const size_t& ms) {
function sleep_micros (line 289) | inline void sleep_micros(const size_t& micros) {
function T (line 319) | const T& safeVal(const std::unordered_map<K, T>& map, const K& key, co...
function T (line 328) | const T& safeVal(const std::unordered_map<K, T>& map, const K& key, co...
function T (line 340) | const T& safeVal(const std::vector<T>& vec, const size_t& index, const...
function T (line 349) | const T& safeVal(const std::vector<T>& vec, const size_t& index, const...
class atomic_lock (line 372) | class atomic_lock {
method atomic_lock (line 378) | atomic_lock(const atomic_lock& other) = delete;
method atomic_lock (line 379) | atomic_lock& operator=(const atomic_lock& other) = delete;
method atomic_lock (line 380) | atomic_lock(atomic_lock&& other) = delete;
method atomic_lock (line 381) | atomic_lock& operator=(atomic_lock&& other) = delete;
class DebugTimer (line 397) | class DebugTimer {
method DebugTimer (line 406) | DebugTimer() = default;
method DebugTimer (line 409) | DebugTimer(const DebugTimer& other) = delete;
method DebugTimer (line 410) | DebugTimer& operator=(const DebugTimer& other) = delete;
method DebugTimer (line 411) | DebugTimer(DebugTimer&& other) = delete;
method DebugTimer (line 412) | DebugTimer& operator=(DebugTimer&& other) = delete;
FILE: src/freebsd/btop_collect.cpp
type Cpu (line 79) | namespace Cpu {
type Sensor (line 96) | struct Sensor {
function string (line 215) | string get_cpuName() {
function get_sensors (line 226) | bool get_sensors() {
function update_sensors (line 245) | void update_sensors() {
function string (line 280) | string get_cpuHz() {
function get_core_mapping (line 290) | auto get_core_mapping() -> std::unordered_map<int, int> {
function get_battery (line 333) | auto get_battery() -> tuple<int, float, long, string> {
function collect (line 370) | auto collect(bool no_update) -> cpu_info & {
type Mem (line 109) | namespace Mem {
function get_totalMem (line 474) | uint64_t get_totalMem() {
function assign_values (line 478) | void assign_values(struct disk_info& disk, int64_t readBytes, int64_t ...
class PipeWrapper (line 504) | class PipeWrapper {
method PipeWrapper (line 506) | PipeWrapper(const char *file, const char *mode) {fd = popen(file, mo...
function get_zpools (line 514) | void get_zpools() {
function collect_disk (line 529) | void collect_disk(std::unordered_map<string, disk_info> &disks, std::u...
function collect (line 592) | auto collect(bool no_update) -> mem_info & {
type Shared (line 116) | namespace Shared {
function init (line 124) | void init() {
type Cpu (line 198) | namespace Cpu {
type Sensor (line 96) | struct Sensor {
function string (line 215) | string get_cpuName() {
function get_sensors (line 226) | bool get_sensors() {
function update_sensors (line 245) | void update_sensors() {
function string (line 280) | string get_cpuHz() {
function get_core_mapping (line 290) | auto get_core_mapping() -> std::unordered_map<int, int> {
function get_battery (line 333) | auto get_battery() -> tuple<int, float, long, string> {
function collect (line 370) | auto collect(bool no_update) -> cpu_info & {
type Mem (line 465) | namespace Mem {
function get_totalMem (line 474) | uint64_t get_totalMem() {
function assign_values (line 478) | void assign_values(struct disk_info& disk, int64_t readBytes, int64_t ...
class PipeWrapper (line 504) | class PipeWrapper {
method PipeWrapper (line 506) | PipeWrapper(const char *file, const char *mode) {fd = popen(file, mo...
function get_zpools (line 514) | void get_zpools() {
function collect_disk (line 529) | void collect_disk(std::unordered_map<string, disk_info> &disks, std::u...
function collect (line 592) | auto collect(bool no_update) -> mem_info & {
type Net (line 782) | namespace Net {
function collect (line 793) | auto collect(bool no_update) -> net_info & {
type Proc (line 998) | namespace Proc {
function string (line 1018) | string get_status(char s) {
function _collect_details (line 1028) | void _collect_details(const size_t pid, vector<proc_info> &procs) {
function collect (line 1080) | auto collect(bool no_update) -> vector<proc_info> & {
type Tools (line 1349) | namespace Tools {
function system_uptime (line 1350) | double system_uptime() {
FILE: src/linux/btop_collect.cpp
function get_monotonicTimeUSec (line 106) | long long get_monotonicTimeUSec()
type Cpu (line 115) | namespace Cpu {
type Sensor (line 135) | struct Sensor {
function string (line 409) | string get_cpuName() {
function get_sensors (line 441) | bool get_sensors() {
function update_sensors (line 573) | static void update_sensors() {
function string (line 598) | static string normalize_frequency(double hz) {
function string (line 618) | string get_cpuHz() {
function get_core_mapping (line 709) | auto get_core_mapping() -> std::unordered_map<int, int> {
type battery (line 774) | struct battery {
function get_battery (line 781) | auto get_battery() -> tuple<int, float, long, string> {
function get_cpuConsumptionUJoules (line 978) | long long get_cpuConsumptionUJoules()
function get_cpuConsumptionWatts (line 990) | float get_cpuConsumptionWatts()
function to_int (line 1019) | static constexpr auto to_int(std::string_view view) {
function detect_active_cpus (line 1025) | static constexpr auto detect_active_cpus() {
function collect (line 1050) | auto collect(bool no_update) -> cpu_info& {
type Gpu (line 149) | namespace Gpu {
type Nvml (line 152) | namespace Nvml {
type nvmlUtilization_t (line 171) | struct nvmlUtilization_t {unsigned int gpu, memory;}
type nvmlMemory_t (line 172) | struct nvmlMemory_t {unsigned long long total, free, used;}
function init (line 1200) | bool init() {
function shutdown (line 1280) | bool shutdown() {
function collect (line 1292) | bool collect(gpu_info* gpus_slice) { // raw pointer to vector data, ...
type Rsmi (line 204) | namespace Rsmi {
type rsmi_version_t (line 225) | struct rsmi_version_t {uint32_t major, minor, patch; const char* b...
type rsmi_frequencies_t_v5 (line 226) | struct rsmi_frequencies_t_v5 {uint32_t num_supported, current; uint6...
type rsmi_frequencies_t_v6 (line 227) | struct rsmi_frequencies_t_v6 {bool has_deep_sleep; uint32_t num_supp...
function init (line 1506) | bool init() {
function shutdown (line 1610) | bool shutdown() {
function collect (line 1623) | bool collect(gpu_info* gpus_slice) { // raw pointer to vector data, ...
type Intel (line 260) | namespace Intel {
type engines (line 262) | struct engines
function init (line 1811) | bool init() {
function shutdown (line 1866) | bool shutdown() {
function collect (line 1876) | bool collect(gpu_info* gpus_slice) {
type Nvml (line 1199) | namespace Nvml {
type nvmlUtilization_t (line 171) | struct nvmlUtilization_t {unsigned int gpu, memory;}
type nvmlMemory_t (line 172) | struct nvmlMemory_t {unsigned long long total, free, used;}
function init (line 1200) | bool init() {
function shutdown (line 1280) | bool shutdown() {
function collect (line 1292) | bool collect(gpu_info* gpus_slice) { // raw pointer to vector data, ...
type Rsmi (line 1505) | namespace Rsmi {
type rsmi_version_t (line 225) | struct rsmi_version_t {uint32_t major, minor, patch; const char* b...
type rsmi_frequencies_t_v5 (line 226) | struct rsmi_frequencies_t_v5 {uint32_t num_supported, current; uint6...
type rsmi_frequencies_t_v6 (line 227) | struct rsmi_frequencies_t_v6 {bool has_deep_sleep; uint32_t num_supp...
function init (line 1506) | bool init() {
function shutdown (line 1610) | bool shutdown() {
function collect (line 1623) | bool collect(gpu_info* gpus_slice) { // raw pointer to vector data, ...
type Intel (line 1810) | namespace Intel {
type engines (line 262) | struct engines
function init (line 1811) | bool init() {
function shutdown (line 1866) | bool shutdown() {
function collect (line 1876) | bool collect(gpu_info* gpus_slice) {
function collect (line 1926) | auto collect(bool no_update) -> vector<gpu_info>& {
type Mem (line 274) | namespace Mem {
type disk_info (line 2025) | struct disk_info
function get_totalMem (line 2029) | uint64_t get_totalMem() {
function collect (line 2043) | auto collect(bool no_update) -> mem_info& {
function get_zfs_stat_file (line 2456) | fs::path get_zfs_stat_file(const string& device_name, size_t dataset_n...
function zfs_collect_pool_total_stats (line 2510) | bool zfs_collect_pool_total_stats(struct disk_info &disk) {
type Shared (line 278) | namespace Shared {
function init (line 283) | void init() {
type Cpu (line 383) | namespace Cpu {
type Sensor (line 135) | struct Sensor {
function string (line 409) | string get_cpuName() {
function get_sensors (line 441) | bool get_sensors() {
function update_sensors (line 573) | static void update_sensors() {
function string (line 598) | static string normalize_frequency(double hz) {
function string (line 618) | string get_cpuHz() {
function get_core_mapping (line 709) | auto get_core_mapping() -> std::unordered_map<int, int> {
type battery (line 774) | struct battery {
function get_battery (line 781) | auto get_battery() -> tuple<int, float, long, string> {
function get_cpuConsumptionUJoules (line 978) | long long get_cpuConsumptionUJoules()
function get_cpuConsumptionWatts (line 990) | float get_cpuConsumptionWatts()
function to_int (line 1019) | static constexpr auto to_int(std::string_view view) {
function detect_active_cpus (line 1025) | static constexpr auto detect_active_cpus() {
function collect (line 1050) | auto collect(bool no_update) -> cpu_info& {
type Gpu (line 1197) | namespace Gpu {
type Nvml (line 152) | namespace Nvml {
type nvmlUtilization_t (line 171) | struct nvmlUtilization_t {unsigned int gpu, memory;}
type nvmlMemory_t (line 172) | struct nvmlMemory_t {unsigned long long total, free, used;}
function init (line 1200) | bool init() {
function shutdown (line 1280) | bool shutdown() {
function collect (line 1292) | bool collect(gpu_info* gpus_slice) { // raw pointer to vector data, ...
type Rsmi (line 204) | namespace Rsmi {
type rsmi_version_t (line 225) | struct rsmi_version_t {uint32_t major, minor, patch; const char* b...
type rsmi_frequencies_t_v5 (line 226) | struct rsmi_frequencies_t_v5 {uint32_t num_supported, current; uint6...
type rsmi_frequencies_t_v6 (line 227) | struct rsmi_frequencies_t_v6 {bool has_deep_sleep; uint32_t num_supp...
function init (line 1506) | bool init() {
function shutdown (line 1610) | bool shutdown() {
function collect (line 1623) | bool collect(gpu_info* gpus_slice) { // raw pointer to vector data, ...
type Intel (line 260) | namespace Intel {
type engines (line 262) | struct engines
function init (line 1811) | bool init() {
function shutdown (line 1866) | bool shutdown() {
function collect (line 1876) | bool collect(gpu_info* gpus_slice) {
type Nvml (line 1199) | namespace Nvml {
type nvmlUtilization_t (line 171) | struct nvmlUtilization_t {unsigned int gpu, memory;}
type nvmlMemory_t (line 172) | struct nvmlMemory_t {unsigned long long total, free, used;}
function init (line 1200) | bool init() {
function shutdown (line 1280) | bool shutdown() {
function collect (line 1292) | bool collect(gpu_info* gpus_slice) { // raw pointer to vector data, ...
type Rsmi (line 1505) | namespace Rsmi {
type rsmi_version_t (line 225) | struct rsmi_version_t {uint32_t major, minor, patch; const char* b...
type rsmi_frequencies_t_v5 (line 226) | struct rsmi_frequencies_t_v5 {uint32_t num_supported, current; uint6...
type rsmi_frequencies_t_v6 (line 227) | struct rsmi_frequencies_t_v6 {bool has_deep_sleep; uint32_t num_supp...
function init (line 1506) | bool init() {
function shutdown (line 1610) | bool shutdown() {
function collect (line 1623) | bool collect(gpu_info* gpus_slice) { // raw pointer to vector data, ...
type Intel (line 1810) | namespace Intel {
type engines (line 262) | struct engines
function init (line 1811) | bool init() {
function shutdown (line 1866) | bool shutdown() {
function collect (line 1876) | bool collect(gpu_info* gpus_slice) {
function collect (line 1926) | auto collect(bool no_update) -> vector<gpu_info>& {
function convert_ascii_escapes (line 1985) | static auto convert_ascii_escapes(const std::string& input) -> std::stri...
type Mem (line 2014) | namespace Mem {
type disk_info (line 2025) | struct disk_info
function get_totalMem (line 2029) | uint64_t get_totalMem() {
function collect (line 2043) | auto collect(bool no_update) -> mem_info& {
function get_zfs_stat_file (line 2456) | fs::path get_zfs_stat_file(const string& device_name, size_t dataset_n...
function zfs_collect_pool_total_stats (line 2510) | bool zfs_collect_pool_total_stats(struct disk_info &disk) {
type Net (line 2590) | namespace Net {
function collect (line 2601) | auto collect(bool no_update) -> net_info& {
type Proc (line 2795) | namespace Proc {
function _collect_details (line 2818) | static void _collect_details(const size_t pid, const uint64_t uptime, ...
function collect (line 2916) | auto collect(bool no_update) -> vector<proc_info>& {
type Tools (line 3327) | namespace Tools {
function system_uptime (line 3328) | double system_uptime() {
FILE: src/linux/intel_gpu_top/drm.h
type drm_handle_t (line 42) | typedef unsigned int drm_handle_t;
type __s8 (line 49) | typedef int8_t __s8;
type __u8 (line 50) | typedef uint8_t __u8;
type __s16 (line 51) | typedef int16_t __s16;
type __u16 (line 52) | typedef uint16_t __u16;
type __s32 (line 53) | typedef int32_t __s32;
type __u32 (line 54) | typedef uint32_t __u32;
type __s64 (line 55) | typedef int64_t __s64;
type __u64 (line 56) | typedef uint64_t __u64;
type __kernel_size_t (line 57) | typedef size_t __kernel_size_t;
type drm_handle_t (line 58) | typedef unsigned long drm_handle_t;
type drm_context_t (line 77) | typedef unsigned int drm_context_t;
type drm_drawable_t (line 78) | typedef unsigned int drm_drawable_t;
type drm_magic_t (line 79) | typedef unsigned int drm_magic_t;
type drm_clip_rect (line 90) | struct drm_clip_rect {
type drm_drawable_info (line 100) | struct drm_drawable_info {
type drm_tex_region (line 108) | struct drm_tex_region {
type drm_hw_lock (line 123) | struct drm_hw_lock {
type drm_version (line 133) | struct drm_version {
type drm_unique (line 150) | struct drm_unique {
type drm_list (line 155) | struct drm_list {
type drm_block (line 160) | struct drm_block {
type drm_control (line 169) | struct drm_control {
type drm_map_type (line 182) | enum drm_map_type {
type drm_map_flags (line 194) | enum drm_map_flags {
type drm_ctx_priv_map (line 205) | struct drm_ctx_priv_map {
type drm_map (line 216) | struct drm_map {
type drm_client (line 230) | struct drm_client {
type drm_stat_type (line 239) | enum drm_stat_type {
type drm_stats (line 262) | struct drm_stats {
type drm_lock_flags (line 273) | enum drm_lock_flags {
type drm_lock (line 290) | struct drm_lock {
type drm_dma_flags (line 303) | enum drm_dma_flags {
type drm_buf_desc (line 329) | struct drm_buf_desc {
type drm_buf_info (line 350) | struct drm_buf_info {
type drm_buf_free (line 358) | struct drm_buf_free {
type drm_buf_pub (line 368) | struct drm_buf_pub {
type drm_buf_map (line 378) | struct drm_buf_map {
type drm_dma (line 395) | struct drm_dma {
type drm_ctx_flags (line 408) | enum drm_ctx_flags {
type drm_ctx (line 418) | struct drm_ctx {
type drm_ctx_res (line 426) | struct drm_ctx_res {
type drm_draw (line 434) | struct drm_draw {
type drm_drawable_info_type_t (line 441) | typedef enum {
type drm_update_draw (line 445) | struct drm_update_draw {
type drm_auth (line 455) | struct drm_auth {
type drm_irq_busid (line 464) | struct drm_irq_busid {
type drm_vblank_seq_type (line 471) | enum drm_vblank_seq_type {
type drm_wait_vblank_request (line 488) | struct drm_wait_vblank_request {
type drm_wait_vblank_reply (line 494) | struct drm_wait_vblank_reply {
type drm_wait_vblank_request (line 507) | struct drm_wait_vblank_request
type drm_wait_vblank_reply (line 508) | struct drm_wait_vblank_reply
type drm_modeset_ctl (line 519) | struct drm_modeset_ctl {
type drm_agp_mode (line 529) | struct drm_agp_mode {
type drm_agp_buffer (line 538) | struct drm_agp_buffer {
type drm_agp_binding (line 550) | struct drm_agp_binding {
type drm_agp_info (line 562) | struct drm_agp_info {
type drm_scatter_gather (line 579) | struct drm_scatter_gather {
type drm_set_version (line 587) | struct drm_set_version {
type drm_gem_close (line 595) | struct drm_gem_close {
type drm_gem_flink (line 602) | struct drm_gem_flink {
type drm_gem_open (line 611) | struct drm_gem_open {
type drm_get_cap (line 772) | struct drm_get_cap {
type drm_set_client_cap (line 840) | struct drm_set_client_cap {
type drm_prime_handle (line 847) | struct drm_prime_handle {
type drm_syncobj_create (line 857) | struct drm_syncobj_create {
type drm_syncobj_destroy (line 863) | struct drm_syncobj_destroy {
type drm_syncobj_handle (line 870) | struct drm_syncobj_handle {
type drm_syncobj_transfer (line 878) | struct drm_syncobj_transfer {
type drm_syncobj_wait (line 890) | struct drm_syncobj_wait {
type drm_syncobj_timeline_wait (line 900) | struct drm_syncobj_timeline_wait {
type drm_syncobj_eventfd (line 925) | struct drm_syncobj_eventfd {
type drm_syncobj_array (line 934) | struct drm_syncobj_array {
type drm_syncobj_timeline_array (line 941) | struct drm_syncobj_timeline_array {
type drm_crtc_get_sequence (line 950) | struct drm_crtc_get_sequence {
type drm_crtc_queue_sequence (line 964) | struct drm_crtc_queue_sequence {
type drm_event (line 1220) | struct drm_event {
type drm_event_vblank (line 1252) | struct drm_event_vblank {
type drm_event_crtc_sequence (line 1264) | struct drm_event_crtc_sequence {
type drm_clip_rect_t (line 1272) | typedef struct drm_clip_rect drm_clip_rect_t;
type drm_drawable_info_t (line 1273) | typedef struct drm_drawable_info drm_drawable_info_t;
type drm_tex_region_t (line 1274) | typedef struct drm_tex_region drm_tex_region_t;
type drm_hw_lock_t (line 1275) | typedef struct drm_hw_lock drm_hw_lock_t;
type drm_version_t (line 1276) | typedef struct drm_version drm_version_t;
type drm_unique_t (line 1277) | typedef struct drm_unique drm_unique_t;
type drm_list_t (line 1278) | typedef struct drm_list drm_list_t;
type drm_block_t (line 1279) | typedef struct drm_block drm_block_t;
type drm_control_t (line 1280) | typedef struct drm_control drm_control_t;
type drm_map_type_t (line 1281) | typedef enum drm_map_type drm_map_type_t;
type drm_map_flags_t (line 1282) | typedef enum drm_map_flags drm_map_flags_t;
type drm_ctx_priv_map_t (line 1283) | typedef struct drm_ctx_priv_map drm_ctx_priv_map_t;
type drm_map_t (line 1284) | typedef struct drm_map drm_map_t;
type drm_client_t (line 1285) | typedef struct drm_client drm_client_t;
type drm_stat_type_t (line 1286) | typedef enum drm_stat_type drm_stat_type_t;
type drm_stats_t (line 1287) | typedef struct drm_stats drm_stats_t;
type drm_lock_flags_t (line 1288) | typedef enum drm_lock_flags drm_lock_flags_t;
type drm_lock_t (line 1289) | typedef struct drm_lock drm_lock_t;
type drm_dma_flags_t (line 1290) | typedef enum drm_dma_flags drm_dma_flags_t;
type drm_buf_desc_t (line 1291) | typedef struct drm_buf_desc drm_buf_desc_t;
type drm_buf_info_t (line 1292) | typedef struct drm_buf_info drm_buf_info_t;
type drm_buf_free_t (line 1293) | typedef struct drm_buf_free drm_buf_free_t;
type drm_buf_pub_t (line 1294) | typedef struct drm_buf_pub drm_buf_pub_t;
type drm_buf_map_t (line 1295) | typedef struct drm_buf_map drm_buf_map_t;
type drm_dma_t (line 1296) | typedef struct drm_dma drm_dma_t;
type drm_wait_vblank_t (line 1297) | typedef union drm_wait_vblank drm_wait_vblank_t;
type drm_agp_mode_t (line 1298) | typedef struct drm_agp_mode drm_agp_mode_t;
type drm_ctx_flags_t (line 1299) | typedef enum drm_ctx_flags drm_ctx_flags_t;
type drm_ctx_t (line 1300) | typedef struct drm_ctx drm_ctx_t;
type drm_ctx_res_t (line 1301) | typedef struct drm_ctx_res drm_ctx_res_t;
type drm_draw_t (line 1302) | typedef struct drm_draw drm_draw_t;
type drm_update_draw_t (line 1303) | typedef struct drm_update_draw drm_update_draw_t;
type drm_auth_t (line 1304) | typedef struct drm_auth drm_auth_t;
type drm_irq_busid_t (line 1305) | typedef struct drm_irq_busid drm_irq_busid_t;
type drm_vblank_seq_type_t (line 1306) | typedef enum drm_vblank_seq_type drm_vblank_seq_type_t;
type drm_agp_buffer_t (line 1308) | typedef struct drm_agp_buffer drm_agp_buffer_t;
type drm_agp_binding_t (line 1309) | typedef struct drm_agp_binding drm_agp_binding_t;
type drm_agp_info_t (line 1310) | typedef struct drm_agp_info drm_agp_info_t;
type drm_scatter_gather_t (line 1311) | typedef struct drm_scatter_gather drm_scatter_gather_t;
type drm_set_version_t (line 1312) | typedef struct drm_set_version drm_set_version_t;
FILE: src/linux/intel_gpu_top/drm_mode.h
type drm_mode_modeinfo (line 242) | struct drm_mode_modeinfo {
type drm_mode_card_res (line 262) | struct drm_mode_card_res {
type drm_mode_crtc (line 277) | struct drm_mode_crtc {
type drm_mode_set_plane (line 296) | struct drm_mode_set_plane {
type drm_mode_get_plane (line 329) | struct drm_mode_get_plane {
type drm_mode_get_plane_res (line 360) | struct drm_mode_get_plane_res {
type drm_mode_get_encoder (line 375) | struct drm_mode_get_encoder {
type drm_mode_subconnector (line 387) | enum drm_mode_subconnector {
type drm_mode_get_connector (line 458) | struct drm_mode_get_connector {
type drm_mode_property_enum (line 554) | struct drm_mode_property_enum {
type drm_mode_get_property (line 590) | struct drm_mode_get_property {
type drm_mode_connector_set_property (line 618) | struct drm_mode_connector_set_property {
type drm_mode_obj_get_properties (line 634) | struct drm_mode_obj_get_properties {
type drm_mode_obj_set_property (line 642) | struct drm_mode_obj_set_property {
type drm_mode_get_blob (line 649) | struct drm_mode_get_blob {
type drm_mode_fb_cmd (line 655) | struct drm_mode_fb_cmd {
type drm_mode_fb_cmd2 (line 703) | struct drm_mode_fb_cmd2 {
type drm_mode_fb_dirty_cmd (line 771) | struct drm_mode_fb_dirty_cmd {
type drm_mode_mode_cmd (line 779) | struct drm_mode_mode_cmd {
type drm_mode_cursor (line 802) | struct drm_mode_cursor {
type drm_mode_cursor2 (line 813) | struct drm_mode_cursor2 {
type drm_mode_crtc_lut (line 826) | struct drm_mode_crtc_lut {
type drm_color_ctm (line 836) | struct drm_color_ctm {
type drm_color_lut (line 849) | struct drm_color_lut {
type hdr_metadata_infoframe (line 869) | struct hdr_metadata_infoframe {
type hdr_output_metadata (line 933) | struct hdr_output_metadata {
type drm_mode_crtc_page_flip (line 999) | struct drm_mode_crtc_page_flip {
type drm_mode_crtc_page_flip_target (line 1027) | struct drm_mode_crtc_page_flip_target {
type drm_mode_create_dumb (line 1036) | struct drm_mode_create_dumb {
type drm_mode_map_dumb (line 1048) | struct drm_mode_map_dumb {
type drm_mode_destroy_dumb (line 1060) | struct drm_mode_destroy_dumb {
type drm_mode_atomic (line 1118) | struct drm_mode_atomic {
type drm_format_modifier_blob (line 1129) | struct drm_format_modifier_blob {
type drm_format_modifier (line 1153) | struct drm_format_modifier {
type drm_mode_create_blob (line 1185) | struct drm_mode_create_blob {
type drm_mode_destroy_blob (line 1206) | struct drm_mode_destroy_blob {
type drm_mode_create_lease (line 1219) | struct drm_mode_create_lease {
type drm_mode_list_lessees (line 1238) | struct drm_mode_list_lessees {
type drm_mode_get_lease (line 1265) | struct drm_mode_get_lease {
type drm_mode_revoke_lease (line 1290) | struct drm_mode_revoke_lease {
type drm_mode_rect (line 1307) | struct drm_mode_rect {
FILE: src/linux/intel_gpu_top/i915_drm.h
type i915_user_extension (line 102) | struct i915_user_extension {
type i915_mocs_table_index (line 137) | enum i915_mocs_table_index {
type drm_i915_gem_engine_class (line 166) | enum drm_i915_gem_engine_class {
type i915_engine_class_instance (line 234) | struct i915_engine_class_instance {
type drm_i915_pmu_engine_sample (line 257) | enum drm_i915_pmu_engine_sample {
type drm_i915_init_t (line 314) | typedef struct _drm_i915_init {
type drm_i915_sarea_t (line 338) | typedef struct _drm_i915_sarea {
type drm_i915_batchbuffer_t (line 556) | typedef struct drm_i915_batchbuffer {
type drm_i915_cmdbuffer_t (line 568) | typedef struct _drm_i915_cmdbuffer {
type drm_i915_irq_emit_t (line 579) | typedef struct drm_i915_irq_emit {
type drm_i915_irq_wait_t (line 583) | typedef struct drm_i915_irq_wait {
type drm_i915_getparam (line 814) | struct drm_i915_getparam {
type drm_i915_getparam_t (line 831) | typedef struct drm_i915_getparam drm_i915_getparam_t;
type drm_i915_setparam_t (line 841) | typedef struct drm_i915_setparam {
type drm_i915_mem_alloc_t (line 850) | typedef struct drm_i915_mem_alloc {
type drm_i915_mem_free_t (line 857) | typedef struct drm_i915_mem_free {
type drm_i915_mem_init_heap_t (line 862) | typedef struct drm_i915_mem_init_heap {
type drm_i915_mem_destroy_heap_t (line 871) | typedef struct drm_i915_mem_destroy_heap {
type drm_i915_vblank_pipe_t (line 880) | typedef struct drm_i915_vblank_pipe {
type drm_i915_vblank_swap_t (line 886) | typedef struct drm_i915_vblank_swap {
type drm_i915_hws_addr_t (line 892) | typedef struct drm_i915_hws_addr {
type drm_i915_gem_init (line 896) | struct drm_i915_gem_init {
type drm_i915_gem_create (line 909) | struct drm_i915_gem_create {
type drm_i915_gem_pread (line 925) | struct drm_i915_gem_pread {
type drm_i915_gem_pwrite (line 941) | struct drm_i915_gem_pwrite {
type drm_i915_gem_mmap (line 957) | struct drm_i915_gem_mmap {
type drm_i915_gem_mmap_gtt (line 985) | struct drm_i915_gem_mmap_gtt {
type drm_i915_gem_mmap_offset (line 1007) | struct drm_i915_gem_mmap_offset {
type drm_i915_gem_set_domain (line 1091) | struct drm_i915_gem_set_domain {
type drm_i915_gem_sw_finish (line 1107) | struct drm_i915_gem_sw_finish {
type drm_i915_gem_relocation_entry (line 1112) | struct drm_i915_gem_relocation_entry {
type drm_i915_gem_exec_object (line 1182) | struct drm_i915_gem_exec_object {
type drm_i915_gem_execbuffer (line 1208) | struct drm_i915_gem_execbuffer {
type drm_i915_gem_exec_object2 (line 1233) | struct drm_i915_gem_exec_object2 {
type drm_i915_gem_exec_fence (line 1321) | struct drm_i915_gem_exec_fence {
type drm_i915_gem_execbuffer_ext_timeline_fences (line 1348) | struct drm_i915_gem_execbuffer_ext_timeline_fences {
type drm_i915_gem_execbuffer2 (line 1379) | struct drm_i915_gem_execbuffer2 {
type drm_i915_gem_pin (line 1567) | struct drm_i915_gem_pin {
type drm_i915_gem_unpin (line 1579) | struct drm_i915_gem_unpin {
type drm_i915_gem_busy (line 1585) | struct drm_i915_gem_busy {
type drm_i915_gem_caching (line 1676) | struct drm_i915_gem_caching {
type drm_i915_gem_set_tiling (line 1736) | struct drm_i915_gem_set_tiling {
type drm_i915_gem_get_tiling (line 1767) | struct drm_i915_gem_get_tiling {
type drm_i915_gem_get_aperture (line 1790) | struct drm_i915_gem_get_aperture {
type drm_i915_get_pipe_from_crtc_id (line 1801) | struct drm_i915_get_pipe_from_crtc_id {
type drm_i915_gem_madvise (line 1813) | struct drm_i915_gem_madvise {
type drm_intel_overlay_put_image (line 1850) | struct drm_intel_overlay_put_image {
type drm_intel_overlay_attrs (line 1879) | struct drm_intel_overlay_attrs {
type drm_intel_sprite_colorkey (line 1919) | struct drm_intel_sprite_colorkey {
type drm_i915_gem_wait (line 1927) | struct drm_i915_gem_wait {
type drm_i915_gem_context_create (line 1935) | struct drm_i915_gem_context_create {
type drm_i915_gem_context_create_ext (line 1943) | struct drm_i915_gem_context_create_ext {
type drm_i915_gem_context_param (line 1984) | struct drm_i915_gem_context_param {
type drm_i915_gem_context_param_sseu (line 2178) | struct drm_i915_gem_context_param_sseu {
type i915_context_engines_load_balance (line 2295) | struct i915_context_engines_load_balance {
type i915_context_engines_bond (line 2331) | struct i915_context_engines_bond {
type i915_context_engines_parallel_submit (line 2425) | struct i915_context_engines_parallel_submit {
type i915_context_param_engines (line 2539) | struct i915_context_param_engines {
type drm_i915_gem_context_create_ext_setparam (line 2556) | struct drm_i915_gem_context_create_ext_setparam {
type drm_i915_gem_context_destroy (line 2567) | struct drm_i915_gem_context_destroy {
type drm_i915_gem_vm_control (line 2593) | struct drm_i915_gem_vm_control {
type drm_i915_reg_read (line 2604) | struct drm_i915_reg_read {
type drm_i915_reset_stats (line 2626) | struct drm_i915_reset_stats {
type drm_i915_gem_userptr (line 2648) | struct drm_i915_gem_userptr {
type drm_i915_oa_format (line 2711) | enum drm_i915_oa_format {
type drm_i915_perf_property_id (line 2736) | enum drm_i915_perf_property_id {
type drm_i915_perf_open_param (line 2837) | struct drm_i915_perf_open_param {
type drm_i915_perf_record_header (line 2892) | struct drm_i915_perf_record_header {
type drm_i915_perf_record_type (line 2898) | enum drm_i915_perf_record_type {
type drm_i915_perf_oa_config (line 2942) | struct drm_i915_perf_oa_config {
type drm_i915_query_item (line 3005) | struct drm_i915_query_item {
type drm_i915_query (line 3091) | struct drm_i915_query {
type drm_i915_query_topology_info (line 3115) | struct drm_i915_query_topology_info {
type drm_i915_engine_info (line 3293) | struct drm_i915_engine_info {
type drm_i915_query_engine_info (line 3324) | struct drm_i915_query_engine_info {
type drm_i915_query_perf_config (line 3341) | struct drm_i915_query_perf_config {
type drm_i915_gem_memory_class (line 3404) | enum drm_i915_gem_memory_class {
type drm_i915_gem_memory_class_instance (line 3414) | struct drm_i915_gem_memory_class_instance {
type drm_i915_memory_region_info (line 3430) | struct drm_i915_memory_region_info {
type drm_i915_query_memory_regions (line 3560) | struct drm_i915_query_memory_regions {
type drm_i915_query_guc_submission_version (line 3574) | struct drm_i915_query_guc_submission_version {
type drm_i915_gem_create_ext (line 3601) | struct drm_i915_gem_create_ext {
type drm_i915_gem_create_ext_memory_regions (line 3759) | struct drm_i915_gem_create_ext_memory_regions {
type drm_i915_gem_create_ext_protected_content (line 3809) | struct drm_i915_gem_create_ext_protected_content {
type drm_i915_gem_create_ext_set_pat (line 3839) | struct drm_i915_gem_create_ext_set_pat {
FILE: src/linux/intel_gpu_top/igt_perf.c
type stat (line 21) | struct stat
function xe_perf_type_id (line 97) | uint64_t xe_perf_type_id(int xe)
function i915_perf_type_id (line 104) | uint64_t i915_perf_type_id(int i915)
function igt_perf_type_id (line 111) | uint64_t igt_perf_type_id(const char *device)
function igt_perf_events_dir (line 134) | int igt_perf_events_dir(int i915)
function _perf_open (line 144) | static int
function perf_igfx_open (line 170) | int perf_igfx_open(uint64_t config)
function perf_igfx_open_group (line 176) | int perf_igfx_open_group(uint64_t config, int group)
function perf_xe_open (line 182) | int perf_xe_open(int xe, uint64_t config)
function perf_i915_open (line 188) | int perf_i915_open(int i915, uint64_t config)
function perf_i915_open_group (line 194) | int perf_i915_open_group(int i915, uint64_t config, int group)
function igt_perf_open (line 200) | int igt_perf_open(uint64_t type, uint64_t config)
function igt_perf_open_group (line 206) | int igt_perf_open_group(uint64_t type, uint64_t config, int group)
FILE: src/linux/intel_gpu_top/igt_perf.h
function perf_event_open (line 36) | static inline int
FILE: src/linux/intel_gpu_top/intel_chipset.h
type intel_device_info (line 36) | struct intel_device_info {
type intel_device_info (line 93) | struct intel_device_info
type pch_type (line 95) | enum pch_type
type pch_type (line 97) | enum pch_type {
FILE: src/linux/intel_gpu_top/intel_device_info.c
type pci_id_match (line 12) | struct pci_id_match {
type intel_device_info (line 40) | struct intel_device_info
type intel_device_info (line 45) | struct intel_device_info
type intel_device_info (line 52) | struct intel_device_info
type intel_device_info (line 59) | struct intel_device_info
type intel_device_info (line 65) | struct intel_device_info
type intel_device_info (line 71) | struct intel_device_info
type intel_device_info (line 78) | struct intel_device_info
type intel_device_info (line 85) | struct intel_device_info
type intel_device_info (line 91) | struct intel_device_info
type intel_device_info (line 98) | struct intel_device_info
type intel_device_info (line 104) | struct intel_device_info
type intel_device_info (line 112) | struct intel_device_info
type intel_device_info (line 119) | struct intel_device_info
type intel_device_info (line 126) | struct intel_device_info
type intel_device_info (line 134) | struct intel_device_info
type intel_device_info (line 141) | struct intel_device_info
type intel_device_info (line 149) | struct intel_device_info
type intel_device_info (line 155) | struct intel_device_info
type intel_device_info (line 163) | struct intel_device_info
type intel_device_info (line 169) | struct intel_device_info
type intel_device_info (line 177) | struct intel_device_info
type intel_device_info (line 183) | struct intel_device_info
type intel_device_info (line 191) | struct intel_device_info
type intel_device_info (line 197) | struct intel_device_info
type intel_device_info (line 205) | struct intel_device_info
type intel_device_info (line 218) | struct intel_device_info
type intel_device_info (line 223) | struct intel_device_info
type intel_device_info (line 228) | struct intel_device_info
type intel_device_info (line 239) | struct intel_device_info
type intel_device_info (line 244) | struct intel_device_info
type intel_device_info (line 249) | struct intel_device_info
type intel_device_info (line 254) | struct intel_device_info
type intel_device_info (line 258) | struct intel_device_info
type intel_device_info (line 271) | struct intel_device_info
type intel_device_info (line 276) | struct intel_device_info
type intel_device_info (line 281) | struct intel_device_info
type intel_device_info (line 286) | struct intel_device_info
type intel_device_info (line 291) | struct intel_device_info
type intel_device_info (line 304) | struct intel_device_info
type intel_device_info (line 309) | struct intel_device_info
type intel_device_info (line 314) | struct intel_device_info
type intel_device_info (line 319) | struct intel_device_info
type intel_device_info (line 324) | struct intel_device_info
type intel_device_info (line 337) | struct intel_device_info
type intel_device_info (line 342) | struct intel_device_info
type intel_device_info (line 347) | struct intel_device_info
type intel_device_info (line 358) | struct intel_device_info
type intel_device_info (line 363) | struct intel_device_info
type intel_device_info (line 368) | struct intel_device_info
type intel_device_info (line 375) | struct intel_device_info
type intel_device_info (line 382) | struct intel_device_info
type intel_device_info (line 389) | struct intel_device_info
type intel_device_info (line 396) | struct intel_device_info
type intel_device_info (line 404) | struct intel_device_info
type intel_device_info (line 412) | struct intel_device_info
type intel_device_info (line 419) | struct intel_device_info
type intel_device_info (line 427) | struct intel_device_info
type intel_device_info (line 437) | struct intel_device_info
type intel_device_info (line 444) | struct intel_device_info
type intel_device_info (line 451) | struct intel_device_info
type intel_device_info (line 458) | struct intel_device_info
type intel_device_info (line 465) | struct intel_device_info
type intel_device_info (line 475) | struct intel_device_info
type intel_device_info (line 485) | struct intel_device_info
type intel_device_info (line 492) | struct intel_device_info
type intel_device_info (line 503) | struct intel_device_info
type pci_id_match (line 513) | struct pci_id_match
type intel_device_info (line 633) | struct intel_device_info
type intel_device_info (line 635) | struct intel_device_info
FILE: src/linux/intel_gpu_top/intel_gpu_top.c
function igt_sysfs_scanf (line 53) | __attribute__((format(scanf,3,4)))
function pmu_parse (line 80) | static int pmu_parse(struct pmu_counter *pmu, const char *path, const ch...
function rapl_parse (line 121) | static int rapl_parse(struct pmu_counter *pmu, const char *str)
function rapl_open (line 139) | static void
function gpu_power_open (line 160) | static void gpu_power_open(struct pmu_counter *pmu,
function pkg_power_open (line 166) | static void pkg_power_open(struct pmu_counter *pmu,
function get_pmu_config (line 172) | static uint64_t
function engine_cmp (line 236) | static int engine_cmp(const void *__a, const void *__b)
type engines (line 249) | struct engines
type engines (line 252) | struct engines
type dirent (line 253) | struct dirent
type engines (line 260) | struct engines
type engine (line 277) | struct engine
type engines (line 344) | struct engines
type engine (line 345) | struct engine
type engine (line 360) | struct engine
function free_engines (line 372) | void free_engines(struct engines *engines)
function imc_parse (line 420) | static int imc_parse(struct pmu_counter *pmu, const char *str)
function imc_open (line 425) | static void
function imc_writes_open (line 446) | static void imc_writes_open(struct pmu_counter *pmu, struct engines *eng...
function imc_reads_open (line 451) | static void imc_reads_open(struct pmu_counter *pmu, struct engines *engi...
function get_num_gts (line 456) | static int get_num_gts(uint64_t type)
function init_aggregate_counters (line 475) | static void init_aggregate_counters(struct engines *engines)
function pmu_init (line 495) | int pmu_init(struct engines *engines)
function pmu_read_multi (line 563) | static uint64_t pmu_read_multi(int fd, unsigned int num, uint64_t *val)
function pmu_calc (line 580) | double pmu_calc(struct pmu_pair *p, double d, double t, double s)
function __update_sample (line 595) | static void __update_sample(struct pmu_counter *counter, uint64_t val)
function update_sample (line 601) | static void update_sample(struct pmu_counter *counter, uint64_t *val)
function pmu_sample (line 607) | void pmu_sample(struct engines *engines)
FILE: src/linux/intel_gpu_top/intel_gpu_top.h
type pmu_pair (line 8) | struct pmu_pair {
type pmu_counter (line 13) | struct pmu_counter {
type engine_class (line 23) | struct engine_class {
type engine (line 29) | struct engine {
type engines (line 45) | struct engines {
type engines (line 85) | struct engines
type engines (line 86) | struct engines
type engines (line 87) | struct engines
type engines (line 88) | struct engines
type pmu_pair (line 89) | struct pmu_pair
FILE: src/linux/intel_gpu_top/intel_name_lookup_shim.c
type dirent (line 18) | struct dirent
type intel_device_info (line 85) | struct intel_device_info
FILE: src/main.cpp
function main (line 10) | auto main(int argc, const char* argv[]) -> int {
FILE: src/netbsd/btop_collect.cpp
type Cpu (line 86) | namespace Cpu {
type Sensor (line 103) | struct Sensor {
function string (line 211) | string get_cpuName() {
function get_sensors (line 222) | bool get_sensors() {
function update_sensors (line 280) | void update_sensors() {
function string (line 372) | string get_cpuHz() {
function get_core_mapping (line 382) | auto get_core_mapping() -> std::unordered_map<int, int> {
function get_battery (line 425) | auto get_battery() -> tuple<int, float, long, string> {
function collect (line 533) | auto collect(bool no_update) -> cpu_info & {
type Mem (line 116) | namespace Mem {
function get_totalMem (line 637) | uint64_t get_totalMem() {
function assign_values (line 641) | void assign_values(struct disk_info& disk, int64_t readBytes, int64_t ...
function collect_disk (line 667) | void collect_disk(std::unordered_map<string, disk_info> &disks, std::u...
function collect (line 702) | auto collect(bool no_update) -> mem_info & {
type Shared (line 120) | namespace Shared {
function init (line 129) | void init() {
type Cpu (line 194) | namespace Cpu {
type Sensor (line 103) | struct Sensor {
function string (line 211) | string get_cpuName() {
function get_sensors (line 222) | bool get_sensors() {
function update_sensors (line 280) | void update_sensors() {
function string (line 372) | string get_cpuHz() {
function get_core_mapping (line 382) | auto get_core_mapping() -> std::unordered_map<int, int> {
function get_battery (line 425) | auto get_battery() -> tuple<int, float, long, string> {
function collect (line 533) | auto collect(bool no_update) -> cpu_info & {
type Mem (line 628) | namespace Mem {
function get_totalMem (line 637) | uint64_t get_totalMem() {
function assign_values (line 641) | void assign_values(struct disk_info& disk, int64_t readBytes, int64_t ...
function collect_disk (line 667) | void collect_disk(std::unordered_map<string, disk_info> &disks, std::u...
function collect (line 702) | auto collect(bool no_update) -> mem_info & {
type Net (line 875) | namespace Net {
function collect (line 886) | auto collect(bool no_update) -> net_info & {
type Proc (line 1091) | namespace Proc {
function string (line 1111) | string get_status(char s) {
function _collect_details (line 1121) | void _collect_details(const size_t pid, vector<proc_info> &procs) {
function collect (line 1166) | auto collect(bool no_update) -> vector<proc_info> & {
type Tools (line 1410) | namespace Tools {
function system_uptime (line 1411) | double system_uptime() {
FILE: src/openbsd/btop_collect.cpp
type Cpu (line 84) | namespace Cpu {
type Sensor (line 101) | struct Sensor {
function string (line 210) | string get_cpuName() {
function get_sensor (line 221) | int64_t get_sensor(string device, vector<sensor_type> types, int num) {
function get_sensors (line 255) | bool get_sensors() {
function update_sensors (line 270) | void update_sensors() {
function string (line 292) | string get_cpuHz() {
function get_core_mapping (line 302) | auto get_core_mapping() -> std::unordered_map<int, int> {
function get_battery (line 345) | auto get_battery() -> tuple<int, float, long, string> {
function collect (line 386) | auto collect(bool no_update) -> cpu_info & {
type Mem (line 114) | namespace Mem {
function get_totalMem (line 496) | uint64_t get_totalMem() {
function assign_values (line 500) | void assign_values(struct disk_info& disk, int64_t readBytes, int64_t ...
function collect_disk (line 526) | void collect_disk(std::unordered_map<string, disk_info> &disks, std::u...
function collect (line 559) | auto collect(bool no_update) -> mem_info & {
type Shared (line 118) | namespace Shared {
function init (line 126) | void init() {
type Cpu (line 193) | namespace Cpu {
type Sensor (line 101) | struct Sensor {
function string (line 210) | string get_cpuName() {
function get_sensor (line 221) | int64_t get_sensor(string device, vector<sensor_type> types, int num) {
function get_sensors (line 255) | bool get_sensors() {
function update_sensors (line 270) | void update_sensors() {
function string (line 292) | string get_cpuHz() {
function get_core_mapping (line 302) | auto get_core_mapping() -> std::unordered_map<int, int> {
function get_battery (line 345) | auto get_battery() -> tuple<int, float, long, string> {
function collect (line 386) | auto collect(bool no_update) -> cpu_info & {
type Mem (line 487) | namespace Mem {
function get_totalMem (line 496) | uint64_t get_totalMem() {
function assign_values (line 500) | void assign_values(struct disk_info& disk, int64_t readBytes, int64_t ...
function collect_disk (line 526) | void collect_disk(std::unordered_map<string, disk_info> &disks, std::u...
function collect (line 559) | auto collect(bool no_update) -> mem_info & {
type Net (line 740) | namespace Net {
function collect (line 751) | auto collect(bool no_update) -> net_info & {
type Proc (line 956) | namespace Proc {
function string (line 976) | string get_status(char s) {
function _collect_details (line 986) | void _collect_details(const size_t pid, vector<proc_info> &procs) {
function collect (line 1031) | auto collect(bool no_update) -> vector<proc_info> & {
type Tools (line 1287) | namespace Tools {
function system_uptime (line 1288) | double system_uptime() {
FILE: src/openbsd/internal.h
type sysctls (line 17) | struct sysctls {
FILE: src/openbsd/sysctlbyname.cpp
function sysctlbyname (line 27) | int
FILE: src/osx/btop_collect.cpp
type IOReportSubscription (line 77) | struct IOReportSubscription
type __IOHIDEvent (line 97) | struct __IOHIDEvent
type __IOHIDServiceClient (line 98) | struct __IOHIDServiceClient
type __IOHIDEventSystemClient (line 99) | struct __IOHIDEventSystemClient
type CFRef (line 126) | struct CFRef {
method CFRef (line 128) | CFRef() : ref(nullptr) {}
method CFRef (line 129) | CFRef(T ref) : ref(ref) {}
method CFRef (line 131) | CFRef(const CFRef&) = delete;
method CFRef (line 132) | CFRef& operator=(const CFRef&) = delete;
method CFRef (line 133) | CFRef(CFRef&& other) noexcept : ref(other.ref) { other.ref = nullptr; }
method CFRef (line 134) | CFRef& operator=(CFRef&& other) noexcept {
method T (line 139) | T get() const { return ref; }
method T (line 140) | T* ptr() { return &ref; }
method reset (line 141) | void reset(T new_ref = nullptr) {
method T (line 145) | T release() { T r = ref; ref = nullptr; return r; }
type IORef (line 149) | struct IORef {
method IORef (line 151) | IORef() : ref(0) {}
method IORef (line 152) | IORef(io_object_t ref) : ref(ref) {}
method IORef (line 154) | IORef(const IORef&) = delete;
method IORef (line 155) | IORef& operator=(const IORef&) = delete;
method io_object_t (line 157) | io_object_t get() const { return ref; }
method io_object_t (line 158) | io_object_t* ptr() { return &ref; }
type Cpu (line 163) | namespace Cpu {
type Sensor (line 181) | struct Sensor {
function string (line 757) | string get_cpuName() {
function get_sensors (line 768) | bool get_sensors() {
function update_sensors (line 814) | void update_sensors() {
function string (line 845) | string get_cpuHz() {
function get_core_mapping (line 858) | auto get_core_mapping() -> std::unordered_map<int, int> {
class IOPSInfo_Wrap (line 911) | class IOPSInfo_Wrap {
method IOPSInfo_Wrap (line 914) | IOPSInfo_Wrap() { data = IOPSCopyPowerSourcesInfo(); }
method CFTypeRef (line 915) | CFTypeRef& operator()() { return data; }
class IOPSList_Wrap (line 919) | class IOPSList_Wrap {
method IOPSList_Wrap (line 922) | IOPSList_Wrap(CFTypeRef cft_ref) { data = IOPSCopyPowerSourcesList(c...
method CFArrayRef (line 923) | CFArrayRef& operator()() { return data; }
function get_battery (line 927) | auto get_battery() -> tuple<int, float, long, string> {
function collect (line 970) | auto collect(bool no_update) -> cpu_info & {
type Mem (line 194) | namespace Mem {
function get_totalMem (line 1081) | uint64_t get_totalMem() {
function getCFNumber (line 1085) | int64_t getCFNumber(CFDictionaryRef dict, const void *key) {
function string (line 1095) | string getCFString(io_registry_entry_t volumeRef, CFStringRef key) {
function isWhole (line 1106) | bool isWhole(io_registry_entry_t volumeRef) {
class IOObject (line 1113) | class IOObject {
method IOObject (line 1115) | IOObject(string name, io_object_t& obj) : name(name), object(obj) {}
function collect_disk (line 1122) | void collect_disk(std::unordered_map<string, disk_info> &disks, std::u...
function collect (line 1191) | auto collect(bool no_update) -> mem_info & {
type Gpu (line 199) | namespace Gpu {
type Nvml (line 203) | namespace Nvml { bool shutdown() { return false; } }
function shutdown (line 203) | bool shutdown() { return false; }
type Rsmi (line 204) | namespace Rsmi { bool shutdown() { return false; } }
function shutdown (line 204) | bool shutdown() { return false; }
type AppleSilicon (line 207) | namespace AppleSilicon {
function string (line 224) | static string cfstring_to_string(CFStringRef cfstr) {
function string (line 232) | static string get_chip_name() {
function get_mach_time_ms (line 240) | static uint64_t get_mach_time_ms() {
function get_gpu_freqs_from_pmgr (line 247) | static void get_gpu_freqs_from_pmgr() {
function init (line 279) | bool init() {
function shutdown (line 333) | bool shutdown() {
function get_gpu_temp_iohid (line 343) | static long long get_gpu_temp_iohid() {
function collect (line 396) | bool collect(gpu_info* gpus_slice) {
function collect (line 585) | auto collect(bool no_update) -> vector<gpu_info>& {
class MachProcessorInfo (line 634) | class MachProcessorInfo {
method MachProcessorInfo (line 638) | MachProcessorInfo() {}
type Shared (line 642) | namespace Shared {
function init (line 650) | void init() {
type Cpu (line 739) | namespace Cpu {
type Sensor (line 181) | struct Sensor {
function string (line 757) | string get_cpuName() {
function get_sensors (line 768) | bool get_sensors() {
function update_sensors (line 814) | void update_sensors() {
function string (line 845) | string get_cpuHz() {
function get_core_mapping (line 858) | auto get_core_mapping() -> std::unordered_map<int, int> {
class IOPSInfo_Wrap (line 911) | class IOPSInfo_Wrap {
method IOPSInfo_Wrap (line 914) | IOPSInfo_Wrap() { data = IOPSCopyPowerSourcesInfo(); }
method CFTypeRef (line 915) | CFTypeRef& operator()() { return data; }
class IOPSList_Wrap (line 919) | class IOPSList_Wrap {
method IOPSList_Wrap (line 922) | IOPSList_Wrap(CFTypeRef cft_ref) { data = IOPSCopyPowerSourcesList(c...
method CFArrayRef (line 923) | CFArrayRef& operator()() { return data; }
function get_battery (line 927) | auto get_battery() -> tuple<int, float, long, string> {
function collect (line 970) | auto collect(bool no_update) -> cpu_info & {
type Mem (line 1070) | namespace Mem {
function get_totalMem (line 1081) | uint64_t get_totalMem() {
function getCFNumber (line 1085) | int64_t getCFNumber(CFDictionaryRef dict, const void *key) {
function string (line 1095) | string getCFString(io_registry_entry_t volumeRef, CFStringRef key) {
function isWhole (line 1106) | bool isWhole(io_registry_entry_t volumeRef) {
class IOObject (line 1113) | class IOObject {
method IOObject (line 1115) | IOObject(string name, io_object_t& obj) : name(name), object(obj) {}
function collect_disk (line 1122) | void collect_disk(std::unordered_map<string, disk_info> &disks, std::u...
function collect (line 1191) | auto collect(bool no_update) -> mem_info & {
type Net (line 1354) | namespace Net {
class getifaddr_wrapper (line 1366) | class getifaddr_wrapper {
type ifaddrs (line 1367) | struct ifaddrs
method getifaddr_wrapper (line 1371) | getifaddr_wrapper() { status = getifaddrs(&ifaddr); }
type ifaddrs (line 1373) | struct ifaddrs
function collect (line 1376) | auto collect(bool no_update) -> net_info & {
type Proc (line 1581) | namespace Proc {
function string (line 1601) | string get_status(char s) {
function _collect_details (line 1611) | void _collect_details(const size_t pid, vector<proc_info> &procs) {
function collect (line 1663) | auto collect(bool no_update) -> vector<proc_info> & {
type Tools (line 1970) | namespace Tools {
function system_uptime (line 1971) | double system_uptime() {
FILE: src/osx/sensors.cpp
type __IOHIDEvent (line 31) | struct __IOHIDEvent
type __IOHIDServiceClient (line 32) | struct __IOHIDServiceClient
function CFDictionaryRef (line 50) | CFDictionaryRef matching(int page, int usage) {
function getValue (line 65) | double getValue(IOHIDServiceClientRef sc) {
FILE: src/osx/sensors.hpp
type Cpu (line 21) | namespace Cpu {
class ThermalSensors (line 22) | class ThermalSensors {
FILE: src/osx/smc.cpp
function UInt32 (line 24) | static UInt32 _strtoul(char *str, int size, int base) {
function _ultostr (line 38) | static void _ultostr(char *str, UInt32 val) {
type Cpu (line 47) | namespace Cpu {
function kern_return_t (line 110) | kern_return_t SMCConnection::SMCReadKey(UInt32Char_t key, SMCVal_t *va...
function kern_return_t (line 140) | kern_return_t SMCConnection::SMCCall(int index, SMCKeyData_t *inputStr...
FILE: src/osx/smc.hpp
type Cpu (line 98) | namespace Cpu {
class SMCConnection (line 99) | class SMCConnection {
FILE: tests/tools.cpp
function TEST (line 9) | TEST(tools, string_split) {
Condensed preview — 138 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,997K chars).
[
{
"path": ".editorconfig",
"chars": 145,
"preview": "[*.{cpp,h,hpp,sh,md,cfg,sample}]\nindent_style = tab\nindent_size = 4\nbrace_style = same_line\n\n[*.{yml,yaml}]\nindent_style"
},
{
"path": ".github/FUNDING.yml",
"chars": 579,
"preview": "# These are supported funding model platforms\n\ngithub: aristocratos\npatreon: # Replace with a single Patreon username\nop"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 1718,
"preview": "---\nname: Bug report\nabout: Create a report to help us improve\nlabels: bug\n\n---\n\n**Read the README.md and search for sim"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 616,
"preview": "---\nname: Feature request\nabout: Suggest an idea for this project\nlabels: feature\n\n---\n\n**Is your feature request relate"
},
{
"path": ".github/renovate.json5",
"chars": 107,
"preview": "{\n $schema: \"https://docs.renovatebot.com/renovate-schema.json\",\n extends: [\"config:recommended\"],\n}\n"
},
{
"path": ".github/workflows/cmake-freebsd.yml",
"chars": 1262,
"preview": "name: FreeBSD CMake\n\non:\n workflow_dispatch:\n push:\n branches: main\n tags-ignore: '*.*'\n paths:\n - '.git"
},
{
"path": ".github/workflows/cmake-linux.yml",
"chars": 1860,
"preview": "name: Linux CMake\n\non:\n workflow_dispatch:\n push:\n branches: main\n tags-ignore: '*.*'\n paths:\n - '.githu"
},
{
"path": ".github/workflows/cmake-macos.yml",
"chars": 1446,
"preview": "name: macOS CMake\n\non:\n workflow_dispatch:\n push:\n branches: main\n tags-ignore: '*.*'\n paths:\n - '.githu"
},
{
"path": ".github/workflows/cmake-netbsd.yml",
"chars": 1545,
"preview": "name: NetBSD CMake\n\non:\n workflow_dispatch:\n push:\n branches: main\n tags-ignore: '*.*'\n paths:\n - '.gith"
},
{
"path": ".github/workflows/cmake-openbsd.yml",
"chars": 1246,
"preview": "name: OpenBSD CMake\n\non:\n workflow_dispatch:\n push:\n branches: main\n tags-ignore: '*.*'\n paths:\n - '.git"
},
{
"path": ".github/workflows/continuous-build-freebsd.yml",
"chars": 1652,
"preview": "name: Continuous Build FreeBSD\n\non:\n workflow_dispatch:\n push:\n branches:\n - main\n tags-ignore:\n - '*."
},
{
"path": ".github/workflows/continuous-build-gpu.yml",
"chars": 1034,
"preview": "name: Continuous Build Gpu\n\non:\n workflow_dispatch:\n push:\n branches:\n - main\n tags-ignore:\n - '*.*'\n "
},
{
"path": ".github/workflows/continuous-build-linux.yml",
"chars": 2885,
"preview": "name: Continuous Build Linux\n\non:\n workflow_dispatch:\n push:\n branches: main\n tags-ignore: '*.*'\n paths:\n "
},
{
"path": ".github/workflows/continuous-build-macos.yml",
"chars": 1625,
"preview": "name: Continuous Build MacOS\n\non:\n workflow_dispatch:\n push:\n branches:\n - main\n tags-ignore:\n - '*.*'"
},
{
"path": ".github/workflows/continuous-build-netbsd.yml",
"chars": 1671,
"preview": "name: Continuous Build NetBSD\n\non:\n workflow_dispatch:\n push:\n branches:\n - main\n tags-ignore:\n - '*.*"
},
{
"path": ".github/workflows/continuous-build-openbsd.yml",
"chars": 1319,
"preview": "name: Continuous Build OpenBSD\n\non:\n workflow_dispatch:\n push:\n branches:\n - main\n tags-ignore:\n - '*."
},
{
"path": ".github/workflows/test-snap-can-build.yml",
"chars": 1008,
"preview": "name: 🧪 Test snap can be built on x86_64\non:\n workflow_dispatch:\n push:\n branches: [ main ]\n tags-ignore:\n - "
},
{
"path": ".gitignore",
"chars": 1127,
"preview": "# gitginore template for creating Snap packages\n# website: https://snapcraft.io/\n\nparts/\nprime/\nstage/\n*.snap\n\n# Snapcra"
},
{
"path": "CHANGELOG.md",
"chars": 23021,
"preview": "## v1.4.6\n\nReferences | Description | Author(s)\n--- | --- | ---\n#1272 | Skip 'H' and 'HX' suffix in AMD cpu name trimmin"
},
{
"path": "CMakeLists.txt",
"chars": 9329,
"preview": "# SPDX-License-Identifier: Apache-2.0\n#\n# CMake configuration for btop\n#\n\ncmake_minimum_required(VERSION 3.25)\n\n# Disabl"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 8758,
"preview": "\n# Contributor Covenant 3.0\n\n## Our Pledge\n\nWe pledge to make our community welcoming, safe, and equitable for all.\n\nWe "
},
{
"path": "CONTRIBUTING.md",
"chars": 2332,
"preview": "# Contributing guidelines\n\n## When submitting pull requests\n\n* Explain your thinking in why a change or addition is need"
},
{
"path": "LICENSE",
"chars": 11358,
"preview": "\n Apache License\n Version 2.0, January 2004\n "
},
{
"path": "README.md",
"chars": 52122,
"preview": "# \n\n<a href=\"https://repology.org/project/btop/versions\">\n <img src=\"https://repology.org/badg"
},
{
"path": "btop.desktop",
"chars": 720,
"preview": "[Desktop Entry]\nType=Application\nVersion=1.0\nName=btop++\nGenericName=System Monitor\nGenericName[it]=Monitor di sistema\nG"
},
{
"path": "cmake/Finddevstat.cmake",
"chars": 752,
"preview": "# SPDX-License-Identifier: Apache-2.0\n#\n# Find devstat, the Device Statistics Library\n#\n\nif(CMAKE_SYSTEM_NAME STREQUAL \""
},
{
"path": "cmake/Findelf.cmake",
"chars": 675,
"preview": "# SPDX-License-Identifier: Apache-2.0\n#\n# Find libelf, the ELF Access Library\n#\n\nif(CMAKE_SYSTEM_NAME STREQUAL \"FreeBSD\""
},
{
"path": "cmake/Findkvm.cmake",
"chars": 603,
"preview": "# SPDX-License-Identifier: Apache-2.0\n#\n# Find libkvm, the Kernel Data Access Library\n#\n\nif(BSD)\n find_path(kvm_INCLUDE"
},
{
"path": "cmake/Findproplib.cmake",
"chars": 690,
"preview": "# SPDX-License-Identifier: Apache-2.0\n#\n# Find proplib – property container object library\n#\n\nif(BSD)\n find_path(propli"
},
{
"path": "include/fmt/LICENSE.rst",
"chars": 1431,
"preview": "Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors\n\nPermission is hereby granted, free of charge, to "
},
{
"path": "include/fmt/args.h",
"chars": 7199,
"preview": "// Formatting library for C++ - dynamic argument lists\n//\n// Copyright (c) 2012 - present, Victor Zverovich\n// All right"
},
{
"path": "include/fmt/base.h",
"chars": 104564,
"preview": "// Formatting library for C++ - the base API for char/UTF-8\n//\n// Copyright (c) 2012 - present, Victor Zverovich\n// All "
},
{
"path": "include/fmt/chrono.h",
"chars": 77378,
"preview": "// Formatting library for C++ - chrono support\n//\n// Copyright (c) 2012 - present, Victor Zverovich\n// All rights reserv"
},
{
"path": "include/fmt/color.h",
"chars": 23908,
"preview": "// Formatting library for C++ - color support\n//\n// Copyright (c) 2018 - present, Victor Zverovich and fmt contributors\n"
},
{
"path": "include/fmt/compile.h",
"chars": 20471,
"preview": "// Formatting library for C++ - experimental format string compilation\n//\n// Copyright (c) 2012 - present, Victor Zverov"
},
{
"path": "include/fmt/core.h",
"chars": 187,
"preview": "// This file is only provided for compatibility and may be removed in future\n// versions. Use fmt/base.h if you don't ne"
},
{
"path": "include/fmt/format-inl.h",
"chars": 81206,
"preview": "// Formatting library for C++ - implementation\n//\n// Copyright (c) 2012 - 2016, Victor Zverovich\n// All rights reserved."
},
{
"path": "include/fmt/format.h",
"chars": 162378,
"preview": "/*\n Formatting library for C++\n\n Copyright (c) 2012 - present, Victor Zverovich\n\n Permission is hereby granted, free "
},
{
"path": "include/fmt/os.h",
"chars": 12819,
"preview": "// Formatting library for C++ - optional OS-specific functionality\n//\n// Copyright (c) 2012 - present, Victor Zverovich\n"
},
{
"path": "include/fmt/ostream.h",
"chars": 5027,
"preview": "// Formatting library for C++ - std::ostream support\n//\n// Copyright (c) 2012 - present, Victor Zverovich\n// All rights "
},
{
"path": "include/fmt/printf.h",
"chars": 19991,
"preview": "// Formatting library for C++ - legacy printf implementation\n//\n// Copyright (c) 2012 - 2016, Victor Zverovich\n// All ri"
},
{
"path": "include/fmt/ranges.h",
"chars": 28166,
"preview": "// Formatting library for C++ - range and tuple support\n//\n// Copyright (c) 2012 - present, Victor Zverovich and {fmt} c"
},
{
"path": "include/fmt/std.h",
"chars": 22417,
"preview": "// Formatting library for C++ - formatters for standard library types\n//\n// Copyright (c) 2012 - present, Victor Zverovi"
},
{
"path": "include/fmt/xchar.h",
"chars": 13098,
"preview": "// Formatting library for C++ - optional wchar_t and exotic character support\n//\n// Copyright (c) 2012 - present, Victor"
},
{
"path": "include/widechar_width.hpp",
"chars": 38717,
"preview": "/**\n * widechar_width.h for Unicode 17.0.0\n * See https://github.com/ridiculousfish/widecharwidth/\n *\n * SHA1 file hashe"
},
{
"path": "manpage.md",
"chars": 1824,
"preview": "% btop(1) | User Commands\n%\n% 2025-05-01\n\n# NAME\n\nbtop - Resource monitor that shows usage and stats for processor, memo"
},
{
"path": "snap/snapcraft.yaml",
"chars": 1419,
"preview": "name: btop\nadopt-info: btop\nsummary: Resource monitor that shows usage and stats\ndescription: |\n Resource monitor that "
},
{
"path": "src/btop.cpp",
"chars": 35533,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/btop.hpp",
"chars": 117,
"preview": "#include <span>\n#include <string_view>\n\n[[nodiscard]] auto btop_main(std::span<const std::string_view> args) -> int;\n"
},
{
"path": "src/btop_cli.cpp",
"chars": 8038,
"preview": "// SPDX-License-Identifier: Apache-2.0\n\n#include \"btop_cli.hpp\"\n\n#include <algorithm>\n#include <expected>\n#include <file"
},
{
"path": "src/btop_cli.hpp",
"chars": 1453,
"preview": "// SPDX-License-Identifier: Apache-2.0\n\n#pragma once\n\n#include <cstdint>\n#include <expected>\n#include <filesystem>\n#incl"
},
{
"path": "src/btop_config.cpp",
"chars": 31623,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/btop_config.hpp",
"chars": 4629,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/btop_draw.cpp",
"chars": 108839,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/btop_draw.hpp",
"chars": 3981,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/btop_input.cpp",
"chars": 20757,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/btop_input.hpp",
"chars": 1963,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/btop_log.cpp",
"chars": 3722,
"preview": "// SPDX-License-Identifier: Apache-2.0\n\n#include \"btop_log.hpp\"\n\n#include \"btop_shared.hpp\"\n\n#include <algorithm>\n#inclu"
},
{
"path": "src/btop_log.hpp",
"chars": 1868,
"preview": "// SPDX-License-Identifier: Apache-2.0\n\n#pragma once\n\n#include <cstdint>\n#include <filesystem>\n#include <string>\n#includ"
},
{
"path": "src/btop_menu.cpp",
"chars": 60163,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/btop_menu.hpp",
"chars": 2402,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/btop_shared.cpp",
"chars": 10930,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/btop_shared.hpp",
"chars": 13009,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/btop_theme.cpp",
"chars": 14754,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/btop_theme.hpp",
"chars": 2571,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/btop_tools.cpp",
"chars": 17937,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/btop_tools.hpp",
"chars": 15857,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/config.h.in",
"chars": 341,
"preview": "// SPDX-License-Identifier: Apache-2.0\n\n#pragma once\n\n#include <string_view>\n\nconstexpr std::string_view GIT_COMMIT "
},
{
"path": "src/freebsd/btop_collect.cpp",
"chars": 46414,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/linux/btop_collect.cpp",
"chars": 118482,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/linux/intel_gpu_top/CMakeLists.txt",
"chars": 419,
"preview": "enable_language(C)\n\nadd_library(igt OBJECT\n igt_perf.c\n intel_device_info.c\n intel_gpu_top.c\n intel_name_lookup_shim"
},
{
"path": "src/linux/intel_gpu_top/drm.h",
"chars": 41996,
"preview": "/*\n * Header for the Direct Rendering Manager\n *\n * Author: Rickard E. (Rik) Faith <faith@valinux.com>\n *\n * Acknowledgm"
},
{
"path": "src/linux/intel_gpu_top/drm_mode.h",
"chars": 40018,
"preview": "/*\n * Copyright (c) 2007 Dave Airlie <airlied@linux.ie>\n * Copyright (c) 2007 Jakob Bornecrantz <wallbraker@gmail.com>\n "
},
{
"path": "src/linux/intel_gpu_top/i915_drm.h",
"chars": 130039,
"preview": "/*\n * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.\n * All Rights Reserved.\n *\n * Permission is hereby gran"
},
{
"path": "src/linux/intel_gpu_top/i915_pciids.h",
"chars": 27700,
"preview": "/*\n * Copyright 2013 Intel Corporation\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to an"
},
{
"path": "src/linux/intel_gpu_top/i915_pciids_local.h",
"chars": 1670,
"preview": "/* SPDX-License-Identifier: MIT */\n/*\n * Copyright © 2022 Intel Corporation\n */\n#ifndef _I915_PCIIDS_LOCAL_H_\n#define _I"
},
{
"path": "src/linux/intel_gpu_top/igt_perf.c",
"chars": 4202,
"preview": "#include <errno.h>\n#include <fcntl.h>\n#include <limits.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n#i"
},
{
"path": "src/linux/intel_gpu_top/igt_perf.h",
"chars": 2400,
"preview": "/*\n * Copyright © 2017 Intel Corporation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n "
},
{
"path": "src/linux/intel_gpu_top/intel_chipset.h",
"chars": 8281,
"preview": "/*\n * Copyright © 2007 Intel Corporation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n "
},
{
"path": "src/linux/intel_gpu_top/intel_device_info.c",
"chars": 16600,
"preview": "#include \"intel_chipset.h\"\n#include \"i915_pciids.h\"\n#include \"i915_pciids_local.h\"\n#include \"xe_pciids.h\"\n\n#include <str"
},
{
"path": "src/linux/intel_gpu_top/intel_gpu_top.c",
"chars": 14920,
"preview": "/*\n * Copyright © 2007-2023 Intel Corporation\n *\n * Permission is hereby granted, free of charge, to any person obtainin"
},
{
"path": "src/linux/intel_gpu_top/intel_gpu_top.h",
"chars": 1854,
"preview": "#ifndef INTEL_GPU_TOP_H\n#define INTEL_GPU_TOP_H\n\n#include <stdbool.h>\n#include <stdint.h>\n#include <dirent.h>\n\nstruct pm"
},
{
"path": "src/linux/intel_gpu_top/intel_name_lookup_shim.c",
"chars": 2863,
"preview": "#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <dirent.h>\n#include <unistd.h>\n#include <ctype.h>\n\n#"
},
{
"path": "src/linux/intel_gpu_top/source.txt",
"chars": 93,
"preview": "0f02dc176959e6296866b1bafd3982e277a5e44b\nhttps://gitlab.freedesktop.org/drm/igt-gpu-tools.git"
},
{
"path": "src/linux/intel_gpu_top/xe_pciids.h",
"chars": 6420,
"preview": "/* SPDX-License-Identifier: MIT */\n/*\n * Copyright © 2022 Intel Corporation\n */\n\n#ifndef _XE_PCIIDS_H_\n#define _XE_PCIID"
},
{
"path": "src/main.cpp",
"chars": 310,
"preview": "// SPDX-License-Identifier: Apache-2.0\n\n#include \"btop.hpp\"\n\n#include <iterator>\n#include <ranges>\n#include <string_view"
},
{
"path": "src/netbsd/btop_collect.cpp",
"chars": 46398,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n Copyright 2024 Santhosh Raju (fox@NetBSD.org)\n\n Licensed under "
},
{
"path": "src/openbsd/btop_collect.cpp",
"chars": 42839,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/openbsd/internal.h",
"chars": 7500,
"preview": "/*\n * Copyright (c) 2019-2021 Brian Callahan <bcallah@openbsd.org>\n *\n * Permission to use, copy, modify, and distribute"
},
{
"path": "src/openbsd/sysctlbyname.cpp",
"chars": 1384,
"preview": "/*\n * Copyright (c) 2019-2021 Brian Callahan <bcallah@openbsd.org>\n *\n * Permission to use, copy, modify, and distribute"
},
{
"path": "src/openbsd/sysctlbyname.h",
"chars": 917,
"preview": "/*\n * Copyright (c) 2019 Brian Callahan <bcallah@openbsd.org>\n *\n * Permission to use, copy, modify, and distribute this"
},
{
"path": "src/osx/btop_collect.cpp",
"chars": 71410,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/osx/sensors.cpp",
"chars": 4337,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/osx/sensors.hpp",
"chars": 812,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/osx/smc.cpp",
"chars": 4808,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "src/osx/smc.hpp",
"chars": 2686,
"preview": "/* Copyright 2021 Aristocratos (jakob@qvantnet.com)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "tests/CMakeLists.txt",
"chars": 544,
"preview": "# SPDX-License-Identifier: Apache-2.0\n\ninclude(FetchContent)\nFetchContent_Declare(\n googletest\n GIT_REPOSITORY https:/"
},
{
"path": "tests/tools.cpp",
"chars": 642,
"preview": "// SPDX-License-Identifier: Apache-2.0\n\n#include <vector>\n\n#include <gtest/gtest.h>\n\n#include \"btop_tools.hpp\"\n\nTEST(too"
},
{
"path": "themes/HotPurpleTrafficLight.theme",
"chars": 2367,
"preview": "#HotPurpleTrafficLight\n#by Pete Allebone - mess with the best... you know the rest. <catch me at: peter at allebone dot "
},
{
"path": "themes/adapta.theme",
"chars": 2216,
"preview": "#Bashtop Adapta theme\n#by olokelo\n\n# Colors should be in 6 or 2 character hexadecimal or single spaced rgb decimal: \"#RR"
},
{
"path": "themes/adwaita-dark.theme",
"chars": 1852,
"preview": "#Bashtop Adwaita Dark theme\n#by k0tran\n\n# Main background, empty for terminal default, need to be empty if you want tran"
},
{
"path": "themes/adwaita.theme",
"chars": 2249,
"preview": "#Bashtop Adwaita theme\n#by flipflop133\n\n# Colors should be in 6 or 2 character hexadecimal or single spaced rgb decimal:"
},
{
"path": "themes/ayu.theme",
"chars": 2150,
"preview": "# Main background, empty for terminal default, need to be empty if you want transparent background\ntheme[main_bg]=\"#0B0E"
},
{
"path": "themes/dracula.theme",
"chars": 2150,
"preview": "# Main background, empty for terminal default, need to be empty if you want transparent background\ntheme[main_bg]=\"#282a"
},
{
"path": "themes/dusklight.theme",
"chars": 2404,
"preview": "#Bpytop theme comprised of blues, oranges, cyan, and yellow.\n#by Drazil100\n\n# Colors should be in 6 or 2 character hexad"
},
{
"path": "themes/elementarish.theme",
"chars": 1793,
"preview": "# Theme: Elementarish\n# (inspired by Elementary OS)\n# By: Dennis Mayr\n\n# Main bg\ntheme[main_bg]=\"#333333\"\n\n# Main text c"
},
{
"path": "themes/everforest-dark-hard.theme",
"chars": 2268,
"preview": "# All graphs and meters can be gradients\n# For single color graphs leave \"mid\" and \"end\" variable empty.\n# Use \"start\" a"
},
{
"path": "themes/everforest-dark-medium.theme",
"chars": 2269,
"preview": "# All graphs and meters can be gradients\n# For single color graphs leave \"mid\" and \"end\" variable empty.\n# Use \"start\" a"
},
{
"path": "themes/everforest-light-medium.theme",
"chars": 2267,
"preview": "# All graphs and meters can be gradients\n# For single color graphs leave \"mid\" and \"end\" variable empty.\n# Use \"start\" a"
},
{
"path": "themes/flat-remix-light.theme",
"chars": 2279,
"preview": "#Bashtop theme with flat-remix colors\n#by Daniel Ruiz de Alegría <daniel@drasite.com>\n\n# Colors should be in 6 or 2 char"
},
{
"path": "themes/flat-remix.theme",
"chars": 2268,
"preview": "#Bashtop theme with flat-remix colors\n#by Daniel Ruiz de Alegría <daniel@drasite.com>\n\n# Colors should be in 6 or 2 char"
},
{
"path": "themes/flexoki-dark.theme",
"chars": 2863,
"preview": "# Flexoki Dark theme (https://stephango.com/flexoki)\n# by Steph Ango\n\n# Colors should be in 6 or 2 character hexadecimal"
},
{
"path": "themes/flexoki-light.theme",
"chars": 2864,
"preview": "# Flexoki Light theme (https://stephango.com/flexoki)\n# by Steph Ango\n\n# Colors should be in 6 or 2 character hexadecima"
},
{
"path": "themes/gotham.theme",
"chars": 2412,
"preview": "# btop theme with the Gotham colorscheme for vim/neovim\n# Credit to Andrea Lopardi (https://github.com/whatyouhide/vim-g"
},
{
"path": "themes/greyscale.theme",
"chars": 2079,
"preview": "#Bashtop grayscale theme\n#by aristocratos\n\n# Colors should be in 6 or 2 character hexadecimal or single spaced rgb decim"
},
{
"path": "themes/gruvbox_dark.theme",
"chars": 2342,
"preview": "#Bashtop gruvbox (https://github.com/morhetz/gruvbox) theme\n#by BachoSeven\n\n# Colors should be in 6 or 2 character hexad"
},
{
"path": "themes/gruvbox_dark_v2.theme",
"chars": 2617,
"preview": "# Bashtop gruvbox (https://github.com/morhetz/gruvbox) theme\n# First version created By BachoSeven\n# Adjustments to prop"
},
{
"path": "themes/gruvbox_light.theme",
"chars": 2081,
"preview": "# Btop gruvbox_light theme\n# by kk9uk\n\n# Main background, empty for terminal default, need to be empty if you want trans"
},
{
"path": "themes/gruvbox_material_dark.theme",
"chars": 2313,
"preview": "# Btop gruvbox material dark (https://github.com/sainnhe/gruvbox-material) theme\n# by Marco Radocchia\n\n# Colors should b"
},
{
"path": "themes/horizon.theme",
"chars": 2116,
"preview": "# All graphs and meters can be gradients\n# For single color graphs leave \"mid\" and \"end\" variable empty.\n# Use \"start\" a"
},
{
"path": "themes/kanagawa-lotus.theme",
"chars": 1964,
"preview": "# Bashtop Kanagawa-lotus (https://github.com/rebelot/kanagawa.nvim) theme\n# By: philikarus\n\n# Main bg\ntheme[main_bg]=\"#F"
},
{
"path": "themes/kanagawa-wave.theme",
"chars": 1963,
"preview": "# Bashtop Kanagawa-wave (https://github.com/rebelot/kanagawa.nvim) theme\n# By: philikarus\n\n# Main bg\ntheme[main_bg]=\"#16"
},
{
"path": "themes/kyli0x.theme",
"chars": 2207,
"preview": "#Bashtop Kyli0x Theme\n#by Kyli0x <kyli0x@protonmail.ch>\n\n# Main background, empty for terminal default, need to be empty"
},
{
"path": "themes/matcha-dark-sea.theme",
"chars": 2379,
"preview": "#Bashtop matcha-dark-sea theme\n#by TheCynicalTeam\n\n# Colors should be in 6 or 2 character hexadecimal or single spaced r"
},
{
"path": "themes/monokai.theme",
"chars": 2376,
"preview": "#Bashtop monokai theme\n#by aristocratos\n\n# Colors should be in 6 or 2 character hexadecimal or single spaced rgb decimal"
},
{
"path": "themes/night-owl.theme",
"chars": 2318,
"preview": "#Bashtop theme with night-owl colors\n#by zkourouma\n\n# Colors should be in 6 or 2 character hexadecimal or single spaced "
},
{
"path": "themes/nord.theme",
"chars": 2312,
"preview": "#Bashtop theme with nord palette (https://www.nordtheme.com)\n#by Justin Zobel <justin.zobel@gmail.com>\n\n# Colors should "
},
{
"path": "themes/onedark.theme",
"chars": 1757,
"preview": "# Theme: OneDark\n# By: Vitor Melo\n\n# Main bg\ntheme[main_bg]=\"#282c34\"\n\n# Main text color\ntheme[main_fg]=\"#abb2bf\"\n\n# Tit"
},
{
"path": "themes/orange.theme",
"chars": 2041,
"preview": "# Btop orange theme\n# by neocerambyx\n\n# Main background, empty for terminal default, need to be empty if you want transp"
},
{
"path": "themes/paper.theme",
"chars": 1847,
"preview": "# Bashtop Paper theme\n# c/o @s6muel\n# inspired by @yorickpeterse's vim-paper theme at https://gitlab.com/yorickpeterse/v"
},
{
"path": "themes/phoenix-night.theme",
"chars": 2150,
"preview": "# Theme: Phoenix Night\n# By: Firehawke\n# A combination of:\n# Base theme colors from Pascal Jaeger's tokyo-night\n# Graph "
},
{
"path": "themes/solarized_dark.theme",
"chars": 2191,
"preview": "#Bashtop solarized theme\n#by aristocratos\n\n# Colors should be in 6 or 2 character hexadecimal or single spaced rgb decim"
},
{
"path": "themes/solarized_light.theme",
"chars": 2209,
"preview": "#solarized_light theme\n#modified from solarized_dark theme\n\n# Colors should be in 6 or 2 character hexadecimal or single"
},
{
"path": "themes/tokyo-night.theme",
"chars": 1764,
"preview": "# Theme: tokyo-night\n# By: Pascal Jaeger\n\n# Main bg\ntheme[main_bg]=\"#1a1b26\"\n\n# Main text color\ntheme[main_fg]=\"#cfc9c2\""
},
{
"path": "themes/tokyo-storm.theme",
"chars": 1764,
"preview": "# Theme: tokyo-storm\n# By: Pascal Jaeger\n\n# Main bg\ntheme[main_bg]=\"#24283b\"\n\n# Main text color\ntheme[main_fg]=\"#cfc9c2\""
},
{
"path": "themes/tomorrow-night.theme",
"chars": 2290,
"preview": "#Nord theme but using the Tomorrow Night palette\n#by Appuchia <contact@appu.ltd>\n\n# Colors should be in 6 or 2 character"
},
{
"path": "themes/twilight.theme",
"chars": 2516,
"preview": "# Main background, empty for terminal default, need to be empty if you want transparent background\ntheme[main_bg]=\"#1414"
},
{
"path": "themes/whiteout.theme",
"chars": 2228,
"preview": "#Bashtop \"whiteout\" theme\n#by aristocratos\n\n# Colors should be in 6 or 2 character hexadecimal or single spaced rgb deci"
}
]
About this extraction
This page contains the full source code of the aristocratos/btop GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 138 files (1.8 MB), approximately 554.9k tokens, and a symbol index with 1262 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.