예제 #1
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) {

    }
  }
예제 #2
0
 /**
  * Method setProfileUser.
  *
  * @param profileUser whether this counter should count user events
  */
 public void setProfileUser(boolean profileUser) {
   _daemonEvent.setProfileUser(profileUser);
 }