001    /*
002     *  This file is part of the Jikes RVM project (http://jikesrvm.org).
003     *
004     *  This file is licensed to You under the Eclipse Public License (EPL);
005     *  You may not use this file except in compliance with the License. You
006     *  may obtain a copy of the License at
007     *
008     *      http://www.opensource.org/licenses/eclipse-1.0.php
009     *
010     *  See the COPYRIGHT.txt file distributed with this work for information
011     *  regarding copyright ownership.
012     */
013    package org.mmtk.vm;
014    
015    import org.vmmagic.pragma.Interruptible;
016    import org.vmmagic.pragma.Uninterruptible;
017    
018    
019    @Uninterruptible
020    public abstract class Statistics {
021      /**
022       * Read cycle counter
023       */
024      public abstract long nanoTime();
025    
026      /**
027       * Convert nanoseconds to milliseconds
028       */
029      public abstract double nanosToMillis(long c);
030    
031      /**
032       * Convert nanoseconds to seconds
033       */
034      public abstract double nanosToSecs(long c);
035    
036      /**
037       * Convert milliseconds to nanoseconds
038       */
039      public abstract long millisToNanos(double t);
040    
041      /**
042       * Convert seconds to nanoseconds
043       */
044      public abstract long secsToNanos(double t);
045    
046      /**
047       * Read the cycle counter
048       */
049      public abstract long cycles();
050    
051      /**
052       * Initialize performance events
053       */
054      @Interruptible
055      public abstract void perfEventInit(String events);
056    
057      /**
058       * Read a performance event value
059       */
060      public abstract void perfEventRead(int counter, long[] values);
061    }