1 11 package org.eclipse.perfmsr.core; 12 13 14 19 public class PerformanceMonitor { 20 21 24 private static final String NATIVE_LIBRARY_NAME= "ivjperf"; 26 29 private static int fgIsLoaded= 0; 30 31 36 public static boolean isLoaded() { 37 if (fgIsLoaded == 0) { 38 try { 39 System.loadLibrary(NATIVE_LIBRARY_NAME); 40 fgIsLoaded= 2; 41 } catch (Throwable e) { 42 e.printStackTrace(); 43 fgIsLoaded= 1; 44 } 45 } 46 return fgIsLoaded == 2; 47 } 48 49 54 public static native void nativeGetPerformanceInfo(long[] counters); 55 56 public static native boolean nativeGetPerformanceCounters(long[] counters); 57 58 public static native String nativeGetUUID(); 59 } 60 | Popular Tags |