Imported Upstream version 6.4.0.137

Former-commit-id: 943baa9f16a098c33e129777827f3a9d20da00d6
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-07-26 19:53:28 +00:00
parent e9207cf623
commit ef583813eb
2712 changed files with 74169 additions and 40587 deletions

View File

@@ -41,30 +41,82 @@ namespace System.Diagnostics
private PerformanceCounterCategoryType type = PerformanceCounterCategoryType.Unknown;
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern bool CategoryDelete (string name);
private static unsafe extern bool CategoryDelete_icall (char* name, int name_length);
static unsafe bool CategoryDelete (string name)
{
fixed (char* fixed_name = name)
return CategoryDelete_icall (fixed_name, name?.Length ?? 0);
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern string CategoryHelpInternal (string category);
private unsafe static extern string CategoryHelp_icall (char* category, int category_length);
static unsafe string CategoryHelpInternal (string category)
{
fixed (char* fixed_category = category)
return CategoryHelp_icall (fixed_category, category?.Length ?? 0);
}
/* this icall allows a null counter and it will just search for the category */
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern bool CounterCategoryExists (string counter, string category);
private static unsafe extern bool CounterCategoryExists_icall (char* counter, int counter_length,
char* category, int category_length);
static unsafe bool CounterCategoryExists (string counter, string category)
{
fixed (char* fixed_counter = counter,
fixed_category = category)
return CounterCategoryExists_icall (fixed_counter, counter?.Length ?? 0,
fixed_category, category?.Length ?? 0);
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern bool Create (string categoryName, string categoryHelp,
static private unsafe extern bool Create_icall (char* categoryName, int categoryName_length,
char* categoryHelp, int categoryHelp_length,
PerformanceCounterCategoryType categoryType, CounterCreationData[] items);
static unsafe bool Create (string categoryName, string categoryHelp,
PerformanceCounterCategoryType categoryType, CounterCreationData[] items)
{
fixed (char* fixed_categoryName = categoryName,
fixed_categoryHelp = categoryHelp)
return Create_icall (fixed_categoryName, categoryName?.Length ?? 0,
fixed_categoryHelp, categoryHelp?.Length ?? 0, categoryType, items);
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern bool InstanceExistsInternal (string instance, string category);
static private unsafe extern bool InstanceExistsInternal_icall (char* instance, int instance_length,
char* category, int category_length);
static unsafe bool InstanceExistsInternal (string instance, string category)
{
fixed (char* fixed_instance = instance,
fixed_category = category)
return InstanceExistsInternal_icall (fixed_instance, instance?.Length ?? 0,
fixed_category, category?.Length ?? 0);
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern string[] GetCategoryNames ();
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern string[] GetCounterNames (string category);
static private unsafe extern string[] GetCounterNames_icall (char* category, int category_length);
static unsafe string[] GetCounterNames (string category)
{
fixed (char* fixed_category = category)
return GetCounterNames_icall (fixed_category, category?.Length ?? 0);
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern string[] GetInstanceNames (string category);
static private unsafe extern string[] GetInstanceNames_icall (char* category, int category_length);
static unsafe string[] GetInstanceNames (string category)
{
fixed (char* fixed_category = category)
return GetInstanceNames_icall (fixed_category, category?.Length ?? 0);
}
static void CheckCategory (string categoryName) {
if (categoryName == null)