public static ProfilingMode getProfilingMode() {
    String profilingModeString = System.getProperty(PROFILING_MODE_PROPERTY, "false");
    switch (profilingModeString) {
      case "false":
        return ProfilingMode.NONE;
      case "true":
        return ProfilingMode.YOURKIT_SAMPLING;
      case "tracing":
        return ProfilingMode.YOURKIT_TRACING;
      default:
        throw new IllegalArgumentException("Invalid value of '" + PROFILING_MODE_PROPERTY + "' system property (accepting only 'false', 'true', 'tracing'): " + profilingModeString);
    }
  }
public static ProfilingMode getProfilingMode()