Class PerfCounter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    PerfCounterGlobal

    public class PerfCounter
    extends java.lang.Object
    implements java.io.Closeable
    • Field Detail

      • readFormat

        protected final long readFormat
      • fd

        volatile int fd
      • fdUpdater

        static final java.util.concurrent.atomic.AtomicIntegerFieldUpdater<PerfCounter> fdUpdater
    • Constructor Detail

      • PerfCounter

        PerfCounter​(PerfEvent event,
                    RingBuffer ringBuffer,
                    long readFormat,
                    int fd)
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • get

        public long get()
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • getValue

        public CounterValue getValue()
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • getRawValue

        protected long[] getRawValue()
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • newBuffer

        protected long[] newBuffer()
      • toValue

        protected LocalValue toValue​(long[] raw)
      • hasReadFormat

        public boolean hasReadFormat​(int readFormat)
      • reset

        public void reset()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • attachBpf

        public void attachBpf​(int fd)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • enable

        public void enable()
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • disable

        public void disable()
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • refresh

        public void refresh​(int count)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • ioctl

        void ioctl​(int cmd,
                   int arg)
            throws java.io.IOException
        Throws:
        java.io.IOException