Lines 131-142
Link Here
|
131 |
} |
131 |
} |
132 |
|
132 |
|
133 |
// Returns batch file extension bat / sh according to current / selected OS |
133 |
// Returns batch file extension bat / sh according to current / selected OS |
|
|
134 |
public static String getBatchExtensionString(String targetPlatform, String customExt) { |
135 |
if (isWindowsPlatform(targetPlatform)) { |
136 |
return customExt + ".bat"; //NOI18N |
137 |
} |
138 |
return customExt + ".sh"; //NOI18N |
139 |
} |
140 |
|
134 |
public static String getBatchExtensionString(String targetPlatform) { |
141 |
public static String getBatchExtensionString(String targetPlatform) { |
135 |
if (isWindowsPlatform(targetPlatform)) { |
142 |
if (isWindowsPlatform(targetPlatform)) { |
136 |
return ".bat"; //NOI18N |
143 |
return ".bat"; //NOI18N |
137 |
} |
144 |
} |
138 |
|
145 |
return ".sh"; |
139 |
return ".sh"; //NOI18N |
|
|
140 |
} |
146 |
} |
141 |
|
147 |
|
142 |
// Returns HTML-formatted hint about how to reduce CPU profiling overhead |
148 |
// Returns HTML-formatted hint about how to reduce CPU profiling overhead |
Lines 355-361
Link Here
|
355 |
} |
361 |
} |
356 |
|
362 |
|
357 |
public static String getManualRemoteStep2(String targetOS, String targetJVM) { |
363 |
public static String getManualRemoteStep2(String targetOS, String targetJVM) { |
358 |
return MessageFormat.format(MANUAL_REMOTE_STEP2_MESSAGE, new Object[] { getRemoteCalibrateCommandString(targetOS) }); //NOI18N |
364 |
return MessageFormat.format(MANUAL_REMOTE_STEP2_MESSAGE, new Object[] { getRemoteCalibrateCommandString(targetOS, targetJVM) }); //NOI18N |
359 |
} |
365 |
} |
360 |
|
366 |
|
361 |
// Returns getLibsDir()/deployed/jdk<15>/<OS> appropriate for current / selected OS |
367 |
// Returns getLibsDir()/deployed/jdk<15>/<OS> appropriate for current / selected OS |
Lines 442-450
Link Here
|
442 |
// Returns extra command line arguments without additional quotes required when attaching on startup |
448 |
// Returns extra command line arguments without additional quotes required when attaching on startup |
443 |
public static String getProfilerAgentCommandLineArgsWithoutQuotes(String targetPlatform, String targetJVM, boolean isRemote, |
449 |
public static String getProfilerAgentCommandLineArgsWithoutQuotes(String targetPlatform, String targetJVM, boolean isRemote, |
444 |
int portNumber) { |
450 |
int portNumber) { |
445 |
return "-agentpath:" + getNativeLibrariesPath(targetPlatform, targetJVM, isRemote) |
451 |
StringBuilder args = new StringBuilder(); |
446 |
+ getDirectorySeparator(targetPlatform) + getProfilerAgentLibraryFile(targetPlatform) + "=" //NOI18N |
452 |
if (targetJVM.equals(PLATFORM_JAVA_60) && (targetPlatform.equals(PLATFORM_LINUX_OS) || targetPlatform.equals(PLATFORM_LINUX_AMD64_OS))) { |
447 |
+ getLibsDir(targetPlatform, isRemote) + "," + portNumber; //NOI18N |
453 |
args.append(" -XX:+UseLinuxPosixThreadCPUClocks "); |
|
|
454 |
} |
455 |
args.append("-agentpath:").append(getNativeLibrariesPath(targetPlatform, targetJVM, isRemote)). |
456 |
append(getDirectorySeparator(targetPlatform)).append(getProfilerAgentLibraryFile(targetPlatform)).append("="). //NOI18N |
457 |
append(getLibsDir(targetPlatform, isRemote)).append(",").append(portNumber); //NOI18N |
458 |
return args.toString(); |
448 |
} |
459 |
} |
449 |
|
460 |
|
450 |
// Returns filename of profiler agent library |
461 |
// Returns filename of profiler agent library |
Lines 472-486
Link Here
|
472 |
} |
483 |
} |
473 |
|
484 |
|
474 |
// Returns calibration batch filename |
485 |
// Returns calibration batch filename |
475 |
public static String getRemoteCalibrateCommandString(String targetPlatform) { |
486 |
public static String getRemoteCalibrateCommandString(String targetPlatform, String targetJava) { |
|
|
487 |
String customExt = isLinuxPlatform(targetPlatform) ? (PLATFORM_JAVA_60.equals(targetJava) ? "-16" : "-15") : ""; |
476 |
return HTML_REMOTE_STRING + getDirectorySeparator(targetPlatform) + "bin" + getDirectorySeparator(targetPlatform) |
488 |
return HTML_REMOTE_STRING + getDirectorySeparator(targetPlatform) + "bin" + getDirectorySeparator(targetPlatform) |
477 |
+ "calibrate" + getBatchExtensionString(targetPlatform); //NOI18N |
489 |
+ "calibrate" + getBatchExtensionString(targetPlatform, customExt); //NOI18N |
478 |
} |
490 |
} |
479 |
|
491 |
|
480 |
// Returns profile batch filename |
492 |
// Returns profile batch filename |
481 |
public static String getRemoteProfileCommandString(String targetPlatform) { |
493 |
public static String getRemoteProfileCommandString(String targetPlatform, String targetJava) { |
|
|
494 |
String customExt = PLATFORM_JAVA_50.equals(targetJava) ? "-15" : "-16"; |
482 |
return HTML_REMOTE_STRING + getDirectorySeparator(targetPlatform) + "bin" + getDirectorySeparator(targetPlatform) |
495 |
return HTML_REMOTE_STRING + getDirectorySeparator(targetPlatform) + "bin" + getDirectorySeparator(targetPlatform) |
483 |
+ "profile" + getBatchExtensionString(targetPlatform); //NOI18N |
496 |
+ "profile" + getBatchExtensionString(targetPlatform, customExt); //NOI18N |
484 |
} |
497 |
} |
485 |
|
498 |
|
486 |
// returns "rem" or "#" according to provided platform |
499 |
// returns "rem" or "#" according to provided platform |
Lines 509-514
Link Here
|
509 |
return targetPlatform.equals(PLATFORM_WINDOWS_OS) || targetPlatform.equals(PLATFORM_WINDOWS_AMD64_OS); |
522 |
return targetPlatform.equals(PLATFORM_WINDOWS_OS) || targetPlatform.equals(PLATFORM_WINDOWS_AMD64_OS); |
510 |
} |
523 |
} |
511 |
|
524 |
|
|
|
525 |
public static boolean isLinuxPlatform(String targetPlatform) { |
526 |
return targetPlatform.equals(PLATFORM_LINUX_OS) || targetPlatform.equals(PLATFORM_LINUX_AMD64_OS); |
527 |
} |
528 |
|
512 |
public static String getXMLCommendEndSign() { |
529 |
public static String getXMLCommendEndSign() { |
513 |
return "-->"; //NOI18N |
530 |
return "-->"; //NOI18N |
514 |
} |
531 |
} |