Struct CpuSampleRecord
One CPU stack sample in the trailing CpuSampleSection of a .typhon-trace file (#351). A sample is a single statistical capture of one
thread's call stack (~1 kHz); its call stack is stored once in the section's interned stack table and referenced here by StackIndex.
public readonly struct CpuSampleRecord
- Inherited Members
Remarks
On the wire ThreadSlot is a single byte with 0xFF meaning "unslotted" (a non-Typhon thread — GC / thread-pool / finalizer /
sampler); the reader surfaces that as -1. Samples are stored sorted by Qpc, grouped per ThreadSlot.
Constructors
CpuSampleRecord(long, int, byte, uint)
Construct a CPU stack sample.
public CpuSampleRecord(long qpc, int threadSlot, byte sampleType, uint stackIndex)
Parameters
qpclongQPC timestamp of the sample.
threadSlotintTyphon thread slot, or
-1for a non-Typhon thread.sampleTypebyte0 = Managed (on-CPU), 1 = External (off-CPU).
stackIndexuint0-based index into the section's interned stack table.
Properties
Qpc
QPC timestamp of the sample, in the same time base as TraceFileHeader.SamplingSessionStartQpc.
public long Qpc { get; }
Property Value
SampleType
0 = Managed (on-CPU proxy — cooperative GC mode), 1 = External (off-CPU — preemptive, blocked in native / syscall / I/O).
public byte SampleType { get; }
Property Value
StackIndex
0-based index into the section's interned stack table.
public uint StackIndex { get; }
Property Value
ThreadSlot
Typhon thread slot the sample was taken on, or -1 for a non-Typhon thread.
public int ThreadSlot { get; }