* mono-perfcounters.c: add the "_Total" instance for CPU counters.
Until now, we only had the per-cpu(core) counters.
2009-10-30 Gonzalo Paniagua Javier <gonzalo@novell.com>
* mono-proclib.c: hz is only multiplied by the number of cpus when
requesting "_Total".
Fixes bug #523520.
svn path=/trunk/mono/; revision=145134
+2009-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
+
+ * mono-perfcounters.c: add the "_Total" instance for CPU counters.
+ Until now, we only had the per-cpu(core) counters.
+
2009-10-28 Mark Probst <mark.probst@gmail.com>
* gc-internal.h, boehm-gc, sgen-gc.c, null-gc: Add
void **buf = NULL;
int i, count;
MonoArray *array;
- count = mono_cpu_count ();
+
+ count = mono_cpu_count () + 1; /* +1 for "_Total" */
buf = g_new (void*, count);
for (i = 0; i < count; ++i)
- buf [i] = GINT_TO_POINTER (i);
+ buf [i] = GINT_TO_POINTER (i - 1); /* -1 => _Total */
array = get_string_array (buf, count, FALSE);
g_free (buf);
+ mono_array_setref (array, 0, mono_string_new (mono_domain_get (), "_Total"));
return array;
}
+2009-10-30 Gonzalo Paniagua Javier <gonzalo@novell.com>
+
+ * mono-proclib.c: hz is only multiplied by the number of cpus when
+ requesting "_Total".
+
2009-10-29 Mark Probst <mark.probst@gmail.com>
* mono-hash.c (mono_g_hash_mark): Don't use SET_NODE_KEY/VALUE here.
FILE *f = fopen ("/proc/stat", "r");
if (!f)
return;
- hz *= mono_cpu_count ();
+ if (cpu_id < 0)
+ hz *= mono_cpu_count ();
while ((s = fgets (buf, sizeof (buf), f))) {
char *data = NULL;
if (cpu_id < 0 && strncmp (s, "cpu", 3) == 0 && g_ascii_isspace (s [3])) {