Package one.nio.os.perf
Class RingBuffer
- java.lang.Object
-
- one.nio.os.perf.RingBuffer
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
class RingBuffer extends java.lang.Object implements java.io.Closeable
-
-
Field Summary
Fields Modifier and Type Field Description private longaddressprivate static intHEAD_OFFSETprivate longmaskprivate static intPAGE_SIZEprivate static intPERF_RECORD_SAMPLEprivate intsampleTypeprivate static intTAIL_OFFSET
-
Constructor Summary
Constructors Constructor Description RingBuffer(int fd, int pages, int sampleType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()private booleanhasOption(int option)(package private) PerfSamplenextSample()private longreadLong(long offset)private PerfSamplereadSample(long offset)
-
-
-
Field Detail
-
PAGE_SIZE
private static final int PAGE_SIZE
-
HEAD_OFFSET
private static final int HEAD_OFFSET
- See Also:
- Constant Field Values
-
TAIL_OFFSET
private static final int TAIL_OFFSET
- See Also:
- Constant Field Values
-
PERF_RECORD_SAMPLE
private static final int PERF_RECORD_SAMPLE
- See Also:
- Constant Field Values
-
address
private final long address
-
mask
private final long mask
-
sampleType
private final int sampleType
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
nextSample
PerfSample nextSample()
-
readSample
private PerfSample readSample(long offset)
-
hasOption
private boolean hasOption(int option)
-
readLong
private long readLong(long offset)
-
-