Return 0 usage times for scheaduler (PID 0).

* proctime.c: Return 0 usage times for scheaduler (PID 0).
This commit is contained in:
Drazen Kacar
1999-05-11 06:25:04 +00:00
parent 04d988357f
commit f23e8b3d1c
2 changed files with 19 additions and 10 deletions

View File

@@ -1,3 +1,7 @@
1999-05-11 Drazen Kacar <dave@srce.hr>
* proctime.c: Return 0 usage times for scheaduler (PID 0).
1999-05-10 Drazen Kacar <dave@srce.hr> 1999-05-10 Drazen Kacar <dave@srce.hr>
* proclist.c: Added process selection mechanism. It's not * proclist.c: Added process selection mechanism. It's not

View File

@@ -48,6 +48,10 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf,
memset (buf, 0, sizeof (glibtop_proc_time)); memset (buf, 0, sizeof (glibtop_proc_time));
/* Don't do it for scheduler, we don't want to frighten our users */
if(pid)
{
if (glibtop_get_proc_data_usage_s (server, &prusage, pid)) if (glibtop_get_proc_data_usage_s (server, &prusage, pid))
return; return;
@@ -60,6 +64,7 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf,
prusage.pr_utime.tv_nsec / 1E+3; prusage.pr_utime.tv_nsec / 1E+3;
buf->stime = prusage.pr_stime.tv_sec * 1E+6 + buf->stime = prusage.pr_stime.tv_sec * 1E+6 +
prusage.pr_stime.tv_nsec / 1E+3; prusage.pr_stime.tv_nsec / 1E+3;
}
buf->flags = _glibtop_sysdeps_proc_time; buf->flags = _glibtop_sysdeps_proc_time;
} }