Esempio n. 1
0
        /// <summary>
        /// Creates a new ProfilerRunner using a ProcessStartInfo and a data writer.
        /// </summary>
        public ProfilerRunner(ProcessStartInfo startInfo, bool useTempFileDatabase, IProfilingDataWriter writer)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (startInfo == null)
            {
                throw new ArgumentNullException("startInfo");
            }

            if (useTempFileDatabase)
            {
                this.database = new TempFileDatabase();
                this.writer   = writer;
                this.profiler = new Controller.Profiler(startInfo, this.database.GetWriter(), OptionWrapper.CreateProfilerOptions());
            }
            else
            {
                this.database = null;
                this.writer   = writer;
                this.profiler = new Controller.Profiler(startInfo, writer, OptionWrapper.CreateProfilerOptions());
            }

            PrintProfilerOptions();
            this.profiler.RegisterFailed   += delegate { MessageService.ShowError("${res:AddIns.Profiler.Messages.RegisterFailed}"); };
            this.profiler.DeregisterFailed += delegate { MessageService.ShowError("${res:AddIns.Profiler.Messages.UnregisterFailed}"); };
            this.profiler.OutputUpdated    += delegate { SetOutputText(profiler.ProfilerOutput); };
            this.profiler.SessionEnded     += delegate { FinishSession(); };
        }
Esempio n. 2
0
        void PrintProfilerOptions()
        {
            var options = OptionWrapper.CreateProfilerOptions();

            LoggingService.Info("Profiler settings:");
            LoggingService.Info("Shared memory size: " + options.SharedMemorySize + " (" + (options.SharedMemorySize / 1024 / 1024) + " MB)");
            LoggingService.Info("Combine recursive calls: " + options.CombineRecursiveFunction);
            LoggingService.Info("Enable DC: " + options.EnableDC);
            LoggingService.Info("Profile .NET internals: " + (!options.DoNotProfileDotNetInternals));
            LoggingService.Info("Track events: " + options.TrackEvents);
        }