Fixed server->ncpu usage (SMP handling). Need more testing.

* cpu.c: (glibtop_get_cpu_s):
	* glibtop_private.c: (get_scaled), (check_cpu_line):
	* glibtop_private.h:
	* open.c: (glibtop_open_s):
	* proctime.c: (glibtop_get_proc_time_s):

	Fixed server->ncpu usage (SMP handling). Need more testing.
This commit is contained in:
Benoît Dejean
2005-12-13 09:15:49 +00:00
parent ba7355df9e
commit 806a816026
6 changed files with 64 additions and 12 deletions

View File

@@ -21,6 +21,7 @@
#define __LINUX__GLIBTOP_PRIVATE_H__
#include <glibtop.h>
#include <glibtop/error.h>
#include <glib.h>
@@ -121,6 +122,26 @@ size_t
get_page_size(void) G_GNUC_INTERNAL;
gboolean
check_cpu_line(glibtop *server, const char *line, unsigned n) G_GNUC_INTERNAL;
static inline gboolean
check_cpu_line_warn(glibtop *server, const char *line, unsigned i)
{
gboolean ret;
ret = check_cpu_line(server, line, i);
if (G_UNLIKELY(!ret))
glibtop_warn_io_r(server,
"'%s' does not start with 'cpu%u'",
line, i);
return ret;
}
G_END_DECLS
#endif /* __LINUX__GLIBTOP_PRIVATE_H__ */