mirror of https://github.com/BOINC/boinc.git
- client: with VBox on Win, the process graph sometimes has cycles.
Not sure where this comes from. But avoid infinite recursion when traversing descendants. svn path=/trunk/boinc/; revision=24230
This commit is contained in:
parent
61dc940872
commit
53133f126d
|
@ -6178,3 +6178,11 @@ David 16 Sept 2011
|
|||
|
||||
sched/
|
||||
credit.cpp
|
||||
|
||||
David 16 Sept 2011
|
||||
- client: with VBox on Win, the process graph sometimes has cycles.
|
||||
Not sure where this comes from.
|
||||
But avoid infinite recursion when traversing descendants.
|
||||
|
||||
lib/
|
||||
procinfo.cpp,h
|
||||
|
|
|
@ -41,14 +41,15 @@ void add_child_totals(PROCINFO& pi, PROC_MAP& pm, PROC_MAP::iterator i) {
|
|||
PROCINFO parent = i->second;
|
||||
for (unsigned int j=0; j<parent.children.size(); j++) {
|
||||
int child_pid = parent.children[j];
|
||||
if (child_pid == parent.id) {
|
||||
return; // shouldn't happen
|
||||
}
|
||||
PROC_MAP::iterator i2 = pm.find(child_pid);
|
||||
if (i2 == pm.end()) continue;
|
||||
PROCINFO& p = i2->second;
|
||||
if (p.scanned) {
|
||||
return; // cycle in graph - shouldn't happen
|
||||
}
|
||||
pi.kernel_time += p.kernel_time;
|
||||
pi.user_time += p.user_time;
|
||||
p.scanned = true;
|
||||
|
||||
// only count process with most swap and memory
|
||||
if (p.swap_size > pi.swap_size) {
|
||||
|
@ -88,6 +89,7 @@ void procinfo_app(
|
|||
pi.swap_size += p.swap_size;
|
||||
pi.working_set_size += p.working_set_size;
|
||||
p.is_boinc_app = true;
|
||||
p.scanned = true;
|
||||
|
||||
// look for child processes
|
||||
//
|
||||
|
|
|
@ -34,6 +34,7 @@ struct PROCINFO {
|
|||
bool is_low_priority;
|
||||
// running at or below priority of BOINC apps
|
||||
char command[256];
|
||||
bool scanned;
|
||||
|
||||
double page_fault_rate; // derived by higher-level code
|
||||
std::vector<int> children;
|
||||
|
@ -51,6 +52,7 @@ struct PROCINFO {
|
|||
is_boinc_app = false;
|
||||
is_low_priority = false;
|
||||
command[0] = 0;
|
||||
scanned = false;
|
||||
page_fault_rate = 0;
|
||||
children.clear();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue