Kernel: statistical profiling fixes

- create name entries for forked processes as well;
- create name entries only for system processes.
This commit is contained in:
David van Moolenbroek
2010-12-16 09:46:26 +00:00
parent f0f34dd8d9
commit b6f3b7e7f6
2 changed files with 12 additions and 10 deletions

View File

@@ -101,18 +101,19 @@ PRIVATE void profile_sample(struct proc * p, void * pc)
return;
}
if (!(p->p_misc_flags & MF_SPROF_SEEN)) {
p->p_misc_flags |= MF_SPROF_SEEN;
sprof_save_proc(p);
}
/* Runnable system process? */
if (p->p_endpoint == IDLE)
sprof_info.idle_samples++;
sprof_info.idle_samples++;
else if (p->p_endpoint == KERNEL ||
(priv(p)->s_flags & SYS_PROC && proc_is_runnable(p))) {
sprof_save_sample(p, pc);
sprof_info.system_samples++;
(priv(p)->s_flags & SYS_PROC && proc_is_runnable(p))) {
if (!(p->p_misc_flags & MF_SPROF_SEEN)) {
p->p_misc_flags |= MF_SPROF_SEEN;
sprof_save_proc(p);
}
sprof_save_sample(p, pc);
sprof_info.system_samples++;
} else {
/* User process. */
sprof_info.user_samples++;