Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion perf-tool/src/agentOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ void modifyJLM(const std::string& function, const std::string& command)
auto javaMonitors = json::array();
auto rawMonitors = json::array();
char *crt = dump->begin + dumpOffset;
char str[32];
jint hash;
while(crt < dump->end)
{
if ((*crt) & (JVMTI_MONITOR_JAVA | JVMTI_MONITOR_RAW))
Expand Down Expand Up @@ -360,6 +362,10 @@ void modifyJLM(const std::string& function, const std::string& command)
crt += sizeof(uint64_t);
jMon["monitorName"] = crt;
crt += strlen(crt) + 1;
hash = h2n.convert(*(uint32_t*)crt);
sprintf(str, "0x%x", hash);
jMon["monitorHash"] = str;
crt += sizeof(uint32_t);
if (monType & JVMTI_MONITOR_JAVA)
javaMonitors.push_back(jMon);
else
Expand All @@ -369,7 +375,7 @@ void modifyJLM(const std::string& function, const std::string& command)
{
int monNameDistance = 2*sizeof(char) + 5*sizeof(uint32_t) + 2*sizeof(uint64_t);
char *monName = crt + monNameDistance;
crt += monNameDistance + strlen(monName) + 1;
crt += monNameDistance + strlen(monName) + 1 + sizeof(uint32_t);
}
}
jvmti->Deallocate((unsigned char*)dump);
Expand Down