Package one.nio.os.perf
Class Perf
- java.lang.Object
-
- one.nio.os.perf.Perf
-
public class Perf extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static intANY_CPUstatic intANY_PIDstatic intCURRENT_PID(package private) static intIOCTL_DISABLE(package private) static intIOCTL_ENABLE(package private) static intIOCTL_ID(package private) static intIOCTL_PAUSE_OUTPUT(package private) static intIOCTL_PERIOD(package private) static intIOCTL_REFRESH(package private) static intIOCTL_RESET(package private) static intIOCTL_SET_BPF(package private) static intIOCTL_SET_FILTER(package private) static intIOCTL_SET_OUTPUTstatic booleanIS_SUPPORTED
-
Constructor Summary
Constructors Constructor Description Perf()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclose(int fd)private static RingBuffercreateRingBuffer(int fd, PerfOption... options)(package private) static longget(int fd)(package private) static voidgetValue(int fd, long[] value, int off, int len)private static booleanhasOption(PerfOption[] options, PerfOption option)(package private) static voidioctl(int fd, int cmd, int arg)static PerfCounteropen(PerfEvent event, int pid, int cpu, PerfOption... options)static PerfCounteropen(PerfEvent event, java.lang.String cgroup, int cpu, PerfOption... options)(package private) static intopenEvent(int pid, int cpu, int type, long config, int breakpoint, int group, java.lang.String options)static intopenFile(java.lang.String fileName)static PerfCounterGlobalopenGlobal(PerfEvent event, int pid, PerfOption... options)private static PerfOptionoption(PerfOption[] options, java.lang.String name)private static longoptionBits(PerfOption[] options, java.lang.String name)private static java.lang.StringoptionString(PerfOption[] options)private static longoptionValue(PerfOption[] options, java.lang.String name)
-
-
-
Field Detail
-
IS_SUPPORTED
public static final boolean IS_SUPPORTED
-
CURRENT_PID
public static final int CURRENT_PID
- See Also:
- Constant Field Values
-
ANY_PID
public static final int ANY_PID
- See Also:
- Constant Field Values
-
ANY_CPU
public static final int ANY_CPU
- See Also:
- Constant Field Values
-
IOCTL_RESET
@Native static final int IOCTL_RESET
- See Also:
- Constant Field Values
-
IOCTL_ENABLE
@Native static final int IOCTL_ENABLE
- See Also:
- Constant Field Values
-
IOCTL_DISABLE
@Native static final int IOCTL_DISABLE
- See Also:
- Constant Field Values
-
IOCTL_REFRESH
@Native static final int IOCTL_REFRESH
- See Also:
- Constant Field Values
-
IOCTL_PERIOD
@Native static final int IOCTL_PERIOD
- See Also:
- Constant Field Values
-
IOCTL_SET_OUTPUT
@Native static final int IOCTL_SET_OUTPUT
- See Also:
- Constant Field Values
-
IOCTL_SET_FILTER
@Native static final int IOCTL_SET_FILTER
- See Also:
- Constant Field Values
-
IOCTL_ID
@Native static final int IOCTL_ID
- See Also:
- Constant Field Values
-
IOCTL_SET_BPF
@Native static final int IOCTL_SET_BPF
- See Also:
- Constant Field Values
-
IOCTL_PAUSE_OUTPUT
@Native static final int IOCTL_PAUSE_OUTPUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
open
public static PerfCounter open(PerfEvent event, int pid, int cpu, PerfOption... options) throws java.io.IOException
- Throws:
java.io.IOException
-
open
public static PerfCounter open(PerfEvent event, java.lang.String cgroup, int cpu, PerfOption... options) throws java.io.IOException
- Throws:
java.io.IOException
-
openGlobal
public static PerfCounterGlobal openGlobal(PerfEvent event, int pid, PerfOption... options) throws java.io.IOException
- Throws:
java.io.IOException
-
createRingBuffer
private static RingBuffer createRingBuffer(int fd, PerfOption... options) throws java.io.IOException
- Throws:
java.io.IOException
-
optionString
private static java.lang.String optionString(PerfOption[] options)
-
optionValue
private static long optionValue(PerfOption[] options, java.lang.String name)
-
option
private static PerfOption option(PerfOption[] options, java.lang.String name)
-
optionBits
private static long optionBits(PerfOption[] options, java.lang.String name)
-
hasOption
private static boolean hasOption(PerfOption[] options, PerfOption option)
-
openEvent
static int openEvent(int pid, int cpu, int type, long config, int breakpoint, int group, java.lang.String options) throws java.io.IOException- Throws:
java.io.IOException
-
openFile
public static int openFile(java.lang.String fileName) throws java.io.IOException- Throws:
java.io.IOException
-
close
public static void close(int fd)
-
get
static long get(int fd) throws java.io.IOException- Throws:
java.io.IOException
-
getValue
static void getValue(int fd, long[] value, int off, int len) throws java.io.IOException- Throws:
java.io.IOException
-
ioctl
static void ioctl(int fd, int cmd, int arg) throws java.io.IOException- Throws:
java.io.IOException
-
-