summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 75efef3)
raw | patch | inline | side by side (parent: 75efef3)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 11 Sep 2010 09:04:44 +0000 (11:04 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 11 Sep 2010 09:04:44 +0000 (11:04 +0200) |
This makes the code easier to read, IMHO.
src/lpar.c | patch | blob | history |
diff --git a/src/lpar.c b/src/lpar.c
index 7a842e0712b0e42562412f6f7c81aa086ad550a4..562d2d4e86c829c1728fc60f93d2b48aff0e8f08 100644 (file)
--- a/src/lpar.c
+++ b/src/lpar.c
(double)(_system_configuration.Xfrac))
#endif
+#define NS_TO_TICKS(ns) ((ns) / XINTFRAC)
+
static const char *config_keys[] =
{
"CpuPoolStats",
/* Pool stats are in CPU x ns */
ssnprintf (typinst, sizeof (typinst), "pool-%X-busy", lparstats.pool_id);
- lpar_submit (typinst, (double) pool_busy_ns / XINTFRAC / (double) ticks);
+ lpar_submit (typinst, NS_TO_TICKS ((double) pool_busy_ns) / (double) ticks);
ssnprintf (typinst, sizeof (typinst), "pool-%X-total", lparstats.pool_id);
- lpar_submit (typinst, (double) pool_max_ns / XINTFRAC / (double) ticks);
+ lpar_submit (typinst, NS_TO_TICKS ((double) pool_max_ns) / (double) ticks);
}
save_last_values (&lparstats);