X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fmono-perfcounters.c;h=ec72516a2b394f8fc4db25163ad9a6354000bbf7;hb=dd72864f564231c324248c3fd75b55054debc1e4;hp=35e271b65f1637f54f1cf158e20fdc716cd4c9db;hpb=0900c61969ca862b0bcc967b4413e539acf07dbb;p=mono.git diff --git a/mono/metadata/mono-perfcounters.c b/mono/metadata/mono-perfcounters.c index 35e271b65f1..ec72516a2b3 100644 --- a/mono/metadata/mono-perfcounters.c +++ b/mono/metadata/mono-perfcounters.c @@ -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" @@ -37,6 +38,7 @@ #include "utils/mono-proclib.h" #include "utils/mono-networkinterfaces.h" #include "utils/mono-error-internals.h" +#include "utils/atomic.h" #include /* map of CounterSample.cs */ @@ -51,6 +53,7 @@ struct _MonoCounterSample { int counterType; }; +#ifndef DISABLE_PERFCOUNTERS /* map of PerformanceCounterType.cs */ enum { NumberOfItemsHEX32=0x00000000, @@ -1006,6 +1009,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; } @@ -1669,4 +1691,77 @@ mono_perfcounter_instance_names (MonoString *category, MonoString *machine) return mono_array_new (mono_domain_get (), mono_get_string_class (), 0); } } +#else +void* +mono_perfcounter_get_impl (MonoString* category, MonoString* counter, MonoString* instance, MonoString* machine, int *type, MonoBoolean *custom) +{ + g_assert_not_reached (); +} + +MonoBoolean +mono_perfcounter_get_sample (void *impl, MonoBoolean only_value, MonoCounterSample *sample) +{ + g_assert_not_reached (); +} +gint64 +mono_perfcounter_update_value (void *impl, MonoBoolean do_incr, gint64 value) +{ + g_assert_not_reached (); +} + +void +mono_perfcounter_free_data (void *impl) +{ + g_assert_not_reached (); +} + +/* Category icalls */ +MonoBoolean +mono_perfcounter_category_del (MonoString *name) +{ + g_assert_not_reached (); +} + +MonoString* +mono_perfcounter_category_help (MonoString *category, MonoString *machine) +{ + g_assert_not_reached (); +} + +MonoBoolean +mono_perfcounter_category_exists (MonoString *counter, MonoString *category, MonoString *machine) +{ + g_assert_not_reached (); +} + +MonoBoolean +mono_perfcounter_create (MonoString *category, MonoString *help, int type, MonoArray *items) +{ + g_assert_not_reached (); +} + +int +mono_perfcounter_instance_exists (MonoString *instance, MonoString *category, MonoString *machine) +{ + g_assert_not_reached (); +} + +MonoArray* +mono_perfcounter_category_names (MonoString *machine) +{ + g_assert_not_reached (); +} + +MonoArray* +mono_perfcounter_counter_names (MonoString *category, MonoString *machine) +{ + g_assert_not_reached (); +} + +MonoArray* +mono_perfcounter_instance_names (MonoString *category, MonoString *machine) +{ + g_assert_not_reached (); +} +#endif