mirror of https://github.com/BOINC/boinc.git
- client: don't include graphics apps in non-BOINC CPU time
svn path=/trunk/boinc/; revision=21131
This commit is contained in:
parent
212fb765e9
commit
84861e7c55
|
@ -2562,3 +2562,13 @@ David 6 Apr 2010
|
|||
|
||||
sched/
|
||||
credit.cpp
|
||||
|
||||
David 6 Apr 2010
|
||||
- client: don't include graphics apps in non-BOINC CPU time
|
||||
|
||||
client/
|
||||
app.cpp
|
||||
client_state.cpp,h
|
||||
lib/
|
||||
procinfo.h
|
||||
procinfo_win.cpp
|
||||
|
|
|
@ -331,7 +331,7 @@ void ACTIVE_TASK_SET::get_memory_usage() {
|
|||
unsigned long last_page_fault_count = pi.page_fault_count;
|
||||
memset(&pi, 0, sizeof(pi));
|
||||
pi.id = atp->pid;
|
||||
procinfo_app(pi, piv);
|
||||
procinfo_app(pi, piv, 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;
|
||||
|
|
|
@ -840,7 +840,8 @@ int CLIENT_STATE::link_app_version(PROJECT* p, APP_VERSION* avp) {
|
|||
return ERR_NOT_UNIQUE;
|
||||
}
|
||||
|
||||
avp->graphics_exec_path[0] = 0;
|
||||
strcpy(avp->graphics_exec_path, "");
|
||||
strcpy(avp->graphics_exec_file, "");
|
||||
|
||||
for (i=0; i<avp->app_files.size(); i++) {
|
||||
FILE_REF& file_ref = avp->app_files[i];
|
||||
|
@ -858,6 +859,7 @@ int CLIENT_STATE::link_app_version(PROJECT* p, APP_VERSION* avp) {
|
|||
get_pathname(fip, relpath, sizeof(relpath));
|
||||
relative_to_absolute(relpath, path);
|
||||
strlcpy(avp->graphics_exec_path, path, sizeof(avp->graphics_exec_path));
|
||||
strcpy(avp->graphics_exec_file, fip->name);
|
||||
}
|
||||
|
||||
// any file associated with an app version must be signed
|
||||
|
|
|
@ -447,6 +447,7 @@ struct APP_VERSION {
|
|||
std::vector<FILE_REF> app_files;
|
||||
int ref_cnt;
|
||||
char graphics_exec_path[512];
|
||||
char graphics_exec_file[256];
|
||||
double max_working_set_size;
|
||||
// max working set of tasks using this app version.
|
||||
// temp var used in schedule_cpus()
|
||||
|
|
|
@ -37,7 +37,7 @@ struct PROCINFO {
|
|||
|
||||
extern int procinfo_setup(std::vector<PROCINFO>&);
|
||||
// call this first to get data structure
|
||||
extern void procinfo_app(PROCINFO&, std::vector<PROCINFO>&);
|
||||
extern void procinfo_app(PROCINFO&, std::vector<PROCINFO>&, char* graphics_exec_file);
|
||||
// call this to get mem usage for a given app
|
||||
// (marks process as BOINC)
|
||||
extern void procinfo_other(PROCINFO&, std::vector<PROCINFO>&);
|
||||
|
|
|
@ -137,7 +137,7 @@ int procinfo_setup(vector<PROCINFO>& pi) {
|
|||
// scan the process table from the given point,
|
||||
// adding in CPU time and mem usage
|
||||
//
|
||||
void add_proc_totals(PROCINFO& pi, vector<PROCINFO>& piv, int pid, int start) {
|
||||
void add_proc_totals(PROCINFO& pi, vector<PROCINFO>& piv, int pid, char* graphics_exec_file, int start) {
|
||||
unsigned int i;
|
||||
for (i=start; i<piv.size(); i++) {
|
||||
PROCINFO& p = piv[i];
|
||||
|
@ -148,9 +148,12 @@ void add_proc_totals(PROCINFO& pi, vector<PROCINFO>& piv, int pid, int start) {
|
|||
pi.working_set_size += p.working_set_size;
|
||||
pi.page_fault_count += p.page_fault_count;
|
||||
p.is_boinc_app = true;
|
||||
}
|
||||
}
|
||||
if (!strcmp(p.command, graphics_exec_file)) {
|
||||
p.is_boinc_app = true;
|
||||
}
|
||||
if (p.parentid == pid) {
|
||||
add_proc_totals(pi, piv, p.id, i+1); // recursion - woo hoo!
|
||||
add_proc_totals(pi, piv, p.id, graphics_exec_file, i+1); // recursion - woo hoo!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -158,8 +161,8 @@ void add_proc_totals(PROCINFO& pi, vector<PROCINFO>& piv, int pid, int start) {
|
|||
// fill in the given PROCINFO (which initially is zero except for id)
|
||||
// with totals from that process and all its descendants
|
||||
//
|
||||
void procinfo_app(PROCINFO& pi, vector<PROCINFO>& piv) {
|
||||
add_proc_totals(pi, piv, pi.id, 0);
|
||||
void procinfo_app(PROCINFO& pi, vector<PROCINFO>& piv, char* graphics_exec_file) {
|
||||
add_proc_totals(pi, piv, pi.id, graphics_exec_file, 0);
|
||||
}
|
||||
|
||||
// get totals of all non-BOINC processes
|
||||
|
|
Loading…
Reference in New Issue