[memory-agent] Add ability to enable logging for memory agent

This commit is contained in:
Vitaliy.Bibaev
2019-01-31 18:33:08 +03:00
parent 6ec9efedb4
commit ccfae984f9
3 changed files with 9 additions and 3 deletions
@@ -27,7 +27,6 @@ public class MemoryAgentUtil {
public static void addMemoryAgent(JavaParameters parameters) {
if (!Registry.is("debugger.enable.memory.agent")) {
return;
}
@@ -56,7 +55,12 @@ public class MemoryAgentUtil {
}
LOG.info("Memory agent extracting took " + (System.currentTimeMillis() - start) + " ms");
String path = JavaExecutionUtil.handleSpacesInAgentPath(extractedAgent.getAbsolutePath(), "debugger-memory-agent", null);
String path = JavaExecutionUtil.handleSpacesInAgentPath(agentFile.getAbsolutePath(), "debugger-memory-agent", null);
String args = "";
if (Registry.is("debugger.memory.agent.debug")) {
args = "5";// Enable debug messages
}
path += "=" + args;
parametersList.add("-agentpath:" + path);
}
@@ -207,7 +207,7 @@ public class OutputChecker {
result = StringUtil.replace(result, "Process finished with exit code 255", "Process finished with exit code -1");
result = result.replaceAll(" -javaagent:.*debugger-agent\\.jar", "");
result = result.replaceAll(" -agentpath:.*memory_agent\\.\\w*", "");
result = result.replaceAll(" -agentpath:.*memory_agent\\.\\w*=", "");
result = result.replaceAll("!HOST_NAME!:\\d*", "!HOST_NAME!:!HOST_PORT!");
result = result.replaceAll("at '.*?'", "at '!HOST_NAME!:PORT_NAME!'");
result = result.replaceAll("address: '.*?'", "address: '!HOST_NAME!:PORT_NAME!'");
@@ -354,6 +354,8 @@ debugger.enable.memory.view=true
debugger.enable.overhead.monitor=true
debugger.enable.memory.agent=false
debugger.enable.memory.agent.description=Allow to start java debug sessions with attached debugger memory agent
debugger.memory.agent.debug=false
debugger.memory.agent.debug.description=Enable debug logging to stdout from memory agent
debugger.tree.states.depth=100
debugger.new.threads.view=false
debugger.breakpoints.caller.filter=true