Exemplo n.º 1
0
 /*private CTFERecord GetNextEvent(BThread bThread, CTFERecord orig, ref int lastIndex)
  * {
  *  int index = bThread.Events.IndexOf(orig, lastIndex);
  *  lastIndex = index;
  *
  *  return bThread.Events[++index];
  * }
  *
  * private ulong FindFirstNotEq(BThread bThread, CTFERecord orig, ref int lastIndex)
  * {
  *  int index = bThread.Events.IndexOf(orig, lastIndex);
  *  lastIndex = index;
  *
  *  for (int i = index; i < bThread.Events.Count; i++)
  *  {
  *      if (!bThread.Events[i].match(orig))
  *      {
  *          return bThread.Events[i].time;
  *      }
  *  }
  *
  *  return 0;
  * }
  */
 private void UpdateGcItem(ref BGCItem item, ICollection <BGCItem> items, BThread bThread)
 {
     items.Add(item);
     item.GenerateGenearationInfo();
     bThread.GCMaxDuration = Math.Max(bThread.GCMaxDuration, item.Duration);
     item = new BGCItem {
         BThread = bThread
     };
 }
Exemplo n.º 2
0
        private List <BGCItem> GenerateGCS_EPairs(BThread bThread, IReadOnlyDictionary <string, List <CTFERecord> > gcItems)
        {
            var items = new List <BGCItem>();

            if (gcItems["GC"].Count == 0)
            {
                return(items);
            }

            var gcItem = new BGCItem {
                BThread = bThread
            };
            var isRange = false;

            foreach (var current in gcItems["GC"])
            {
                switch (current.Name())
                {
                case "\"DotNETRuntime:GCSuspendEEBegin_V1\"":
                    if (gcItem.SuspendEEBegin != null)
                    {
                        UpdateGcItem(ref gcItem, items, bThread);
                    }

                    gcItem.SuspendEEBegin = current;
                    isRange = false;
                    break;

                case "\"DotNETRuntime:GCSuspendEEEnd_V1\"":
                    if (gcItem.SuspendEEEnd != null)
                    {
                        UpdateGcItem(ref gcItem, items, bThread);
                    }

                    gcItem.SuspendEEEnd = current;
                    isRange             = false;
                    break;

                case "\"DotNETRuntime:GCRestartEEBegin_V1\"":
                    if (gcItem.RestartEEBegin != null)
                    {
                        UpdateGcItem(ref gcItem, items, bThread);
                    }

                    gcItem.RestartEEBegin = current;
                    isRange = false;
                    break;

                case "\"DotNETRuntime:GCRestartEEEnd_V1\"":
                    if (gcItem.RestartEEEnd != null)
                    {
                        UpdateGcItem(ref gcItem, items, bThread);
                    }

                    gcItem.RestartEEEnd = current;
                    UpdateGcItem(ref gcItem, items, bThread);
                    isRange = false;
                    break;

                case "\"DotNETRuntime:GCGenerationRange\"":
                    gcItem.GCGenerationRanges.Add(current);
                    isRange = true;
                    break;

                default:
                    if (isRange && gcItem.GCGenerationRangesBorder == 0)
                    {
                        gcItem.GCGenerationRangesBorder = current.Time;
                        isRange = false;
                    }

                    break;
                }
            }

            UpdateGcItem(ref gcItem, items, bThread);

            return(items);
        }