From ae49bd0e3646c9ff9afaf3631e2855bfd276c432 Mon Sep 17 00:00:00 2001 From: Nick Kamal Date: Wed, 20 Nov 2024 14:56:43 -0500 Subject: [PATCH] The changes reflect the feature request #16416. Instead of printing the memory address for string arguments, print the actual string at max of 255 characters. Closes: #16416 Signed-off-by: Nick Kamal --- runtime/rastrace/method_trace.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/runtime/rastrace/method_trace.c b/runtime/rastrace/method_trace.c index 20ace5b7652..67c4ae843eb 100644 --- a/runtime/rastrace/method_trace.c +++ b/runtime/rastrace/method_trace.c @@ -20,7 +20,6 @@ * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 *******************************************************************************/ - #include "rommeth.h" #define _UTE_STATIC_ @@ -45,7 +44,7 @@ static char* traceMethodReturnVal(J9VMThread* thr, J9UTF8* signature, void* retu static void traceMethodArgBoolean (J9VMThread *thr, UDATA* arg0EA, char* cursor, UDATA length); static void traceMethodEnter (J9VMThread *thr, J9Method *method, void *receiverAddress, UDATA isCompiled, UDATA doParameters); static void traceMethodArgLong (J9VMThread *thr, UDATA* arg0EA, char* cursor, UDATA length); -static U_8 checkMethod (J9VMThread *thr, J9Method *method, int *stringArgLength); +static U_8 checkMethod (J9VMThread *thr, J9Method *method); /************************************************************************** * name - matchMethod @@ -116,11 +115,10 @@ matchMethod(RasMethodTable * methodTable, J9Method *method) * the trace spec and thus need to be traced. * parameters - Pointer to the current thread * Pointer to the method - * Pointer to int variable to be filled * returns - none *************************************************************************/ static -U_8 checkMethod(J9VMThread *thr, J9Method *method, int *stringArgLength) +U_8 checkMethod(J9VMThread *thr, J9Method *method) { RasMethodTable *methodTable; U_8 flag = J9_RAS_METHOD_SEEN; @@ -145,7 +143,6 @@ U_8 checkMethod(J9VMThread *thr, J9Method *method, int *stringArgLength) if(methodTable->traceInputRetVals == TRUE) { flag |= J9_RAS_METHOD_TRACE_ARGS; - *stringArgLength = methodTable->stringArgLength; } } else { /* Disable all method trace for this method */ @@ -319,7 +316,6 @@ traceMethodExitX(J9VMThread *thr, J9Method *method, UDATA isCompiled, void* exce BOOLEAN setRAMClassExtendedMethodFlagsHelper(J9VMThread *thr, J9Class *clazz, const char **nlsMsgFormat) { - int stringArgLength; J9JavaVM *vm = thr->javaVM; J9Method *method = clazz->ramMethods; U_32 i = 0; @@ -327,7 +323,7 @@ setRAMClassExtendedMethodFlagsHelper(J9VMThread *thr, J9Class *clazz, const char for (i = 0; i < romMethodCount; i++) { U_8 *mtFlag = fetchMethodExtendedFlagsPointer(method); - setExtendedMethodFlags(vm, mtFlag, (checkMethod(thr, method, &stringArgLength) | rasSetTriggerTrace(thr, method))); + setExtendedMethodFlags(vm, mtFlag, (checkMethod(thr, method) | rasSetTriggerTrace(thr, method))); method++; }