ExceptionHandling = 10,
}
- // mono/profiler/log.h : SAMPLE_*
- public enum LogSampleHitType {
- Cycles = 1,
- Instructions = 2,
- CacheMisses = 3,
- CacheHits = 4,
- Branches = 5,
- BranchMisses = 6,
- }
-
// mono/metadata/profiler.h : MonoProfilerGCRootType
[Flags]
public enum LogHeapRootAttributes {
public sealed class SampleHitEvent : LogEvent {
- public LogSampleHitType Type { get; internal set; }
-
public long ThreadId { get; internal set; }
public IReadOnlyList<long> UnmanagedBacktrace { get; internal set; }
switch (extType) {
case LogEventType.SampleHit:
return new SampleHitEvent {
- Type = (LogSampleHitType) Reader.ReadByte (),
ThreadId = ReadPointer (),
UnmanagedBacktrace = ReadBacktrace (true, false),
ManagedBacktrace = ReadBacktrace (true),
);
emit_event_time (logbuffer, TYPE_SAMPLE | TYPE_SAMPLE_HIT, sample->time);
- emit_byte (logbuffer, SAMPLE_CYCLES);
emit_ptr (logbuffer, (void *) sample->tid);
emit_value (logbuffer, 1);
added an image pointer field to assembly load events
added an exception object field to TYPE_CLAUSE
class unload events no longer exist (they were never emitted)
+ removed type field from TYPE_SAMPLE_HIT
*/
enum {
MONO_PROFILER_GC_HANDLE_DESTROYED,
};
-// Sampling sources
-// Unless you have compiled with --enable-perf-events, only SAMPLE_CYCLES is available
-enum {
- SAMPLE_CYCLES = 1,
- SAMPLE_INSTRUCTIONS,
- SAMPLE_CACHE_MISSES,
- SAMPLE_CACHE_REFS,
- SAMPLE_BRANCHES,
- SAMPLE_BRANCH_MISSES,
- SAMPLE_LAST
-};
-
-
// If you alter MAX_FRAMES, you may need to alter SAMPLE_BLOCK_SIZE too.
#define MAX_FRAMES 32
return NULL;
}
+// For backwards compatibility.
+enum {
+ SAMPLE_CYCLES = 1,
+ SAMPLE_INSTRUCTIONS,
+ SAMPLE_CACHE_MISSES,
+ SAMPLE_CACHE_REFS,
+ SAMPLE_BRANCHES,
+ SAMPLE_BRANCH_MISSES,
+};
+
static const char*
sample_type_name (int type)
{
uint64_t tdiff = decode_uleb128 (p + 1, &p);
LOG_TIME (time_base, tdiff);
time_base += tdiff;
- sample_type = *p++;
+ if (ctx->data_version < 14)
+ sample_type = *p++;
+ else
+ sample_type = SAMPLE_CYCLES;
tstamp = time_base;
} else {
sample_type = decode_uleb128 (p + 1, &p);