Table of Contents

Struct CpuSampleRecord

Namespace
Typhon.Profiler
Assembly
Typhon.Profiler.dll

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

qpc long

QPC timestamp of the sample.

threadSlot int

Typhon thread slot, or -1 for a non-Typhon thread.

sampleType byte

0 = Managed (on-CPU), 1 = External (off-CPU).

stackIndex uint

0-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

long

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

byte

StackIndex

0-based index into the section's interned stack table.

public uint StackIndex { get; }

Property Value

uint

ThreadSlot

Typhon thread slot the sample was taken on, or -1 for a non-Typhon thread.

public int ThreadSlot { get; }

Property Value

int