org.eclipse.linuxtools.oprofile.core_1.3.18.201310312000

16:46:06.882 INFO  jd.cli.Main - Decompiling org.eclipse.linuxtools.oprofile.core_1.3.18.201310312000.jar
package org.eclipse.linuxtools.oprofile.core;

import org.eclipse.linuxtools.oprofile.core.daemon.OprofileDaemonEvent;
import org.eclipse.linuxtools.oprofile.core.daemon.OprofileDaemonOptions;

public abstract interface IOpcontrolProvider
{
  public abstract void initModule()
    throws OpcontrolException;
  
  public abstract void deinitModule()
    throws OpcontrolException;
  
  public abstract void reset()
    throws OpcontrolException;
  
  public abstract void dumpSamples()
    throws OpcontrolException;
  
  public abstract void setupDaemon(OprofileDaemonOptions paramOprofileDaemonOptions, OprofileDaemonEvent[] paramArrayOfOprofileDaemonEvent)
    throws OpcontrolException;
  
  public abstract void setupDaemon(OprofileDaemonOptions paramOprofileDaemonOptions, OprofileDaemonEvent[] paramArrayOfOprofileDaemonEvent, String paramString)
    throws OpcontrolException;
  
  public abstract void startCollection()
    throws OpcontrolException;
  
  public abstract void stopCollection()
    throws OpcontrolException;
  
  public abstract void shutdownDaemon()
    throws OpcontrolException;
  
  public abstract void startDaemon()
    throws OpcontrolException;
  
  public abstract void saveSession(String paramString)
    throws OpcontrolException;
  
  public abstract void removeDaemonSetting()
    throws OpcontrolException;
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.IOpcontrolProvider
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core;

import java.util.ArrayList;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.linuxtools.oprofile.core.daemon.OpInfo;
import org.eclipse.linuxtools.oprofile.core.model.OpModelEvent;
import org.eclipse.linuxtools.oprofile.core.model.OpModelImage;

public abstract interface IOpxmlProvider
{
  public abstract IRunnableWithProgress info(OpInfo paramOpInfo);
  
  public abstract IRunnableWithProgress modelData(String paramString1, String paramString2, OpModelImage paramOpModelImage);
  
  public abstract IRunnableWithProgress checkEvents(int paramInt1, int paramInt2, int paramInt3, int[] paramArrayOfInt);
  
