Merge pull request #261 from joncham/bug-null-interface-bitset
[mono.git] / mono / metadata / mono-perfcounters.c
index 6a3a7bce2592af0eaf980e27923d2593be279b4f..dfe7b4b4d3dc837f4c5fbc35061e66931203128e 100644 (file)
@@ -6,6 +6,7 @@
  * Author: Paolo Molaro (lupus@ximian.com)
  *
  * Copyright 2008-2009 Novell, Inc (http://www.novell.com)
+ * 2011 Xamarin, Inc
  */
 
 #include "config.h"
@@ -15,7 +16,7 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#if defined (__OpenBSD)
+#if defined (__OpenBSD__)
 #include <sys/param.h>
 #endif
 #ifdef HAVE_SYS_TYPES_H
@@ -1006,6 +1007,25 @@ predef_writable_counter (ImplVtable *vtable, MonoBoolean only_value, MonoCounter
                        return TRUE;
                }
                break;
+       case CATEGORY_JIT:
+               switch (id) {
+               case COUNTER_JIT_BYTES:
+                       sample->rawValue = mono_perfcounters->jit_bytes;
+                       return TRUE;
+               case COUNTER_JIT_METHODS:
+                       sample->rawValue = mono_perfcounters->jit_methods;
+                       return TRUE;
+               case COUNTER_JIT_TIME:
+                       sample->rawValue = mono_perfcounters->jit_time;
+                       return TRUE;
+               case COUNTER_JIT_BYTES_PSEC:
+                       sample->rawValue = mono_perfcounters->jit_bytes;
+                       return TRUE;
+               case COUNTER_JIT_FAILURES:
+                       sample->rawValue = mono_perfcounters->jit_failures;
+                       return TRUE;
+               }
+               break;
        }
        return FALSE;
 }