- client: include CPU usage of client in BOINC total.

Also include manager if its name includes "boinc"
    (can't figure out another way)

svn path=/trunk/boinc/; revision=20566
This commit is contained in:
David Anderson 2010-02-15 01:00:32 +00:00
parent b57ce7339d
commit 768f3bfe0b
4 changed files with 19 additions and 5 deletions

View File

@ -1175,3 +1175,11 @@ David 13 Feb 2010
html/user
edit_user_info_form/action.php
David 14 Feb 2010
- client: include CPU usage of client in BOINC total.
Also include manager if its name includes "boinc"
(can't figure out another way)
lib/
procinfo*.cpp

View File

@ -38,7 +38,7 @@ using std::vector;
// build table of all processes in system
//
int procinfo_setup(vector<PROCINFO>& pi) {
int pid = getpid();
FILE* fd;
PROCINFO p;
int c, real_mem, virtual_mem, hours;
@ -106,7 +106,7 @@ int procinfo_setup(vector<PROCINFO>& pi) {
p.working_set_size = (double)real_mem * 1024.;
p.swap_size = (double)virtual_mem * 1024.;
p.user_time += 60. * (float)hours;
p.is_boinc_app = false;
p.is_boinc_app = (p.id == pid || strstr(p.command, "boinc"));
pi.push_back(p);
}

View File

@ -170,6 +170,7 @@ int procinfo_setup(vector<PROCINFO>& pi) {
PROCINFO p;
char pidpath[1024];
char buf[1024];
int pid = getpid();
dir = opendir("/proc");
if (!dir) return 0;
@ -205,7 +206,7 @@ int procinfo_setup(vector<PROCINFO>& pi) {
p.page_fault_count = prusage.pr_majf + prusage.pr_minf;
}
fclose(fd);
p.is_boinc_app = false;
p.is_boinc_app = (p.id == pid || strstr(p.command, "boinc"));
pi.push_back(p);
}
}
@ -230,7 +231,7 @@ int procinfo_setup(vector<PROCINFO>& pi) {
p.user_time = ps.utime / 100.;
p.kernel_time = ps.stime / 100.;
strlcpy(p.command, ps.comm, sizeof(p.command));
p.is_boinc_app = false;
p.is_boinc_app = (p.id == pid || strstr(p.command, "boinc"));
pi.push_back(p);
}
#endif

View File

@ -67,6 +67,11 @@ int get_procinfo_XP(vector<PROCINFO>& pi) {
ULONG cbBuffer = 128*1024; // 128k initial buffer
PVOID pBuffer = NULL;
PSYSTEM_PROCESSES pProcesses = NULL;
statid DWORD pid = 0;
if (!pid) {
pid = GetCurrentProcessId();
}
#if 0
printf("FILETIME: %d\n", sizeof(FILETIME));
printf("LARGE_INTEGER: %d\n", sizeof(LARGE_INTEGER));
@ -97,7 +102,7 @@ int get_procinfo_XP(vector<PROCINFO>& pi) {
sizeof(p.command),
NULL, NULL
);
p.is_boinc_app = false;
p.is_boinc_app = (p.id == pid) || (strcmp(p.command, "boinc") != NULL);
pi.push_back(p);
if (!pProcesses->NextEntryDelta) {
break;