  public abstract IRunnableWithProgress sessions(ArrayList<OpModelEvent> paramArrayList);
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.IOpxmlProvider
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;

public class OpcontrolException
  extends CoreException
{
  private static final long serialVersionUID = 8508930482724912901L;
  
  public OpcontrolException(IStatus paramIStatus)
  {
    super(paramIStatus);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.OpcontrolException
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.linuxtools.oprofile.core.daemon.OpEvent;
import org.eclipse.linuxtools.oprofile.core.daemon.OpInfo;
import org.eclipse.linuxtools.oprofile.core.model.OpModelEvent;
import org.eclipse.linuxtools.oprofile.core.model.OpModelImage;
import org.tizen.oprofile.core.OprofileComm;
import org.tizen.oprofile.core.provider.OpcontrolDataProvider;

public abstract class Oprofile
{
  private static OpInfo _info;
  private static String _cpuType;
  
  private static void initializeOprofileModule()
    throws OpcontrolException
  {
    
    if (!isKernelModuleLoaded())
    {
      String str1 = "The OProfile kernel module could not be loaded";
      String str2 = "An error occurred initializing OProfile for use with the plugin. Please check Oprofile to be installed successfully";
      OprofileComm.showErrorDialog(str1, str2, null);
    }
    else
    {
      _initializeOprofileCore();
    }
  }
  
  private static boolean isKernelModuleLoaded()
  {
    String[] arrayOfString = new String[1];
    try
    {
      IRunnableWithProgress localIRunnableWithProgress = OpcontrolDataProvider.checkKernelModule(arrayOfString);
      localIRunnableWithProgress.run(null);
    }
    catch (InvocationTargetException localInvocationTargetException)
    {
      str1 = "The OProfile kernel module could not be loaded";
      str2 = "An error occurred initializing OProfile for use with the plugin. Please check OProfile to be installed successfully";
      OprofileComm.showErrorDialog(str1, str2, localInvocationTargetException);
    }
    catch (InterruptedException localInterruptedException)
    {
      String str1 = "The OProfile kernel module could not be loaded";
      String str2 = "An error occurred initializing OProfile for use with the plugin. Please check OProfile to be installed successfully";
      OprofileComm.showErrorDialog(str1, str2, localInterruptedException);
    }
    setCpuType(arrayOfString[0]);
    return arrayOfString[0] != null;
  }
  
  private static void _initializeOprofile()
    throws OpcontrolException
  {
    OprofileCorePlugin.getDefault().getOpcontrolProvider().initModule();
  }
  
  private static void _initializeOprofileCore()
  {
    _info = OprofileComm.getEventInfo();
  }
  
  public static int getNumberOfCounters()
  {
    return getOpInfo().getNrCounters();
  }
  
  public static double getCpuFrequency()
  {
    return getOpInfo().getCPUSpeed();
  }
  
  public static OpEvent findEvent(String paramString)
  {
    return getOpInfo().findEvent(paramString);
  }
  
  public static OpEvent[] getEvents(int paramInt)
  {
    return getOpInfo().getEvents(paramInt);
  }
  
  public static String getDefaultSamplesDirectory()
  {
    return getOpInfo().getDefault("sample-dir");
  }
  
  public static String getLogFile()
  {
    return getOpInfo().getDefault("log-file");
  }
  
  public static boolean getTimerMode()
  {
    return getOpInfo().getTimerMode();
  }
  
  public static Boolean checkEvent(int paramInt1, int paramInt2, int paramInt3)
  {
    int[] arrayOfInt = new int[1];
    try
    {
      IRunnableWithProgress localIRunnableWithProgress = OprofileCorePlugin.getDefault().getOpxmlProvider().checkEvents(paramInt1, paramInt2, paramInt3, arrayOfInt);
      localIRunnableWithProgress.run(null);
    }
    catch (InvocationTargetException localInvocationTargetException)
    {
      localInvocationTargetException.printStackTrace();
    }
    catch (InterruptedException localInterruptedException)
    {
      localInterruptedException.printStackTrace();
    }
    catch (OpxmlException localOpxmlException)
    {
      OprofileCorePlugin.showErrorDialog("opxmlProvider", localOpxmlException);
      return null;
    }
    if (arrayOfInt[0] == 1) {
      return Boolean.valueOf(true);
    }
    return Boolean.valueOf(false);
  }
  
  public static OpModelEvent[] getEvents()
  {
    OpModelEvent[] arrayOfOpModelEvent = (OpModelEvent[])null;
    ArrayList localArrayList = new ArrayList();
    try
    {
      IRunnableWithProgress localIRunnableWithProgress = OprofileCorePlugin.getDefault().getOpxmlProvider().sessions(localArrayList);
      localIRunnableWithProgress.run(null);
      arrayOfOpModelEvent = new OpModelEvent[localArrayList.size()];
      localArrayList.toArray(arrayOfOpModelEvent);
    }
    catch (InvocationTargetException localInvocationTargetException)
    {
      localInvocationTargetException.printStackTrace();
    }
    catch (InterruptedException localInterruptedException)
    {
      localInterruptedException.printStackTrace();
    }
    catch (OpxmlException localOpxmlException)
    {
      OprofileCorePlugin.showErrorDialog("opxmlProvider", localOpxmlException);
    }
    return arrayOfOpModelEvent;
  }
  
  public static OpModelImage getModelData(String paramString1, String paramString2)
  {
    OpModelImage localOpModelImage = new OpModelImage();
    try
    {
      IRunnableWithProgress localIRunnableWithProgress = OprofileCorePlugin.getDefault().getOpxmlProvider().modelData(paramString1, paramString2, localOpModelImage);
      localIRunnableWithProgress.run(null);
    }
    catch (InvocationTargetException localInvocationTargetException)
    {
      localInvocationTargetException.printStackTrace();
    }
    catch (InterruptedException localInterruptedException)
    {
      localInterruptedException.printStackTrace();
    }
    catch (OpxmlException localOpxmlException)
    {
      OprofileCorePlugin.showErrorDialog("opxmlProvider", localOpxmlException);
      return null;
    }
    return localOpModelImage;
  }
  
  public static void initialize()
  {
    if (_info != null) {
      _info = null;
    }
  }
  
  public static OpInfo getOpInfo()
  {
    try
    {
      if ((_info == null) || (isValid(_info))) {
        initializeOprofileModule();
      }
    }
    catch (OpcontrolException localOpcontrolException)
    {
      localOpcontrolException.printStackTrace();
    }
    return _info;
  }
  
  private static boolean isValid(OpInfo paramOpInfo)
  {
    return paramOpInfo.getNrCounters() == 0 ^ paramOpInfo.getTimerMode();
  }
  
  public static String getCpuType()
  {
    return _cpuType;
  }
  
  public static void setCpuType(String paramString)
  {
    _cpuType = paramString;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.Oprofile
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.ErrorDialog;

class OprofileCorePlugin$1
  implements Runnable
{
  OprofileCorePlugin$1(String paramString1, String paramString2, IStatus paramIStatus) {}
  
  public void run()
  {
    ErrorDialog.openError(null, val$dialogTitle, val$errorMessage, val$status);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.OprofileCorePlugin.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.linuxtools.oprofile.core.linux.LinuxOpcontrolProvider;
import org.eclipse.linuxtools.oprofile.core.linux.LinuxOpxmlProvider;
import org.eclipse.swt.widgets.Display;
import org.osgi.framework.BundleContext;

public class OprofileCorePlugin
  extends Plugin
{
  private static final String PLUGIN_ID = "org.eclipse.linuxtools.oprofile.core";
  private static OprofileCorePlugin plugin;
  private IOpxmlProvider _opxmlProvider;
  
  public OprofileCorePlugin()
  {
    plugin = this;
  }
  
  public void start(BundleContext paramBundleContext)
    throws Exception
  {
    super.start(paramBundleContext);
  }
  
  public void stop(BundleContext paramBundleContext)
    throws Exception
  {
    super.stop(paramBundleContext);
    plugin = null;
  }
  
  public static OprofileCorePlugin getDefault()
  {
    return plugin;
  }
  
  public static String getId()
  {
    return "org.eclipse.linuxtools.oprofile.core";
  }
  
  public IOpxmlProvider getOpxmlProvider()
    throws OpxmlException
  {
    if (_opxmlProvider == null) {
      _opxmlProvider = new LinuxOpxmlProvider();
    }
    return _opxmlProvider;
  }
  
  public IOpcontrolProvider getOpcontrolProvider()
    throws OpcontrolException
  {
    return new LinuxOpcontrolProvider();
  }
  
  public static IStatus createErrorStatus(String paramString, Exception paramException)
  {
    String str = OprofileProperties.getString(paramString + ".error.statusMessage");
    if (paramException == null) {
      return new Status(4, getId(), 0, str, null);
    }
    return new Status(4, getId(), 0, str, paramException);
  }
  
  public static void showErrorDialog(String paramString, CoreException paramCoreException)
  {
    String str1 = OprofileProperties.getString(paramString + ".error.dialog.title");
    final String str2 = OprofileProperties.getString(paramString + ".error.dialog.message");
    final IStatus localIStatus;
    if (paramCoreException == null) {
      localIStatus = createErrorStatus(paramString, null);
    } else {
      localIStatus = paramCoreException.getStatus();
    }
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        ErrorDialog.openError(null, OprofileCorePlugin.this, str2, localIStatus);
      }
    });
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.OprofileCorePlugin
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class OprofileProperties
{
  private static final String BUNDLE_NAME = "org.eclipse.linuxtools.oprofile.core.oprofile";
  private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("org.eclipse.linuxtools.oprofile.core.oprofile");
  
  public static String getString(String paramString)
  {
    try
    {
      return RESOURCE_BUNDLE.getString(paramString);
    }
    catch (MissingResourceException localMissingResourceException) {}
    return '!' + paramString + '!';
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.OprofileProperties
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;

public class OpxmlException
  extends CoreException
{
  private static final long serialVersionUID = 2788304536155025911L;
  
  public OpxmlException(IStatus paramIStatus)
  {
    super(paramIStatus);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.OpxmlException
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core.daemon;

public class OpEvent
{
  private String _name;
  private int _number;
  private String _description;
  private OpUnitMask _unitMask;
  private int _minCount;
  
  public void _setUnitMask(OpUnitMask paramOpUnitMask)
  {
    _unitMask = paramOpUnitMask;
  }
  
  public void _setText(String paramString)
  {
    _name = paramString;
  }
  
  public void _setTextDescription(String paramString)
  {
    _description = paramString;
  }
  
  public void _setMinCount(int paramInt)
  {
    _minCount = paramInt;
  }
  
  public void _setNumber(int paramInt)
  {
    _number = paramInt;
  }
  
  public OpUnitMask getUnitMask()
  {
    return _unitMask;
  }
  
  public String getText()
  {
    return _name;
  }
  
  public String getTextDescription()
  {
    return _description;
  }
  
  public int getMinCount()
  {
    return _minCount;
  }
  
  public int getNumber()
  {
    return _number;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.daemon.OpEvent
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core.daemon;

import java.util.Comparator;

class OpInfo$SearchEventComparator
  implements Comparator<Object>
{
  public int compare(Object paramObject1, Object paramObject2)
  {
    String str1;
    String str2;
    if ((paramObject1 instanceof String))
    {
      str1 = (String)paramObject1;
      str2 = ((OpEvent)paramObject2).getText();
    }
    else
    {
      str1 = ((OpEvent)paramObject1).getText();
      str2 = (String)paramObject2;
    }
    return str1.compareTo(str2);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.daemon.OpInfo.SearchEventComparator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core.daemon;

import java.util.Comparator;

class OpInfo$SortEventComparator
  implements Comparator<OpEvent>
{
  public int compare(OpEvent paramOpEvent1, OpEvent paramOpEvent2)
  {
    return paramOpEvent1.getText().compareTo(paramOpEvent2.getText());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.daemon.OpInfo.SortEventComparator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core.daemon;

import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.linuxtools.oprofile.core.IOpxmlProvider;
import org.eclipse.linuxtools.oprofile.core.OprofileCorePlugin;
import org.eclipse.linuxtools.oprofile.core.OpxmlException;

public class OpInfo
{
  public static final String DEFAULT_SAMPLE_DIR = "sample-dir";
  public static final String DEFAULT_LOCK_FILE = "lock-file";
  public static final String DEFAULT_LOG_FILE = "log-file";
  public static final String DEFAULT_DUMP_STATUS = "dump-status";
  private int _nrCounters;
  private HashMap<String, String> _defaults;
  private OpEvent[][] _eventList;
  private double _cpuSpeed;
  private boolean _timerMode;
  
  public static OpInfo getInfo()
  {
    OpInfo localOpInfo = new OpInfo();
    try
    {
      IRunnableWithProgress localIRunnableWithProgress = OprofileCorePlugin.getDefault().getOpxmlProvider().info(localOpInfo);
      localIRunnableWithProgress.run(null);
    }
    catch (InvocationTargetException localInvocationTargetException)
    {
      localInvocationTargetException.printStackTrace();
    }
    catch (InterruptedException localInterruptedException)
    {
      localInterruptedException.printStackTrace();
    }
    catch (OpxmlException localOpxmlException)
    {
      OprofileCorePlugin.showErrorDialog("opxmlProvider", localOpxmlException);
    }
    return localOpInfo;
  }
  
  public void _setNrCounters(int paramInt)
  {
    _nrCounters = paramInt;
    _eventList = new OpEvent[_nrCounters][];
  }
  
  public void _setCPUSpeed(double paramDouble)
  {
    _cpuSpeed = paramDouble;
  }
  
  public void _setDefaults(HashMap<String, String> paramHashMap)
  {
    _defaults = paramHashMap;
  }
  
  public void _setEvents(int paramInt, OpEvent[] paramArrayOfOpEvent)
  {
    if (paramInt < _eventList.length)
    {
      _eventList[paramInt] = paramArrayOfOpEvent;
      Arrays.sort(_eventList[paramInt], new SortEventComparator(null));
    }
  }
  
  public void _setTimerMode(boolean paramBoolean)
  {
    _timerMode = paramBoolean;
  }
  
  public int getNrCounters()
  {
    return _nrCounters;
  }
  
  public double getCPUSpeed()
  {
    return _cpuSpeed;
  }
  
  public String getDefault(String paramString)
  {
    return (String)_defaults.get(paramString);
  }
  
  public OpEvent[] getEvents(int paramInt)
  {
    if ((paramInt >= 0) && (paramInt < _eventList.length)) {
      return _eventList[paramInt];
    }
    return new OpEvent[0];
  }
  
  public boolean getTimerMode()
  {
    return _timerMode;
  }
  
  public OpEvent findEvent(String paramString)
  {
    for (int i = 0; i < getNrCounters(); i++)
    {
      int j = Arrays.binarySearch(getEvents(i), paramString, new SearchEventComparator(null));
      if (j >= 0) {
        return _eventList[i][j];
      }
    }
    return null;
  }
  
  private static class SearchEventComparator
    implements Comparator<Object>
  {
    public int compare(Object paramObject1, Object paramObject2)
    {
      String str1;
      String str2;
      if ((paramObject1 instanceof String))
      {
        str1 = (String)paramObject1;
        str2 = ((OpEvent)paramObject2).getText();
      }
      else
      {
        str1 = ((OpEvent)paramObject1).getText();
        str2 = (String)paramObject2;
      }
      return str1.compareTo(str2);
    }
  }
  
  private static class SortEventComparator
    implements Comparator<OpEvent>
  {
    public int compare(OpEvent paramOpEvent1, OpEvent paramOpEvent2)
    {
      return paramOpEvent1.getText().compareTo(paramOpEvent2.getText());
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.daemon.OpInfo
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core.daemon;

public class OpUnitMask$MaskInfo
{
  public int value;
  public String description;
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.daemon.OpUnitMask.MaskInfo
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core.daemon;

public class OpUnitMask
{
  public static final int SET_DEFAULT_MASK = -1;
  public static final int INVALID = -1;
  public static final int MANDATORY = 1;
  public static final int EXCLUSIVE = 2;
  public static final int BITMASK = 3;
  private int _mask;
  private int _defaultMask;
  private int _maskType;
  private String[] _maskOptionDescriptions = new String[0];
  private int[] _maskOptionValues;
  
  public void _setMaskDescriptions(MaskInfo[] paramArrayOfMaskInfo)
  {
    _maskOptionDescriptions = new String[paramArrayOfMaskInfo.length];
    _maskOptionValues = new int[paramArrayOfMaskInfo.length];
    for (int i = 0; i < paramArrayOfMaskInfo.length; i++)
    {
      _maskOptionDescriptions[i] = description;
      _maskOptionValues[i] = value;
    }
  }
  
  public void _setDefault(int paramInt)
  {
    _defaultMask = paramInt;
    setDefaultMaskValue();
  }
  
  public void _setType(int paramInt)
  {
    _maskType = paramInt;
  }
  
  public int getMaskValue()
  {
    return _mask;
  }
  
  public boolean isMaskSetFromIndex(int paramInt)
  {
    boolean bool = false;
    if ((paramInt >= 0) && (paramInt < _maskOptionValues.length)) {
      switch (_maskType)
      {
      case 2: 
        bool = _mask == _maskOptionValues[paramInt];
        break;
      case 3: 
        bool = (_mask & _maskOptionValues[paramInt]) != 0;
        break;
      default: 
        bool = false;
      }
    }
    return bool;
  }
  
  public void setMaskValue(int paramInt)
  {
    if (paramInt == -1) {
      _mask = _defaultMask;
    } else {
      _mask = paramInt;
    }
  }
  
  public void setMaskFromIndex(int paramInt)
  {
    if ((paramInt >= 0) && (paramInt < _maskOptionValues.length)) {
      if (_maskType == 3) {
        _mask |= _maskOptionValues[paramInt];
      } else if (_maskType == 2) {
        _mask = _maskOptionValues[paramInt];
      }
    }
  }
  
  public int getMaskFromIndex(int paramInt)
  {
    if (_maskType == 3)
    {
      if ((paramInt >= 0) && (paramInt < _maskOptionValues.length)) {
        return _maskOptionValues[paramInt];
      }
    }
    else if (_maskType == 2)
    {
      if ((paramInt >= 0) && (paramInt < _maskOptionValues.length)) {
        return _maskOptionValues[paramInt];
      }
    }
    else if (_maskType == 1) {
      return _defaultMask;
    }
    return -1;
  }
  
  public void unSetMaskFromIndex(int paramInt)
  {
    if ((paramInt >= 0) && (paramInt < _maskOptionValues.length) && (_maskType == 3)) {
      _mask &= (_maskOptionValues[paramInt] ^ 0xFFFFFFFF);
    }
  }
  
  public void setDefaultMaskValue()
  {
    _mask = _defaultMask;
  }
  
  public String getText(int paramInt)
  {
    if ((paramInt >= 0) && (paramInt < _maskOptionDescriptions.length)) {
      return _maskOptionDescriptions[paramInt];
    }
    return null;
  }
  
  public int getNumMasks()
  {
    return _maskOptionDescriptions.length;
  }
  
  public int getType()
  {
    return _maskType;
  }
  
  public static class MaskInfo
  {
    public int value;
    public String description;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.daemon.OpUnitMask
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core.daemon;

import org.eclipse.linuxtools.oprofile.core.Oprofile;

public class OprofileDaemonEvent
{
  public static final int COUNT_UNINITIALIZED = 0;
  public static final int COUNT_INVALID = -1;
  private OpEvent _event = null;
  private boolean _profileKernel = true;
  private boolean _profileUser = true;
  private int _count = 0;
  
  public void setEvent(OpEvent paramOpEvent)
  {
    _event = paramOpEvent;
  }
  
  public OpEvent getEvent()
  {
    return _event;
  }
  
  public void setProfileKernel(boolean paramBoolean)
  {
    _profileKernel = paramBoolean;
  }
  
  public boolean getProfileKernel()
  {
    return _profileKernel;
  }
  
  public void setProfileUser(boolean paramBoolean)
  {
    _profileUser = paramBoolean;
  }
  
  public boolean getProfileUser()
  {
    return _profileUser;
  }
  
  public void setResetCount(int paramInt)
  {
    _count = paramInt;
  }
  
  public int getResetCount()
  {
    if (_count == 0)
    {
      double d = Oprofile.getCpuFrequency();
      if (d == 0.0D) {
        _count = (_event.getMinCount() * 30);
      } else {
        _count = ((int)d * 20);
      }
    }
    return _count;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.daemon.OprofileDaemonEvent
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core.daemon;

public class OprofileDaemonOptions
{
  private String _kernelImageFile = "";
  private boolean _verboseLogging = false;
  private int _separateProfiles = 1;
  private String _binaryImage = "";
  private int _callgraphDepth = 0;
  public static final int SEPARATE_NONE = 0;
  public static final int SEPARATE_LIBRARY = 1;
  public static final int SEPARATE_KERNEL = 2;
  public static final int SEPARATE_THREAD = 4;
  public static final int SEPARATE_CPU = 8;
  
  public String getKernelImageFile()
  {
    return _kernelImageFile;
  }
  
  public void setKernelImageFile(String paramString)
  {
    _kernelImageFile = paramString;
  }
  
  public boolean getVerboseLogging()
  {
    return _verboseLogging;
  }
  
  public void setVerboseLogging(boolean paramBoolean)
  {
    _verboseLogging = paramBoolean;
  }
  
  public int getSeparateProfilesMask()
  {
    return _separateProfiles;
  }
  
  public void setSeparateProfilesMask(int paramInt)
  {
    _separateProfiles = paramInt;
  }
  
  public String getBinaryImage()
  {
    return _binaryImage;
  }
  
  public void setBinaryImage(String paramString)
  {
    _binaryImage = paramString;
  }
  
  public int getCallgraphDepth()
  {
    return _callgraphDepth;
  }
  
  public void setCallgraphDepth(int paramInt)
  {
    _callgraphDepth = paramInt;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.daemon.OprofileDaemonOptions
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core.linux;

import java.util.ArrayList;
import org.eclipse.linuxtools.oprofile.core.IOpcontrolProvider;
import org.eclipse.linuxtools.oprofile.core.OpcontrolException;
import org.eclipse.linuxtools.oprofile.core.Oprofile;
import org.eclipse.linuxtools.oprofile.core.daemon.OpEvent;
import org.eclipse.linuxtools.oprofile.core.daemon.OpUnitMask;
import org.eclipse.linuxtools.oprofile.core.daemon.OprofileDaemonEvent;
import org.eclipse.linuxtools.oprofile.core.daemon.OprofileDaemonOptions;
import org.tizen.oprofile.core.CommandManager;
import org.tizen.oprofile.core.OprofileComm;

public class LinuxOpcontrolProvider
  implements IOpcontrolProvider
{
  private final String OPCONTROL_PROGRAM = "oprofile";
  private static final String _OPD_INIT_MODULE = "init";
  private static final String _OPD_SETUP = "setup";
  private static final String _OPD_SETUP_SEPARATE = "separate=";
  private static final String _OPD_SETUP_SEPARATE_SEPARATOR = ",";
  private static final String _OPD_SETUP_SEPARATE_LIBRARY = "library";
  private static final String _OPD_SETUP_SEPARATE_KERNEL = "kernel";
  private static final String _OPD_SETUP_SEPARATE_THREAD = "thread";
  private static final String _OPD_SETUP_SEPARATE_CPU = "cpu";
  private static final String _OPD_SETUP_EVENT = "event=";
  private static final String _OPD_SETUP_EVENT_SEPARATOR = ":";
  private static final String _OPD_SETUP_EVENT_TRUE = "1";
  private static final String _OPD_SETUP_EVENT_FALSE = "0";
  private static final String _OPD_SETUP_EVENT_DEFAULT = "default";
  private static final String _OPD_SETUP_IMAGE = "image=";
  private static final String _OPD_CALLGRAPH_DEPTH = "callgraph=";
  private static final String _OPD_KERNEL_NONE = "vmlinux=no";
  private static final String _OPD_KERNEL_FILE = "vmlinux=";
  private static final String _OPD_START_DAEMON = "startdaemon";
  private static final String _OPD_START_COLLECTION = "start";
  private static final String _OPD_DUMP = "dump";
  private static final String _OPD_STOP_COLLECTION = "stop";
  private static final String _OPD_SHUTDOWN = "shutdown";
  private static final String _OPD_RESET = "reset";
  private static final String _OPD_SAVE_SESSION = "save ";
  private static final String _OPD_DEINIT_MODULE = "deinit";
  private String _verbosity = "";
  
  public LinuxOpcontrolProvider()
    throws OpcontrolException
  {}
  
  public void deinitModule()
    throws OpcontrolException
  {
    _runOpcontrol("deinit");
  }
  
  public void dumpSamples()
    throws OpcontrolException
  {
    _runOpcontrol("dump");
  }
  
  public void initModule()
    throws OpcontrolException
  {
    _runOpcontrol("init");
  }
  
  public void reset()
    throws OpcontrolException
  {
    _runOpcontrol("reset");
  }
  
  public void saveSession(String paramString)
    throws OpcontrolException
  {
    ArrayList localArrayList = new ArrayList();
    localArrayList.add("save " + paramString);
    _runOpcontrol(localArrayList);
  }
  
  public void setupDaemon(OprofileDaemonOptions paramOprofileDaemonOptions, OprofileDaemonEvent[] paramArrayOfOprofileDaemonEvent)
    throws OpcontrolException
  {
    ArrayList localArrayList = new ArrayList();
    localArrayList.add("setup");
    _optionsToArguments(localArrayList, paramOprofileDaemonOptions);
    if (!Oprofile.getTimerMode()) {
      if ((paramArrayOfOprofileDaemonEvent == null) || (paramArrayOfOprofileDaemonEvent.length == 0)) {
        localArrayList.add("event=default");
      } else {
        for (int i = 0; i < paramArrayOfOprofileDaemonEvent.length; i++) {
          _eventToArguments(localArrayList, paramArrayOfOprofileDaemonEvent[i]);
        }
      }
    }
    _runOpcontrol(localArrayList);
  }
  
  public void setupDaemon(OprofileDaemonOptions paramOprofileDaemonOptions, OprofileDaemonEvent[] paramArrayOfOprofileDaemonEvent, String paramString)
    throws OpcontrolException
  {
    ArrayList localArrayList = new ArrayList();
    localArrayList.add("setup");
    _optionsToArguments(localArrayList, paramOprofileDaemonOptions);
    if (!Oprofile.getTimerMode()) {
      if ((paramArrayOfOprofileDaemonEvent == null) || (paramArrayOfOprofileDaemonEvent.length == 0))
      {
        if (paramString != null) {
          localArrayList.add(paramString);
        }
      }
      else {
        for (int i = 0; i < paramArrayOfOprofileDaemonEvent.length; i++) {
          _eventToArguments(localArrayList, paramArrayOfOprofileDaemonEvent[i]);
        }
      }
    }
    _runOpcontrol(localArrayList);
  }
  
  public void shutdownDaemon()
    throws OpcontrolException
  {
    _runOpcontrol("shutdown");
  }
  
  public void startCollection()
    throws OpcontrolException
  {
    _runOpcontrol("start");
  }
  
  public void startDaemon()
    throws OpcontrolException
  {
    _runOpcontrol("startdaemon");
  }
  
  public void stopCollection()
    throws OpcontrolException
  {
    _runOpcontrol("stop");
  }
  
  private void _runOpcontrol(String paramString)
    throws OpcontrolException
  {
    ArrayList localArrayList = new ArrayList();
    localArrayList.add(paramString);
    _runOpcontrol(localArrayList);
  }
  
  private void _runOpcontrol(ArrayList<String> paramArrayList)
    throws OpcontrolException
  {
    paramArrayList.add(0, OPCONTROL_PROGRAM);
    String str = (String)paramArrayList.get(1);
    if ((_verbosity.length() > 0) && ((str.equals("start")) || (str.equals("startdaemon")))) {
      paramArrayList.add(_verbosity);
    }
    String[] arrayOfString = new String[paramArrayList.size()];
    paramArrayList.toArray(arrayOfString);
    runCommand(arrayOfString);
  }
  
  private void _eventToArguments(ArrayList<String> paramArrayList, OprofileDaemonEvent paramOprofileDaemonEvent)
  {
    String str = new String("event=");
    str = str + paramOprofileDaemonEvent.getEvent().getText();
    str = str + ":";
    str = str + paramOprofileDaemonEvent.getResetCount();
    str = str + ":";
    str = str + paramOprofileDaemonEvent.getEvent().getUnitMask().getMaskValue();
    str = str + ":";
    str = str + (paramOprofileDaemonEvent.getProfileKernel() ? "1" : "0");
    str = str + ":";
    str = str + (paramOprofileDaemonEvent.getProfileUser() ? "1" : "0");
    paramArrayList.add(str);
  }
  
  private void _optionsToArguments(ArrayList<String> paramArrayList, OprofileDaemonOptions paramOprofileDaemonOptions)
  {
    int i = paramOprofileDaemonOptions.getSeparateProfilesMask();
    String str = new String("separate=");
    if (i == 0)
    {
      str = str + "library,kernel";
    }
    else
    {
      if ((i & 0x1) != 0) {
        str = str + "library,";
      }
      if ((i & 0x2) != 0) {
        str = str + "kernel,";
      }
      if ((i & 0x4) != 0) {
        str = str + "thread,";
      }
      if ((i & 0x8) != 0) {
        str = str + "cpu,";
      }
    }
    paramArrayList.add(str);
    if ((paramOprofileDaemonOptions.getKernelImageFile() == null) || (paramOprofileDaemonOptions.getKernelImageFile().length() == 0)) {
      paramArrayList.add("vmlinux=no");
    } else {
      paramArrayList.add("vmlinux=" + paramOprofileDaemonOptions.getKernelImageFile());
    }
    paramArrayList.add("image=" + paramOprofileDaemonOptions.getBinaryImage());
    paramArrayList.add("callgraph=" + paramOprofileDaemonOptions.getCallgraphDepth());
  }
  
  public void removeDaemonSetting()
    throws OpcontrolException
  {
    String[] arrayOfString = { "rm", "-rf", "/home/developer/sdk_tools/.oprofile/daemonrc" };
    runCommand(arrayOfString);
  }
  
  private void runCommand(String[] paramArrayOfString)
    throws OpcontrolException
  {
    String str = OprofileComm.getCommandString(paramArrayOfString);
    CommandManager.runShell(str);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.linux.LinuxOpcontrolProvider
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core.linux;

import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.linuxtools.oprofile.core.daemon.OpInfo;

class LinuxOpxmlProvider$1
  implements IRunnableWithProgress
{
  LinuxOpxmlProvider$1(LinuxOpxmlProvider paramLinuxOpxmlProvider, OpInfo paramOpInfo) {}
  
  public void run(IProgressMonitor paramIProgressMonitor)
    throws InvocationTargetException, InterruptedException
  {
    OpxmlRunner localOpxmlRunner = new OpxmlRunner(LinuxOpxmlProvider.access$0(this$0));
    String[] arrayOfString = { "info" };
    localOpxmlRunner.run(arrayOfString, val$info);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.linux.LinuxOpxmlProvider.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core.linux;

import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.linuxtools.oprofile.core.model.OpModelImage;
import org.eclipse.linuxtools.oprofile.core.opxml.modeldata.ModelDataProcessor.CallData;

class LinuxOpxmlProvider$2
  implements IRunnableWithProgress
{
  LinuxOpxmlProvider$2(LinuxOpxmlProvider paramLinuxOpxmlProvider, String paramString1, String paramString2, OpModelImage paramOpModelImage) {}
  
  public void run(IProgressMonitor paramIProgressMonitor)
    throws InvocationTargetException, InterruptedException
  {
    OpxmlRunner localOpxmlRunner = new OpxmlRunner(LinuxOpxmlProvider.access$0(this$0));
    String[] arrayOfString = { "model-data", val$eventName, val$sessionName };
    ModelDataProcessor.CallData localCallData = new ModelDataProcessor.CallData(val$image);
    localOpxmlRunner.run(arrayOfString, localCallData);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.linux.LinuxOpxmlProvider.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core.linux;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;

class LinuxOpxmlProvider$3
  implements IRunnableWithProgress
{
  LinuxOpxmlProvider$3(LinuxOpxmlProvider paramLinuxOpxmlProvider, int paramInt1, int paramInt2, int paramInt3, int[] paramArrayOfInt) {}
  
  public void run(IProgressMonitor paramIProgressMonitor)
  {
    OpxmlRunner localOpxmlRunner = new OpxmlRunner(LinuxOpxmlProvider.access$0(this$0));
    String[] arrayOfString = { "check-events", Integer.toString(val$ctr), Integer.toString(val$event), Integer.toString(val$um) };
    localOpxmlRunner.run(arrayOfString, val$eventValid);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.linux.LinuxOpxmlProvider.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core.linux;

import java.util.ArrayList;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.linuxtools.oprofile.core.opxml.sessions.SessionsProcessor.SessionInfo;

class LinuxOpxmlProvider$4
  implements IRunnableWithProgress
{
  LinuxOpxmlProvider$4(LinuxOpxmlProvider paramLinuxOpxmlProvider, ArrayList paramArrayList) {}
  
  public void run(IProgressMonitor paramIProgressMonitor)
  {
    OpxmlRunner localOpxmlRunner = new OpxmlRunner(LinuxOpxmlProvider.access$0(this$0));
    String[] arrayOfString = { "sessions" };
    SessionsProcessor.SessionInfo localSessionInfo = new SessionsProcessor.SessionInfo(val$sessionList);
    localOpxmlRunner.run(arrayOfString, localSessionInfo);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.core.linux.LinuxOpxmlProvider.4
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.core.linux;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.linuxtools.oprofile.core.IOpxmlProvider;
import org.eclipse.linuxtools.oprofile.core.OprofileCorePlugin;
import org.eclipse.linuxtools.oprofile.core.OpxmlException;
import org.eclipse.linuxtools.oprofile.core.daemon.OpInfo;
import org.eclipse.linuxtools.oprofile.core.model.OpModelEvent;
import org.eclipse.linuxtools.oprofile.core.model.OpModelImage;
import org.eclipse.linuxtools.oprofile.core.opxml.modeldata.ModelDataProcessor.CallData;
import org.eclipse.linuxtools.oprofile.core.opxml.sessions.SessionsProcessor.SessionInfo;
import org.tizen.oprofile.core.OprofileCommonConstants;

public class LinuxOpxmlProvider
  implements IOpxmlProvider
{
  private String _pathToOpxml = _getOpxmlPath();
  
  public LinuxOpxmlProvider()
    throws OpxmlException
  {
    if (_pathToOpxml == null) {
      throw new OpxmlException(OprofileCorePlugin.createErrorStatus("opxmlProvider", null));
    }
  }
  
  public String _getOpxmlPath()
  {
    String str = OprofileCommonConstants.COMMAND_OPXML;
    return str;
  }
  
  public IRunnableWithProgress info(final OpInfo paramOpInfo)
  {
    
1 2 3 4

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd