/// <summary> /// Start collecting profiling data. /// Doesn't throw any errors even if the application is run with profiling disabled. /// </summary> /// <param name="groupName">The name of the collected data block.</param> public static void StartCollectingData(string groupName) { var id = Helper.Id; switch (Helper.Platform) { case PlatformId.Linux: if (LinuxHelper.IsLibCoreApiAlreadyLoaded()) { Helper.InvokeCoreApi(() => LibCoreApi.V1_Measure_StartCollecting(id, groupName)); } break; case PlatformId.MacOsX: if (MacOsXHelper.IsLibCoreApiAlreadyLoaded()) { Helper.InvokeCoreApi(() => LibCoreApi.V1_Measure_StartCollecting(id, groupName)); } break; case PlatformId.Windows: if (WindowsHelper.IsCoreApiDllAlreadyLoaded()) { Helper.InvokeCoreApi(() => CoreApiDll.V1_Measure_StartCollecting(id, groupName)); } break; default: throw new PlatformNotSupportedException(); } }