private void DispatchSendingProfilingDataAction(Stream byteStream)
        {
            var streamLength       = byteStream.DeserializeUint32();
            var profilingDataBytes = new byte[streamLength];

            byteStream.Read(profilingDataBytes, 0, profilingDataBytes.Length);

            List <TCallTree> callTrees;

            using (var profilingDataStream = new MemoryStream(profilingDataBytes))
            {
                _metadataDeserializer.DeserializeAllMetadataAndCacheIt(profilingDataStream);

                callTrees = new List <TCallTree>();
                while (profilingDataStream.Position < profilingDataStream.Length)
                {
                    TCallTree callTree = _callTreeFactory.GetCallTree(profilingDataStream, _methodCache);
                    callTrees.Add(callTree);
                }
            }

            var eventArgs = new ProfilingDataUpdateEventArgs <TCallTree>
            {
                Action       = Actions.SendingProfilingData,
                ProfilerType = _profilerType,
                CallTrees    = callTrees
            };

            ThreadPool.QueueUserWorkItem(notUsed => _updateCallback(this, eventArgs));
        }
Exemplo n.º 2
0
 private static void OnUpdateCallback2(object sender, ProfilingDataUpdateEventArgs<SamplingCallTree> eventArgs)
 {
     //    Console.Clear();
     foreach (SamplingCallTree callTree in
         eventArgs.CallTrees)
     {
         Console.WriteLine(callTree.ToString(null));
         Console.WriteLine();
     }
 }
Exemplo n.º 3
0
        private static void OnUpdateCallback(object sender, ProfilingDataUpdateEventArgs<TracingCallTree> eventArgs)
        {
            //   Console.Clear();
            foreach (TracingCallTree callTree in
                eventArgs.CallTrees)
            {
                ulong totalCycleTime = callTree.TotalCycleTime();
                ulong totalUserKernelTime = callTree.TotalUserKernelTime();
                string callTreeString = callTree.ToString((sb, cte) =>
                                                              {
                                                                  decimal cycleTime = totalCycleTime == 0
                                                                                          ? 0
                                                                                          : cte.CycleTime*
                                                                                            (decimal)
                                                                                            totalUserKernelTime/
                                                                                            totalCycleTime/1e7M;

                                                                  sb.AppendFormat(",Tact={0:0.00000}s", cycleTime);
                                                              });
                Console.WriteLine(callTreeString);
                Console.WriteLine();
            }
        }
 private void OnUpdateCallback(object sender, ProfilingDataUpdateEventArgs<SamplingCallTree> eventArgs)
 {
     // if (Interlocked.CompareExchange(ref _enter, 0, 1) == 1)
     {
         lock (_lockObject)
         {
             CallTreeConvertor treeConvertor = new SamplingCallTreeConvertor(eventArgs.CallTrees);
             UpdateUI(treeConvertor);
         }
     }
 }
 private void UpdateCallback(object sender,
     ProfilingDataUpdateEventArgs<StubCallTree> profilingDataUpdateEventArgs)
 {
     _profilingDataUpdateEventArgs = profilingDataUpdateEventArgs;
     _updateCallbackFinishedSync.Set();
 }
 public void TestSetUp()
 {
     _profilingDataUpdateEventArgs = null;
     _updateCallbackFinishedSync.Reset();
 }