MySQL 26.10.0
Source Code Documentation
system_info_macos.cc File Reference
#include "components/library_mysys/my_system_api/system_info_platform.h"
#include "components/library_mysys/my_system_api/system_info_macos.h"
#include "components/library_mysys/my_system_api/system_info_utils.h"
#include <libproc.h>
#include <mach/mach.h>
#include <mach/mach_error.h>
#include <sys/mount.h>
#include <sys/sysctl.h>
#include <unistd.h>
#include <algorithm>
#include <array>
#include <cerrno>
#include <cstdint>
#include <limits>
#include <string>
#include <system_error>
#include <utility>
#include <vector>

Classes

class  mysql::system_info::internal::anonymous_namespace{system_info_macos.cc}::Mach_error_category
 macOS metadata read by this implementation. More...
 

Namespaces

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

Functions

const std::error_category & mysql::system_info::internal::anonymous_namespace{system_info_macos.cc}::mach_category ()
 Return the shared error category used for Mach return codes. More...
 
System_result< Process_identity > mysql::system_info::internal::anonymous_namespace{system_info_macos.cc}::query_process_identity (pid_t pid)
 Read the process name returned by proc_name(). More...
 
bool mysql::system_info::internal::anonymous_namespace{system_info_macos.cc}::thread_disappeared (kern_return_t error)
 Return true when a Mach error can mean that an enumerated thread exited. More...
 
kern_return_t mysql::system_info::internal::anonymous_namespace{system_info_macos.cc}::deallocate_thread_port (void *, mach_port_t port)
 Release one thread send right returned by task_threads(). More...
 
kern_return_t mysql::system_info::internal::anonymous_namespace{system_info_macos.cc}::deallocate_thread_array (void *, vm_address_t address, vm_size_t size)
 Release the out of line thread array returned by task_threads(). More...
 
macOS_thread_deallocator mysql::system_info::internal::anonymous_namespace{system_info_macos.cc}::native_thread_deallocator ()
 Use the native Mach functions to release thread collection resources. More...
 
std::error_code mysql::system_info::internal::mach_error_code (int error)
 Convert a Mach return code to std::error_code. More...
 
Thread_state mysql::system_info::internal::macos_thread_state (int run_state)
 Map a native Mach thread state to the portable thread state. More...
 
bool mysql::system_info::internal::macos_time_value_to_milliseconds (int64_t seconds, int64_t microseconds, std::chrono::milliseconds &milliseconds)
 Convert a Mach time_value_t value to whole milliseconds. More...
 
std::string mysql::system_info::internal::copy_bounded_macos_thread_name (const char *name, size_t size)
 Copy a thread name from a fixed size native buffer. More...
 
std::error_code mysql::system_info::internal::map_macos_thread_samples (std::vector< macOS_thread_sample > samples, std::error_code disappearance_error, Thread_inventory &inventory, Thread_cpu_snapshot &cpu)
 Build matching thread inventory and CPU snapshots from native samples. More...
 
void mysql::system_info::internal::complete_macos_thread_collection (macOS_thread_resources &resources, std::error_code collection_error, Thread_inventory inventory, Thread_cpu_snapshot cpu, Process_threads_snapshot &result)
 Release native thread resources before publishing the collected snapshots. More...
 
Storage_snapshot mysql::system_info::internal::query_storage_devices_platform ()
 Collect Linux storage device metadata from procfs and sysfs. More...
 
Host_memory_snapshot mysql::system_info::internal::query_host_memory_platform ()
 Collect Linux host memory from procfs. More...
 
Host_cpu_snapshot mysql::system_info::internal::query_host_cpu_platform ()
 Collect cumulative Linux CPU times from /proc/stat. More...
 
Process_memory_snapshot mysql::system_info::internal::query_process_memory_platform ()
 Collect Linux process memory metadata. More...
 
Process_threads_snapshot mysql::system_info::internal::query_process_threads_platform ()
 Collect Linux thread metadata for the current process. More...
 

Variables

Filesystem_snapshot mysql::system_info::internal::query_filesystem_platform (std::string_view path)
 Collect Linux filesystem identity and space metadata for one path. More...