c - In the Linux kernel, what does it mean for a process to be "whole"? -
this code file /fs/proc/array.c
in linux headers. int whole
parameter mean? want know why need accumulate min_flt
, maj_flt
s sig_struct
, other times it's ok read values straight out of task_struct
346 static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, 347 struct pid *pid, struct task_struct *task, int whole) ... 406 /* add live thread stats @ group level */ 407 if (whole) { 408 struct task_struct *t = task; 409 { 410 min_flt += t->min_flt; 411 maj_flt += t->maj_flt; 412 gtime = cputime_add(gtime, t->gtime); 413 t = next_thread(t); 414 } while (t != task); 415 416 min_flt += sig->min_flt; 417 maj_flt += sig->maj_flt; 418 thread_group_times(task, &utime, &stime); 419 gtime = cputime_add(gtime, sig->gtime); 420 } ... 431 if (!whole) { 432 min_flt = task->min_flt; 433 maj_flt = task->maj_flt; 434 task_times(task, &utime, &stime); 435 gtime = task->gtime; 436 }
"whole" argument name , in context seems indicate "do_task_stat
whole thread group".
do_task_stat
static function used within /fs/proc/array.c
used in 2 places: proc_tid_stat
(tid "thread id") , proc_tgid_stat
(tgid "thread group id").
see linux - threads , process explaination of thread groups.
Comments
Post a Comment