Skip to content

Commit

Permalink
Revert "The changes reflect the feature request eclipse-openj9#16416
Browse files Browse the repository at this point in the history
…- part 2 following eclipse-openj9#20641"

This reverts commit 81ebf3b.
  • Loading branch information
h3110n3rv3 committed Dec 17, 2024
1 parent 7240761 commit b81e09b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
14 changes: 7 additions & 7 deletions runtime/rastrace/j9rastrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ extern "C" {
* Keywords for options added by J9VM layer.
* =============================================================================
*/
#define RAS_METHODS_KEYWORD "METHODS"
#define RAS_DEBUG_KEYWORD "DEBUG"
#define RAS_TRIGGER_KEYWORD "TRIGGER"
#define RAS_STACKDEPTH_KEYWORD "STACKDEPTH"
#define RAS_SLEEPTIME_KEYWORD "SLEEPTIME"
#define RAS_COMPRESSION_LEVEL_KEYWORD "STACKCOMPRESSIONLEVEL"
#define RAS_METHOD_STRING_LENGTH_KEYWORD "METHODSTRARGLEN"
#define RAS_METHODS_KEYWORD "METHODS"
#define RAS_DEBUG_KEYWORD "DEBUG"
#define RAS_TRIGGER_KEYWORD "TRIGGER"
#define RAS_STACKDEPTH_KEYWORD "STACKDEPTH"
#define RAS_SLEEPTIME_KEYWORD "SLEEPTIME"
#define RAS_COMPRESSION_LEVEL_KEYWORD "STACKCOMPRESSIONLEVEL"
#define RAS_METHOD_STRING_LENGTH_KEYWORD "METHODSTRARGLEN"

/*
* ======================================================================
Expand Down
6 changes: 2 additions & 4 deletions runtime/rastrace/method_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,6 @@ traceMethodArgObject(J9VMThread *thr, UDATA* arg0EA, char* cursor, UDATA length)

char utf8Buffer[128];
UDATA utf8Length = 0;
const unsigned int methodStrArgLength = ((RasGlobalStorage *)thr->javaVM->j9rasGlobalStorage)->methodStrArgLength;
unsigned int strArgLength = methodStrArgLength == 0 ? DEFAULT_STRING_LENGTH : methodStrArgLength;

char *utf8String = vm->internalVMFunctions->copyStringToUTF8WithMemAlloc(
thr,
Expand All @@ -502,8 +500,8 @@ traceMethodArgObject(J9VMThread *thr, UDATA* arg0EA, char* cursor, UDATA length)

if (NULL == utf8String) {
j9str_printf(PORTLIB, cursor, length, "(String)<Memory allocation error>");
} else if (utf8Length > strArgLength) {
j9str_printf(PORTLIB, cursor, length, "(String)\"%.*s\"...", (U_32)strArgLength, utf8String);
} else if (utf8Length > DEFAULT_STRING_LENGTH) {
j9str_printf(PORTLIB, cursor, length, "(String)\"%.*s\"...", (U_32)DEFAULT_STRING_LENGTH, utf8String);
} else {
j9str_printf(PORTLIB, cursor, length, "(String)\"%.*s\"", (U_32)utf8Length, utf8String);
}
Expand Down
5 changes: 1 addition & 4 deletions runtime/rastrace/method_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ static const StackTraceFormattingFunction stackTraceFormattingFunctions[] = {
};

#define NUM_STACK_TRACE_FORMATTING_FUNCTIONS (sizeof(stackTraceFormattingFunctions) / sizeof(stackTraceFormattingFunctions[0]))
#define MAX_STRING_LENGTH 128

/**************************************************************************
* name - rasSetTriggerTrace
Expand Down Expand Up @@ -555,8 +556,6 @@ decimalString2Int(J9PortLibrary* portLibrary, const char *decString, I_32 signed
omr_error_t
setMethodStrArgLength(J9JavaVM *vm, const char *str, BOOLEAN atRuntime)
{
#define MAX_STRING_LENGTH 128

PORT_ACCESS_FROM_JAVAVM(vm);
int value, length;
omr_error_t rc = OMR_ERROR_NONE;
Expand Down Expand Up @@ -588,8 +587,6 @@ setMethodStrArgLength(J9JavaVM *vm, const char *str, BOOLEAN atRuntime)
err:
vaReportJ9VMCommandLineError(PORTLIB, "methodstrarglen takes an unsigned integer value from 1 to %d", MAX_STRING_LENGTH);
return OMR_ERROR_INTERNAL;

#undef MAX_STRING_LENGTH 128
}

/**************************************************************************
Expand Down

0 comments on commit b81e09b

Please sign in to comment.