|
|
|
@ -5,6 +5,7 @@
|
|
|
|
|
#include "overlay.h"
|
|
|
|
|
#include "config.h"
|
|
|
|
|
#include "file_utils.h"
|
|
|
|
|
#include "string_utils.h"
|
|
|
|
|
|
|
|
|
|
string os, cpu, gpu, ram, kernel, driver, cpusched;
|
|
|
|
|
bool sysInfoFetched = false;
|
|
|
|
@ -95,12 +96,11 @@ string get_log_suffix(){
|
|
|
|
|
return log_name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void logging(void *params_void){
|
|
|
|
|
overlay_params *params = reinterpret_cast<overlay_params *>(params_void);
|
|
|
|
|
void logging(){
|
|
|
|
|
logger->wait_until_data_valid();
|
|
|
|
|
while (logger->is_active()){
|
|
|
|
|
logger->try_log();
|
|
|
|
|
this_thread::sleep_for(chrono::milliseconds(params->log_interval));
|
|
|
|
|
this_thread::sleep_for(chrono::milliseconds(_params.log_interval));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -117,8 +117,8 @@ void Logger::start_logging() {
|
|
|
|
|
m_values_valid = false;
|
|
|
|
|
m_logging_on = true;
|
|
|
|
|
m_log_start = Clock::now();
|
|
|
|
|
if((!m_params->output_folder.empty()) && (m_params->log_interval != 0)){
|
|
|
|
|
std::thread(logging, m_params).detach();
|
|
|
|
|
if((!_params.output_folder.empty()) && (_params.log_interval != 0)){
|
|
|
|
|
std::thread(logging).detach();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -127,13 +127,13 @@ void Logger::stop_logging() {
|
|
|
|
|
m_logging_on = false;
|
|
|
|
|
m_log_end = Clock::now();
|
|
|
|
|
|
|
|
|
|
std::thread(calculate_benchmark_data, m_params).detach();
|
|
|
|
|
calculate_benchmark_data();
|
|
|
|
|
|
|
|
|
|
if(!m_params->output_folder.empty()) {
|
|
|
|
|
if(!_params.output_folder.empty()) {
|
|
|
|
|
std::string program = get_wine_exe_name();
|
|
|
|
|
if (program.empty())
|
|
|
|
|
program = get_program_name();
|
|
|
|
|
m_log_files.emplace_back(m_params->output_folder + "/" + program + "_" + get_log_suffix());
|
|
|
|
|
m_log_files.emplace_back(_params.output_folder + "/" + program + "_" + get_log_suffix());
|
|
|
|
|
std::thread(writeFile, m_log_files.back()).detach();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -149,7 +149,7 @@ void Logger::try_log() {
|
|
|
|
|
currentLogData.frametime = frametime;
|
|
|
|
|
m_log_array.push_back(currentLogData);
|
|
|
|
|
|
|
|
|
|
if(m_params->log_duration && (elapsedLog >= std::chrono::seconds(m_params->log_duration))){
|
|
|
|
|
if(_params.log_duration && (elapsedLog >= std::chrono::seconds(_params.log_duration))){
|
|
|
|
|
stop_logging();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|