// template for static creation method new public static EachSourceClass Create(string sourcename, uint size, uint storageOptions, uint sourceFlags) { EventingStorage storage = EventingStorage.CreateLocalStorage(storageOptions, size); if (storage == null) { DebugStub.WriteLine("Failure to create local storage " + sourcename); DebugStub.Break(); return(null); } EachSourceClass Source = new EachSourceClass_Impl(sourcename, storage, sourceFlags); if (Source != null) { if (!Source.Register()) { DebugStub.WriteLine("Error initializing the source " + sourcename); return(null); } } return(Source); }
public static GCEventSource Create(string sourceName, uint typeSize, ulong options) { uint qos = QualityOfService.RecyclableEvents; if (options != 0) { qos |= QualityOfService.OOM_BreakOnRecycle; } EventingStorage storage = EventingStorage.CreateLocalStorage(qos, typeSize); if (storage == null) { return(null); } GCEventSource Logger = new GCEventSource(sourceName, storage, ENABLE_ALL_MASK); if (Logger != null) { Logger.Register(); } return(Logger); }
/// <summary> /// Create and Register a TcpSessionEventsSource. /// </summary> /// <devdoc> /// This should be a Generic when supported. Or use more of the base class (Static?) // BUGBUG AM (later?) /// </devdoc> public static TcpSessionEventsSource Create(string sourceName, uint size, uint storageOptions, // BUGBUG AM: [Flags] enum uint sourceFlags, uint debugFlags) { TcpSessionEventsSource tcpSessionEventsSource = null; EventingStorage eventStorage = EventingStorage.CreateLocalStorage(storageOptions, size); if (eventStorage == null) { DebugStub.WriteLine("Failure to obtain storage for TcpSessionEvents"); DebugStub.Break(); } else { tcpSessionEventsSource = new TcpSessionEventsSource(sourceName, eventStorage, sourceFlags, debugFlags); if (tcpSessionEventsSource == null) { // TODO: Is EventStorage returned here and below if failures occur? DebugStub.WriteLine("Failure to construct TcpSessionEventsSource instance."); DebugStub.Break(); } else { bool registerSucceeded = tcpSessionEventsSource.Register(); if (registerSucceeded == false) { tcpSessionEventsSource = null; DebugStub.WriteLine("Failure to register TcpSessionEventsSource."); DebugStub.Break(); } } } return(tcpSessionEventsSource); }
/// <summary>Fully parameterized and sole constructor.</summary> /// <devdoc>BUGBUG AM: parameterization: have base EP that takes storageoptions and size to elim dup code (generated or not)</devdoc> public TcpSessionEventsSource(string sourceName, EventingStorage storage, uint controlFlags, uint debugOptions) : base(sourceName, storage, controlFlags) { this.debugOptions = debugOptions; }
public static string Two_Format; // leave default SampleSource(string sourceName, EventingStorage storage, uint controlFlags) : base(sourceName, storage, controlFlags) { }
internal EachSourceClass_Impl(string sourceName, EventingStorage storage, uint controlFlags) : base(sourceName, storage, controlFlags) { }