Skip to content

Commit

Permalink
Minor cosmetic improvements to trace code
Browse files Browse the repository at this point in the history
* tidy up formatting, indentation
* remove useless assignment

Signed-off-by: Keith W. Campbell <[email protected]>
  • Loading branch information
keithc-ca authored and rmnattas committed Nov 1, 2024
1 parent e9c8f65 commit 9603d39
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 73 deletions.
42 changes: 20 additions & 22 deletions runtime/rastrace/trcengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@ J9VMDllMain(J9JavaVM *vm, IDATA stage, void *reserved)
break;
case TRACE_ENGINE_INITIALIZED:
if (NULL == tempRasGbl) {
/* Storage for RasGlobalStorage not available, trace not enabled */
j9nls_printf(PORTLIB, J9NLS_ERROR | J9NLS_STDERR, J9NLS_TRC_RAS_GLOBAL_STORAGE);
return J9VMDLLMAIN_FAILED;
/* Storage for RasGlobalStorage not available, trace not enabled */
j9nls_printf(PORTLIB, J9NLS_ERROR | J9NLS_STDERR, J9NLS_TRC_RAS_GLOBAL_STORAGE);
return J9VMDLLMAIN_FAILED;
}
/*
* Ensure that method entry and exit hooks are honoured
Expand Down Expand Up @@ -444,9 +444,9 @@ J9VMDllMain(J9JavaVM *vm, IDATA stage, void *reserved)
}
}

/*
* Set up an early version of trace header info
*/
/*
* Set up an early version of trace header info
*/
if (OMR_ERROR_NONE != populateTraceHeaderInfo(vm)) {
return J9VMDLLMAIN_FAILED;
}
Expand All @@ -463,7 +463,6 @@ J9VMDllMain(J9JavaVM *vm, IDATA stage, void *reserved)
break;

case VM_INITIALIZATION_COMPLETE:
tempThr = UT_THREAD_FROM_VM_THREAD(vm->mainThread);
{
/* Force loading of the Trace class. See defect 162723, this is required because of some nuance
* in the early initialization of DB/2 (which uses the Trace class).
Expand Down Expand Up @@ -497,7 +496,6 @@ J9VMDllMain(J9JavaVM *vm, IDATA stage, void *reserved)
break;

case INTERPRETER_SHUTDOWN:

thr = vmFuncs->currentVMThread(vm);

/* if command line argument parsing failed we don't want to try to use an uninitialized trace engine */
Expand Down Expand Up @@ -871,20 +869,20 @@ parseTraceOptions(J9JavaVM *vm, const char *optionString, IDATA optionsLength)
IDATA inBraces = 0;

for (length = 0; length < optionsLength; length++) {
if (optionString[length] == '{') {
inBraces++;
continue;
}
if (optionString[length] == '}') {
if (--inBraces < 0) {
break;
}
continue;
}
if (inBraces == 0 &&
optionString[length] == ',') {
break;
}
if (optionString[length] == '{') {
inBraces++;
continue;
}
if (optionString[length] == '}') {
if (--inBraces < 0) {
break;
}
continue;
}
if (inBraces == 0 &&
optionString[length] == ',') {
break;
}
}
return inBraces == 0 ? length : -1;
}
Expand Down
Loading

0 comments on commit 9603d39

Please sign in to comment.