diff --git a/checkin_notes b/checkin_notes index ad5e49f9f4..e5a014232b 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5962,3 +5962,12 @@ Rom 13 Sept 2012 client/ gpu_nvidia.cpp + +David 16 Sept 2012 + - client: enforce excluded app at startup + - win compile fix + + client/ + app.cpp + lib/ + filesys.h diff --git a/client/app.cpp b/client/app.cpp index fae19c590c..ee11ebc7ed 100644 --- a/client/app.cpp +++ b/client/app.cpp @@ -300,16 +300,19 @@ void ACTIVE_TASK_SET::get_memory_usage() { int retval; static bool first = true; static double last_cpu_time; + double diff; - double diff = gstate.now - last_mem_time; - if (diff < 0 || diff > MEMORY_USAGE_PERIOD + 10) { - // user has changed system clock, - // or there has been a long system sleep - // - last_mem_time = gstate.now; - return; + if (!first) { + diff = gstate.now - last_mem_time; + if (diff < 0 || diff > MEMORY_USAGE_PERIOD + 10) { + // user has changed system clock, + // or there has been a long system sleep + // + last_mem_time = gstate.now; + return; + } + if (diff < MEMORY_USAGE_PERIOD) return; } - if (diff < MEMORY_USAGE_PERIOD) return; last_mem_time = gstate.now; PROC_MAP pm; @@ -345,18 +348,20 @@ void ACTIVE_TASK_SET::get_memory_usage() { procinfo_app(pi, v, pm, atp->app_version->graphics_exec_file); pi.working_set_size_smoothed = .5*(pi.working_set_size_smoothed + pi.working_set_size); - int pf = pi.page_fault_count - last_page_fault_count; - pi.page_fault_rate = pf/diff; - if (log_flags.mem_usage_debug) { - msg_printf(atp->result->project, MSG_INFO, - "[mem_usage] %s: WS %.2fMB, smoothed %.2fMB, page %.2fMB, %.2f page faults/sec, user CPU %.3f, kernel CPU %.3f", - atp->result->name, - pi.working_set_size/MEGA, - pi.working_set_size_smoothed/MEGA, - pi.swap_size/MEGA, - pi.page_fault_rate, - pi.user_time, pi.kernel_time - ); + if (!first) { + int pf = pi.page_fault_count - last_page_fault_count; + pi.page_fault_rate = pf/diff; + if (log_flags.mem_usage_debug) { + msg_printf(atp->result->project, MSG_INFO, + "[mem_usage] %s: WS %.2fMB, smoothed %.2fMB, page %.2fMB, %.2f page faults/sec, user CPU %.3f, kernel CPU %.3f", + atp->result->name, + pi.working_set_size/MEGA, + pi.working_set_size_smoothed/MEGA, + pi.swap_size/MEGA, + pi.page_fault_rate, + pi.user_time, pi.kernel_time + ); + } } } @@ -391,9 +396,7 @@ void ACTIVE_TASK_SET::get_memory_usage() { ); } double new_cpu_time = pi.user_time + pi.kernel_time; - if (first) { - first = false; - } else { + if (!first) { non_boinc_cpu_usage = (new_cpu_time - last_cpu_time)/(diff*gstate.host_info.p_ncpus); // processes might have exited in the last 10 sec, // causing this to be negative. @@ -405,6 +408,7 @@ void ACTIVE_TASK_SET::get_memory_usage() { } } last_cpu_time = new_cpu_time; + first = false; } #endif diff --git a/lib/filesys.h b/lib/filesys.h index 323f1a03f2..759e5c518e 100644 --- a/lib/filesys.h +++ b/lib/filesys.h @@ -19,6 +19,7 @@ #define _FILESYS_ #if defined(_WIN32) && !defined(__CYGWIN32__) +#include "boinc_win.h" #else #include #include @@ -29,10 +30,6 @@ #include #endif -#ifndef MAXPATHLEN -#define MAXPATHLEN 1024 -#endif - #endif /* !WIN32 */ #define FILE_RETRY_INTERVAL 5