MySQL 26.10.0
Source Code Documentation
system_info_linux_procfs.cc File Reference
#include "components/library_mysys/my_system_api/system_info_linux_procfs.h"
#include <algorithm>
#include <cctype>
#include <cerrno>
#include <charconv>
#include <filesystem>
#include <fstream>
#include <functional>
#include <limits>
#include <optional>
#include <sstream>
#include <string>
#include <system_error>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include "components/library_mysys/my_system_api/system_info_platform.h"
#include "components/library_mysys/my_system_api/system_info_utils.h"

Classes

struct  mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::Parsed_value
 
struct  mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::Parsed_text
 
struct  mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::Linux_block_metadata
 

Namespaces

namespace  mysql
 
namespace  mysql::system_info
 
namespace  mysql::system_info::internal
 
namespace  mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}
 

Functions

bool mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::convert_kibibytes (std::string_view text, uint64_t &bytes)
 
void mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::assign_value (Parsed_value &field, std::string_view text)
 
std::string_view mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::trim (std::string_view text)
 
void mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::assign_integer (Parsed_value &field, std::string_view text)
 
void mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::assign_text (Parsed_text &field, std::string_view text)
 
void mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::assign_status_memory (Parsed_value &field, std::string_view text)
 
std::error_code mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::invalid_input ()
 
bool mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::is_decimal (std::string_view value)
 
std::optional< std::string > mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::decode_mount_field (std::string_view field)
 Decode one escaped field from /proc/self/mountinfo. More...
 
bool mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::contains_path (std::string_view mount_point, std::string_view target_path)
 
bool mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::is_cpu_label (std::string_view label)
 
bool mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::parse_cpu_time (std::string_view text, uint64_t ticks_per_second, std::chrono::milliseconds &time)
 
bool mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::parse_unsigned (std::string_view text, uint64_t &value)
 
bool mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::parse_unsigned (std::string_view text, uint32_t &value)
 
Thread_state mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::thread_state (char state)
 
template<typename Value >
System_result< Value > mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::failed_result ()
 
std::error_code mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::storage_io_error ()
 
bool mysql::system_info::internal::valid_linux_storage_device_name (std::string_view name)
 Check that a Linux device name is one safe path component. More...
 
System_result< std::vector< Linux_block_device > > mysql::system_info::internal::read_linux_partitions (std::istream &input)
 Read the block device identity table from /proc/partitions. More...
 
System_result< Storage_device_capacity > mysql::system_info::internal::read_linux_storage_capacity (std::istream &size_input, std::istream &sector_size_input, std::string_view device)
 Read capacity metadata from /sys/class/block/<device>. More...
 
System_result< Storage_device_relationship > mysql::system_info::internal::linux_partition_relationship (std::string_view canonical_path, std::string_view device)
 Find the parent disk of a Linux partition from its canonical sysfs path. More...
 
System_result< std::string > mysql::system_info::internal::linux_storage_sector_size_path (std::string_view canonical_path, bool partition)
 Build the sysfs path for a device's hardware sector size. More...
 
Linux_diskstats_snapshot mysql::system_info::internal::read_linux_diskstats (std::istream &input, const std::unordered_set< std::string > &whole_devices)
 Read cumulative block I/O counters from /proc/diskstats. More...
 
Storage_snapshot mysql::system_info::internal::query_linux_storage_devices (const Linux_storage_paths &paths, const std::function< void()> &after_metadata)
 Assemble Linux storage metadata from procfs and sysfs. More...
 
System_result< Filesystem_identity > mysql::system_info::internal::read_linux_mount_info (std::istream &input, std::string_view device_id, std::string_view target_path)
 Find a filesystem in /proc/self/mountinfo. More...
 
Host_memory_snapshot mysql::system_info::internal::read_linux_meminfo (std::istream &input)
 Read labeled host memory values from /proc/meminfo. More...
 
System_result< Swap_activity_info > mysql::system_info::internal::read_linux_vmstat (std::istream &input)
 Read cumulative paging activity from /proc/vmstat. More...
 
Host_cpu_snapshot mysql::system_info::internal::read_linux_cpu_stat (std::istream &input, uint64_t ticks_per_second)
 Read CPU time rows from /proc/stat. More...
 
Process_memory_snapshot mysql::system_info::internal::read_linux_process_status (std::istream &input)
 Read process identity and memory from /proc/self/status. More...
 
Process_threads_snapshot mysql::system_info::internal::read_linux_thread_stat (std::istream &input, uint64_t expected_tid, uint64_t process_pid, uint64_t ticks_per_second, uint64_t page_size)
 Read one /proc/self/task/<tid>/stat record. More...
 
System_result< Thread_io_counters > mysql::system_info::internal::read_linux_thread_io (std::istream &input, uint64_t tid)
 Read /proc/self/task/<tid>/io. More...
 

Variables

constexpr uint64_t mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::k_bytes_per_kibibyte {1024}
 Linux metadata read by this implementation. More...
 
constexpr uint64_t mysql::system_info::internal::anonymous_namespace{system_info_linux_procfs.cc}::k_bytes_per_diskstats_sector {512}