00001 00012 #ifndef OPROF_START_UTIL_H 00013 #define OPROF_START_UTIL_H 00014 00015 #include <cmath> 00016 #include <string> 00017 #include <vector> 00018 00020 struct daemon_status { 00022 daemon_status(); 00023 bool running; 00024 unsigned int nr_interrupts; 00025 }; 00026 00027 inline double ratio(double x1, double x2) 00028 { 00029 return fabs(((x1 - x2) / x2)) * 100; 00030 } 00031 00032 std::string const get_config_filename(std::string const & filename); 00033 bool check_and_create_config_dir(); 00034 std::string const format(std::string const & orig, uint const maxlen); 00035 int do_exec_command(std::string const & cmd, std::vector<std::string> const & args = std::vector<std::string>()); 00036 std::string const do_open_file_or_dir(std::string const & base_dir, bool dir_only); 00037 bool verify_argument(std::string const & str); 00038 00039 #endif // OPROF_START_UTIL_H