Skip to content

Commit

Permalink
Merge pull request #18638 from thallium/getProcessCpuLoad
Browse files Browse the repository at this point in the history
Fix a comment and format
  • Loading branch information
pshipton authored Dec 17, 2023
2 parents 408bdc7 + 8fee9ea commit 2954ed7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,8 @@ public final synchronized double getProcessCpuLoad() {
}
latestCpuTime = cpuTime;

/* First call to this method returns 0 to match the behaviour of the RI.
* If the CpuLoadCompatibility flag is set, the bahaviour is reverted to
* return -1 for compatibility.
/* If no previous timestamps is set, the default behaviour is to return -1.
* If the compatibility flag is set, return 0 to match the behaviour of RI.
*/
if (-1 == oldTime) {
/* Save current counters; next invocation onwards, we use these to
Expand Down
4 changes: 2 additions & 2 deletions runtime/vm/jvminit.c
Original file line number Diff line number Diff line change
Expand Up @@ -4124,8 +4124,8 @@ processVMArgsFromFirstToLast(J9JavaVM * vm)
}

{
IDATA cpuLoadCompatibility = FIND_AND_CONSUME_VMARG(EXACT_MATCH, VMOPT_XXCPULOADCOMPATIBILITY , NULL);
IDATA noCpuLoadCompatibility = FIND_AND_CONSUME_VMARG(EXACT_MATCH, VMOPT_XXNOCPULOADCOMPATIBILITY , NULL);
IDATA cpuLoadCompatibility = FIND_AND_CONSUME_VMARG(EXACT_MATCH, VMOPT_XXCPULOADCOMPATIBILITY, NULL);
IDATA noCpuLoadCompatibility = FIND_AND_CONSUME_VMARG(EXACT_MATCH, VMOPT_XXNOCPULOADCOMPATIBILITY, NULL);
if (cpuLoadCompatibility > noCpuLoadCompatibility) {
vm->extendedRuntimeFlags2 |= J9_EXTENDED_RUNTIME2_CPU_LOAD_COMPATIBILITY;
}
Expand Down

0 comments on commit 2954ed7

Please sign in to comment.