/** * Get the command to run when doing profiling. * * @param action the profiling action to perform * @param stop if this is meant to stop the profiling or start it * @param workerPid the PID of the process to profile * @param targetDir the current working directory of the worker process * @return the command to run for profiling. */ private List<String> mkProfileCommand(ProfileAction action, boolean stop, String workerPid, String targetDir) { switch (action) { case JMAP_DUMP: return jmapDumpCmd(workerPid, targetDir); case JSTACK_DUMP: return jstackDumpCmd(workerPid, targetDir); case JPROFILE_DUMP: return jprofileDump(workerPid, targetDir); case JVM_RESTART: return jprofileJvmRestart(workerPid); case JPROFILE_STOP: if (stop) { return jprofileStop(workerPid, targetDir); } return jprofileStart(workerPid); default: return Lists.newArrayList(); } }
/** * Get the command to run when doing profiling * @param action the profiling action to perform * @param stop if this is meant to stop the profiling or start it * @param workerPid the PID of the process to profile * @param targetDir the current working directory of the worker process * @return the command to run for profiling. */ private List<String> mkProfileCommand(ProfileAction action, boolean stop, String workerPid, String targetDir) { switch(action) { case JMAP_DUMP: return jmapDumpCmd(workerPid, targetDir); case JSTACK_DUMP: return jstackDumpCmd(workerPid, targetDir); case JPROFILE_DUMP: return jprofileDump(workerPid, targetDir); case JVM_RESTART: return jprofileJvmRestart(workerPid); case JPROFILE_STOP: if (stop) { return jprofileStop(workerPid, targetDir); } return jprofileStart(workerPid); default: return Lists.newArrayList(); } }