Пример #1
0
  public OpUnitMask getUnitMask() {
    OpEvent event = _daemonEvent.getEvent();

    if (event != null) {
      return event.getUnitMask();
    } else {
      return null;
    }
  }
Пример #2
0
  /**
   * Loads a counter configuration from the specified launch configuration.
   *
   * @param config the launch configuration
   */
  public void loadConfiguration(ILaunchConfiguration config) {
    try {
      _enabled = config.getAttribute(OprofileLaunchPlugin.ATTR_COUNTER_ENABLED(_number), false);

      String str =
          config.getAttribute(OprofileLaunchPlugin.ATTR_COUNTER_EVENT(_number), ""); // $NON-NLS-1$
      _daemonEvent.setEvent(_eventFromString(str));

      if (_daemonEvent.getEvent() == null) {
        return;
      }

      int maskValue =
          config.getAttribute(
              OprofileLaunchPlugin.ATTR_COUNTER_UNIT_MASK(_number), OpUnitMask.SET_DEFAULT_MASK);
      _daemonEvent.getEvent().getUnitMask().setMaskValue(maskValue);

      _daemonEvent.setProfileKernel(
          config.getAttribute(OprofileLaunchPlugin.ATTR_COUNTER_PROFILE_KERNEL(_number), false));
      _daemonEvent.setProfileUser(
          config.getAttribute(OprofileLaunchPlugin.ATTR_COUNTER_PROFILE_USER(_number), false));

      _daemonEvent.setResetCount(
          config.getAttribute(
              OprofileLaunchPlugin.ATTR_COUNTER_COUNT(_number),
              OprofileDaemonEvent.COUNT_UNINITIALIZED));
    } catch (CoreException ce) {

    }
  }
Пример #3
0
 /**
  * Saves this counter's configuration into the specified launch configuration.
  *
  * @param config the launch configuration
  */
 public void saveConfiguration(ILaunchConfigurationWorkingCopy config) {
   config.setAttribute(OprofileLaunchPlugin.ATTR_COUNTER_ENABLED(_number), _enabled);
   if (_daemonEvent.getEvent() != null) {
     config.setAttribute(
         OprofileLaunchPlugin.ATTR_COUNTER_EVENT(_number), _daemonEvent.getEvent().getText());
     config.setAttribute(
         OprofileLaunchPlugin.ATTR_COUNTER_UNIT_MASK(_number),
         _daemonEvent.getEvent().getUnitMask().getMaskValue());
   }
   config.setAttribute(
       OprofileLaunchPlugin.ATTR_COUNTER_PROFILE_KERNEL(_number), _daemonEvent.getProfileKernel());
   config.setAttribute(
       OprofileLaunchPlugin.ATTR_COUNTER_PROFILE_USER(_number), _daemonEvent.getProfileUser());
   config.setAttribute(
       OprofileLaunchPlugin.ATTR_COUNTER_COUNT(_number), _daemonEvent.getResetCount());
 }
Пример #4
0
 /**
  * Method setProfileKernel.
  *
  * @param profileKernel whether this counter should count kernel events
  */
 public void setProfileKernel(boolean profileKernel) {
   _daemonEvent.setProfileKernel(profileKernel);
 }
Пример #5
0
 /**
  * Method setEvent.
  *
  * @param event the event for this counter
  */
 public void setEvent(OpEvent event) {
   _daemonEvent.setEvent(event);
 }
Пример #6
0
 /**
  * Method getCount.
  *
  * @return the number of events between samples for this counter
  */
 public int getCount() {
   return _daemonEvent.getResetCount();
 }
Пример #7
0
 /**
  * Method getProfileUser.
  *
  * @return whether this counter is counting user events
  */
 public boolean getProfileUser() {
   return _daemonEvent.getProfileUser();
 }
Пример #8
0
 /**
  * Method getProfileKernel.
  *
  * @return whether this counter is counting kernel events
  */
 public boolean getProfileKernel() {
   return _daemonEvent.getProfileKernel();
 }
Пример #9
0
 /**
  * Method getEvent.
  *
  * @return the event for this counter
  */
 public OpEvent getEvent() {
   return _daemonEvent.getEvent();
 }
Пример #10
0
 /**
  * Method setCount.
  *
  * @param count the number of events between samples for this counter
  */
 public void setCount(int count) {
   _daemonEvent.setResetCount(count);
 }
Пример #11
0
 /**
  * Method setProfileUser.
  *
  * @param profileUser whether this counter should count user events
  */
 public void setProfileUser(boolean profileUser) {
   _daemonEvent.setProfileUser(profileUser);
 }