|
geopm 3.2.1.dev535+ga96c120fc
GEOPM - Global Extensible Open Power Manager
|
#include "geopm/Helper.hpp"#include <unistd.h>#include <dirent.h>#include <string.h>#include <errno.h>#include <stdlib.h>#include <sys/stat.h>#include <linux/capability.h>#include <sys/syscall.h>#include <climits>#include <cmath>#include <cinttypes>#include <fstream>#include <sstream>#include <algorithm>#include <map>#include <string>#include <iostream>#include "geopm_field.h"#include "geopm/Exception.hpp"#include "geopm/PlatformIO.hpp"#include "geopm/PlatformTopo.hpp"
Namespaces | |
| namespace | geopm |
Functions | |
| std::string | geopm::read_file (const std::string &path) |
| Reads the specified file and returns the contents in a string. | |
| double | geopm::read_double_from_file (const std::string &path, const std::string &expected_units) |
| Read a file and return a double read from the file. | |
| void | geopm::write_file (const std::string &path, const std::string &contents) |
| Writes a string to a file. This will replace the file if it exists or create it if it does not exist. | |
| std::vector< std::string > | geopm::string_split (const std::string &str, const std::string &delim) |
| Splits a string according to a delimiter. | |
| std::string | geopm::string_join (const std::vector< std::string > &string_list, const std::string &delim) |
| Joins a vector of strings together with a delimiter. | |
| std::string | geopm::hostname (void) |
| Returns the current hostname as a string. | |
| std::vector< std::string > | geopm::list_directory_files (const std::string &path) |
| List all files in the given directory. | |
| bool | geopm::string_begins_with (const std::string &str, const std::string &key) |
| Returns whether one string begins with another. | |
| bool | geopm::string_ends_with (std::string str, std::string key) |
| Returns whether one string ends with another. | |
| std::string | geopm::string_format_double (double signal) |
| Format a string to best represent a signal encoding a double precision floating point number. | |
| std::string | geopm::string_format_float (double signal) |
| Format a string to best represent a signal encoding a single precision floating point number. | |
| std::string | geopm::string_format_integer (double signal) |
| Format a string to best represent a signal encoding a decimal integer. | |
| std::string | geopm::string_format_hex (double signal) |
| Format a string to best represent a signal encoding an unsigned hexadecimal integer. | |
| std::string | geopm::string_format_raw64 (double signal) |
| Format a string to represent the raw memory supporting a signal as an unsigned hexadecimal integer. | |
| std::function< std::string(double)> | geopm::string_format_type_to_function (int format_type) |
| Convert a format type enum string_format_e to a format function. | |
| std::function< std::string(double)> | geopm::string_format_name_to_function (const std::string &format_name) |
| Convert a format function to a format name to a format function. | |
| int | geopm::string_format_function_to_type (std::function< std::string(double)> format_function) |
| Convert a format function to a format type enum string_format_e. | |
| std::string | geopm::get_env (const std::string &name) |
| Read an environment variable. | |
| int | geopm::verbosity_level (void) |
| Query environment for verbosity level. | |
| unsigned int | geopm::pid_to_uid (const int pid) |
| Query for the user id associated with the process id. | |
| unsigned int | geopm::pid_to_gid (const int pid) |
| Query for the group id associated with the process id. | |
| std::unique_ptr< cpu_set_t, std::function< void(cpu_set_t *)> > | geopm::make_cpu_set (int num_cpu, const std::set< int > &cpu_enabled) |
| Wrapper around CPU_ALLOC and CPU_FREE. | |
| bool | geopm::has_cap_sys_admin (void) |
| Check if the caller has effective capability CAP_SYS_ADMIN. | |
| bool | geopm::has_cap_sys_admin (int pid) |
| Check if the pid has effective capability CAP_SYS_ADMIN. | |
| std::string | geopm::read_symlink_target (const std::string &symlink_path) |
| void | geopm::enable_fixed_counters (PlatformIO &pio) |
| bool | geopm::is_all_nan (const std::vector< double > &vec) |
| Return true if all values in the given vector are NAN. | |
| std::set< int > | geopm::get_cpuset (int pid) |
| Get the CPUs available to the specified process based on cgroup constraints. | |