You've already forked linux-packaging-mono
Imported Upstream version 5.12.0.220
Former-commit-id: c477e03582759447177c6d4bf412cd2355aad476
This commit is contained in:
parent
8bd104cef2
commit
8fc30896db
@@ -6,7 +6,7 @@ LIBRARY_SNK = ../mono.snk
|
||||
|
||||
LIB_REFS = System System.Core
|
||||
KEYFILE = $(LIBRARY_SNK)
|
||||
LIB_MCS_FLAGS = /unsafe /publicsign
|
||||
LIB_MCS_FLAGS = /unsafe /publicsign /nowarn:0618
|
||||
|
||||
LIBRARY_WARN_AS_ERROR = yes
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@ namespace Mono.Profiler.Log {
|
||||
HeapEnd = 1 << 4,
|
||||
HeapObject = 2 << 4,
|
||||
HeapRoots = 3 << 4,
|
||||
HeapRootRegister = 4 << 4,
|
||||
HeapRootUnregister = 5 << 4,
|
||||
|
||||
SampleHit = 0 << 4,
|
||||
SampleUnmanagedSymbol = 1 << 4,
|
||||
@@ -74,6 +76,7 @@ namespace Mono.Profiler.Log {
|
||||
AppDomain = 4,
|
||||
Thread = 5,
|
||||
Context = 6,
|
||||
VTable = 7,
|
||||
}
|
||||
|
||||
// mono/utils/mono-counters.h : MONO_COUNTER_*
|
||||
@@ -133,6 +136,7 @@ namespace Mono.Profiler.Log {
|
||||
|
||||
// mono/metadata/profiler.h : MonoProfilerGCRootType
|
||||
[Flags]
|
||||
[Obsolete ("The event field using this enum is no longer produced.")]
|
||||
public enum LogHeapRootAttributes {
|
||||
Pinning = 1 << 8,
|
||||
WeakReference = 2 << 8,
|
||||
@@ -147,6 +151,26 @@ namespace Mono.Profiler.Log {
|
||||
TypeMask = 0xff,
|
||||
}
|
||||
|
||||
// mono/metadata/mono-gc.h : MonoGCRootSource
|
||||
public enum LogHeapRootSource {
|
||||
External = 0,
|
||||
Stack = 1,
|
||||
FinalizerQueue = 2,
|
||||
Static = 3,
|
||||
ThreadStatic = 4,
|
||||
ContextStatic = 5,
|
||||
GCHandle = 6,
|
||||
Jit = 7,
|
||||
Threading = 8,
|
||||
AppDomain = 9,
|
||||
Reflection = 10,
|
||||
Marshal = 11,
|
||||
ThreadPool = 12,
|
||||
Debugger = 13,
|
||||
Handle = 14,
|
||||
Ephemeron = 15,
|
||||
}
|
||||
|
||||
// mono/profiler/log.h : MonoProfilerMonitorEvent
|
||||
public enum LogMonitorEvent {
|
||||
Contention = 1,
|
||||
|
||||
@@ -66,6 +66,10 @@ namespace Mono.Profiler.Log {
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Visit (VTableLoadEvent ev)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Visit (JitEvent ev)
|
||||
{
|
||||
}
|
||||
@@ -94,6 +98,14 @@ namespace Mono.Profiler.Log {
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Visit (HeapRootRegisterEvent ev)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Visit (HeapRootUnregisterEvent ev)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Visit (GCEvent ev)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -161,6 +161,20 @@ namespace Mono.Profiler.Log {
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class VTableLoadEvent : LogEvent {
|
||||
|
||||
public long VTablePointer { get; internal set; }
|
||||
|
||||
public long AppDomainId { get; internal set; }
|
||||
|
||||
public long ClassPointer { get; internal set; }
|
||||
|
||||
internal override void Accept (LogEventVisitor visitor)
|
||||
{
|
||||
visitor.Visit (this);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class JitEvent : LogEvent {
|
||||
|
||||
public long MethodPointer { get; internal set; }
|
||||
@@ -195,8 +209,11 @@ namespace Mono.Profiler.Log {
|
||||
|
||||
public sealed class AllocationEvent : LogEvent {
|
||||
|
||||
[Obsolete ("This field is no longer produced.")]
|
||||
public long ClassPointer { get; internal set; }
|
||||
|
||||
public long VTablePointer { get; internal set; }
|
||||
|
||||
public long ObjectPointer { get; internal set; }
|
||||
|
||||
public long ObjectSize { get; internal set; }
|
||||
@@ -236,8 +253,11 @@ namespace Mono.Profiler.Log {
|
||||
|
||||
public long ObjectPointer { get; internal set; }
|
||||
|
||||
[Obsolete ("This field is no longer produced.")]
|
||||
public long ClassPointer { get; internal set; }
|
||||
|
||||
public long VTablePointer { get; internal set; }
|
||||
|
||||
public long ObjectSize { get; internal set; }
|
||||
|
||||
public IReadOnlyList<HeapObjectReference> References { get; internal set; }
|
||||
@@ -252,13 +272,18 @@ namespace Mono.Profiler.Log {
|
||||
|
||||
public struct HeapRoot {
|
||||
|
||||
public long AddressPointer { get; internal set; }
|
||||
|
||||
public long ObjectPointer { get; internal set; }
|
||||
|
||||
[Obsolete ("This field is no longer produced.")]
|
||||
public LogHeapRootAttributes Attributes { get; internal set; }
|
||||
|
||||
[Obsolete ("This field is no longer produced.")]
|
||||
public long ExtraInfo { get; internal set; }
|
||||
}
|
||||
|
||||
[Obsolete ("This field is no longer produced.")]
|
||||
public long MaxGenerationCollectionCount { get; internal set; }
|
||||
|
||||
public IReadOnlyList<HeapRoot> Roots { get; internal set; }
|
||||
@@ -269,6 +294,34 @@ namespace Mono.Profiler.Log {
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class HeapRootRegisterEvent : LogEvent {
|
||||
|
||||
public long RootPointer { get; internal set; }
|
||||
|
||||
public long RootSize { get; internal set; }
|
||||
|
||||
public LogHeapRootSource Source { get; internal set; }
|
||||
|
||||
public long Key { get; internal set; }
|
||||
|
||||
public string Name { get; internal set; }
|
||||
|
||||
internal override void Accept (LogEventVisitor visitor)
|
||||
{
|
||||
visitor.Visit (this);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class HeapRootUnregisterEvent : LogEvent {
|
||||
|
||||
public long RootPointer { get; internal set; }
|
||||
|
||||
internal override void Accept (LogEventVisitor visitor)
|
||||
{
|
||||
visitor.Visit (this);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class GCEvent : LogEvent {
|
||||
|
||||
public LogGCEvent Type { get; internal set; }
|
||||
|
||||
@@ -127,7 +127,8 @@ namespace Mono.Profiler.Log {
|
||||
case LogEventType.AllocationBacktrace:
|
||||
case LogEventType.AllocationNoBacktrace:
|
||||
ev = new AllocationEvent {
|
||||
ClassPointer = ReadPointer (),
|
||||
ClassPointer = StreamHeader.FormatVersion < 15 ? ReadPointer () : 0,
|
||||
VTablePointer = StreamHeader.FormatVersion >= 15 ? ReadPointer () : 0,
|
||||
ObjectPointer = ReadObject (),
|
||||
ObjectSize = (long) _reader.ReadULeb128 (),
|
||||
Backtrace = ReadBacktrace (extType == LogEventType.AllocationBacktrace),
|
||||
@@ -305,6 +306,16 @@ namespace Mono.Profiler.Log {
|
||||
} else
|
||||
throw new LogException ("Invalid context metadata event.");
|
||||
break;
|
||||
case LogMetadataType.VTable:
|
||||
if (load) {
|
||||
ev = new VTableLoadEvent {
|
||||
VTablePointer = ReadPointer (),
|
||||
AppDomainId = ReadPointer (),
|
||||
ClassPointer = ReadPointer (),
|
||||
};
|
||||
} else
|
||||
throw new LogException ("Invalid VTable metadata event.");
|
||||
break;
|
||||
default:
|
||||
throw new LogException ($"Invalid metadata type ({metadataType}).");
|
||||
}
|
||||
@@ -373,8 +384,8 @@ namespace Mono.Profiler.Log {
|
||||
case LogEventType.MonitorBacktrace:
|
||||
ev = new MonitorEvent {
|
||||
Event = StreamHeader.FormatVersion >= 14 ?
|
||||
(LogMonitorEvent) _reader.ReadByte () :
|
||||
(LogMonitorEvent) ((((byte) type & 0xf0) >> 4) & 0x3),
|
||||
(LogMonitorEvent) _reader.ReadByte () :
|
||||
(LogMonitorEvent) ((((byte) type & 0xf0) >> 4) & 0x3),
|
||||
ObjectPointer = ReadObject (),
|
||||
Backtrace = ReadBacktrace (extType == LogEventType.MonitorBacktrace),
|
||||
};
|
||||
@@ -394,7 +405,8 @@ namespace Mono.Profiler.Log {
|
||||
case LogEventType.HeapObject: {
|
||||
HeapObjectEvent hoe = new HeapObjectEvent {
|
||||
ObjectPointer = ReadObject (),
|
||||
ClassPointer = ReadPointer (),
|
||||
ClassPointer = StreamHeader.FormatVersion < 15 ? ReadPointer () : 0,
|
||||
VTablePointer = StreamHeader.FormatVersion >= 15 ? ReadPointer () : 0,
|
||||
ObjectSize = (long) _reader.ReadULeb128 (),
|
||||
};
|
||||
|
||||
@@ -414,17 +426,22 @@ namespace Mono.Profiler.Log {
|
||||
}
|
||||
|
||||
case LogEventType.HeapRoots: {
|
||||
// TODO: This entire event makes no sense.
|
||||
var hre = new HeapRootsEvent ();
|
||||
var list = new HeapRootsEvent.HeapRoot [(int) _reader.ReadULeb128 ()];
|
||||
|
||||
hre.MaxGenerationCollectionCount = (long) _reader.ReadULeb128 ();
|
||||
if (StreamHeader.FormatVersion < 15)
|
||||
hre.MaxGenerationCollectionCount = (long) _reader.ReadULeb128 ();
|
||||
|
||||
for (var i = 0; i < list.Length; i++) {
|
||||
list [i] = new HeapRootsEvent.HeapRoot {
|
||||
AddressPointer = StreamHeader.FormatVersion >= 15 ? ReadPointer () : 0,
|
||||
ObjectPointer = ReadObject (),
|
||||
Attributes = StreamHeader.FormatVersion == 13 ? (LogHeapRootAttributes) _reader.ReadByte () : (LogHeapRootAttributes) _reader.ReadULeb128 (),
|
||||
ExtraInfo = (long) _reader.ReadULeb128 (),
|
||||
Attributes = StreamHeader.FormatVersion < 15 ?
|
||||
(StreamHeader.FormatVersion == 13 ?
|
||||
(LogHeapRootAttributes) _reader.ReadByte () :
|
||||
(LogHeapRootAttributes) _reader.ReadULeb128 ()) :
|
||||
0,
|
||||
ExtraInfo = StreamHeader.FormatVersion < 15 ? (long) _reader.ReadULeb128 () : 0,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -433,6 +450,20 @@ namespace Mono.Profiler.Log {
|
||||
|
||||
break;
|
||||
}
|
||||
case LogEventType.HeapRootRegister:
|
||||
ev = new HeapRootRegisterEvent {
|
||||
RootPointer = ReadPointer (),
|
||||
RootSize = (long) _reader.ReadULeb128 (),
|
||||
Source = (LogHeapRootSource) _reader.ReadByte (),
|
||||
Key = ReadPointer (),
|
||||
Name = _reader.ReadCString (),
|
||||
};
|
||||
break;
|
||||
case LogEventType.HeapRootUnregister:
|
||||
ev = new HeapRootUnregisterEvent {
|
||||
RootPointer = ReadPointer (),
|
||||
};
|
||||
break;
|
||||
default:
|
||||
throw new LogException ($"Invalid extended event type ({extType}).");
|
||||
}
|
||||
@@ -476,9 +507,9 @@ namespace Mono.Profiler.Log {
|
||||
Section = section,
|
||||
SectionName = section == LogCounterSection.User ? _reader.ReadCString () : null,
|
||||
CounterName = _reader.ReadCString (),
|
||||
Type = (LogCounterType) _reader.ReadByte (),
|
||||
Unit = (LogCounterUnit) _reader.ReadByte (),
|
||||
Variance = (LogCounterVariance) _reader.ReadByte (),
|
||||
Type = StreamHeader.FormatVersion < 15 ? (LogCounterType) _reader.ReadByte () : (LogCounterType) _reader.ReadULeb128 (),
|
||||
Unit = StreamHeader.FormatVersion < 15 ? (LogCounterUnit) _reader.ReadByte () : (LogCounterUnit) _reader.ReadULeb128 (),
|
||||
Variance = StreamHeader.FormatVersion < 15 ? (LogCounterVariance) _reader.ReadByte () : (LogCounterVariance) _reader.ReadULeb128 (),
|
||||
Index = (long) _reader.ReadULeb128 (),
|
||||
};
|
||||
}
|
||||
@@ -498,7 +529,7 @@ namespace Mono.Profiler.Log {
|
||||
if (index == 0)
|
||||
break;
|
||||
|
||||
var counterType = (LogCounterType) _reader.ReadByte ();
|
||||
var counterType = StreamHeader.FormatVersion < 15 ? (LogCounterType) _reader.ReadByte () : (LogCounterType) _reader.ReadULeb128 ();
|
||||
|
||||
object value = null;
|
||||
|
||||
@@ -544,6 +575,9 @@ namespace Mono.Profiler.Log {
|
||||
case LogEventType.RuntimeJitHelper: {
|
||||
var helperType = (LogJitHelper) _reader.ReadByte ();
|
||||
|
||||
if (StreamHeader.FormatVersion < 14)
|
||||
helperType--;
|
||||
|
||||
ev = new JitHelperEvent {
|
||||
Type = helperType,
|
||||
BufferPointer = ReadPointer (),
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Mono.Profiler.Log {
|
||||
public sealed class LogStreamHeader {
|
||||
|
||||
const int MinVersion = 13;
|
||||
const int MaxVersion = 14;
|
||||
const int MaxVersion = 15;
|
||||
|
||||
const int Id = 0x4d505a01;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user