Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add selected tracepoints for OpenJ9 -Xtrace #789

Open
wants to merge 1 commit into
base: openj9
Choose a base branch
from

Conversation

pshipton
Copy link
Member

@pshipton pshipton commented Jan 14, 2025

Depends on eclipse-openj9/openj9#20936

Issue https://github.ibm.com/runtimes/semeru-requests/issues/46

Backport of ibmruntimes/openj9-openjdk-jdk21#243

Linux java(io) tracepoints

20:44:47.651 0x25a00        jcl_java.2         - io_handleOpen(filename=myfile.txt, access=0xc2, sharing=0x1b6, creation=0x0, attributes=0x0, handle=22)
20:44:47.651 0x25a00        jcl_java.4         - io_createFileExclusively_close(handle=22)
20:44:47.651 0x25a00        jcl_java.2         - io_handleOpen(filename=myfile2.txt, access=0x241, sharing=0x1b6, creation=0x0, attributes=0x0, handle=22)
20:44:47.651 0x25a00        jcl_java.0         - io_fileDescriptorClose(handle=22)

Linux net tracepoints

20:33:44.238*0x25a00         jcl_net.1         - NET_Connect(descriptor=15, connect_to(AF_INET6: addr=::ffff:127.0.0.1 port=39451 scope_id=0), length=28)
20:33:44.239 0x25a00         jcl_net.2         - NET_SocketClose(descriptor=15)

20:36:49.028*0x25a00         jcl_net.0         - NET_Connect(descriptor=15, connect_to(AF_INET: addr=127.0.0.1 port=37669), length=16)
20:36:49.028 0x25a00         jcl_net.2         - NET_SocketClose(descriptor=15)

Linux nio tracepoints

20:34:33.088*0x25a00         jcl_nio.1         - nio_ch_Net_Connect(descriptor=22, connect_to(AF_INET6: addr=::ffff:127.0.0.1 port=45177 scope_id=0), length=28)
20:34:33.089 0x25a00         jcl_nio.5         - nio_ch_FileDispatcherImpl_close(descriptor=22)

20:36:14.730*0x25a00         jcl_nio.0         - nio_ch_Net_Connect(descriptor=21, connect_to(AF_INET: addr=127.0.0.1 port=34381), length=16)
20:36:14.731 0x25a00         jcl_nio.5         - nio_ch_FileDispatcherImpl_close(descriptor=21)

Windows java(io) tracepoints

21:17:55.513 0x25a00        jcl_java.2         - io_handleOpen(filename=myfile2.txt, access=0x40000000, sharing=0x3, creation=0x2, attributes=0x80, handle=2100)
21:17:55.513 0x25a00        jcl_java.0         - io_fileDescriptorClose(handle=2100)

Windows net tracepoints

20:42:18.973*0x25a00         jcl_net.4         - PlainSocketImpl_socketConnect(DualStack descriptor=2084, connect_to(AF_INET6: addr=::ffff:127.0.0.1 port=58376 scope_id=0), length=28)
20:42:18.974 0x25a00         jcl_net.5         - PlainSocketImpl_socketClose(DualStack descriptor=2084)

20:44:04.898*0x25a00         jcl_net.3         - PlainSocketImpl_socketConnect(TwoStacks descriptor=2036, connect_to(AF_INET: addr=127.0.0.1 port=58395), length=16)
20:44:04.898 0x25a00         jcl_net.5         - PlainSocketImpl_socketClose(descriptor=2036)

Windows nio tracepoints

20:43:05.217*0x25a00         jcl_nio.1         - nio_ch_Net_Connect(descriptor=2100, connect_to(AF_INET6: addr=::ffff:127.0.0.1 port=58382 scope_id=0), length=28)
20:43:05.217 0x25a00         jcl_nio.4         - nio_ch_SocketDispatcher_close(descriptor=2100)

20:43:43.442*0x25a00         jcl_nio.0         - nio_ch_Net_Connect(descriptor=2060, connect_to(AF_INET: addr=127.0.0.1 port=58391), length=16)
20:43:43.442 0x25a00         jcl_nio.4         - nio_ch_SocketDispatcher_close(descriptor=2060)

xmac java(io) tracepoints

19:10:58.046 0x7f21000        jcl_java.2         - io_handleOpen(filename=myfile.txt, access=0xa02, sharing=0x1b6, creation=0x0, attributes=0x0, handle=20)
19:10:58.046 0x7f21000        jcl_java.4         - io_createFileExclusively_close(handle=20)
19:10:58.046 0x7f21000        jcl_java.2         - io_handleOpen(filename=myfile2.txt, access=0x601, sharing=0x1b6, creation=0x0, attributes=0x0, handle=20)
19:10:58.046 0x7f21000        jcl_java.0         - io_fileDescriptorClose(handle=20)

xmac net tracpoints

21:37:10.164*0x13588500         jcl_net.1         - NET_Connect(descriptor=14, connect_to(AF_INET6: addr=::ffff:127.0.0.1 port=61764 scope_id=0), length=28)
21:37:10.164 0x13588500         jcl_net.2         - NET_SocketClose(descriptor=14)

21:39:59.927*0xa022500         jcl_net.0         - NET_Connect(descriptor=14, connect_to(AF_INET: addr=127.0.0.1 port=61767), length=16)
21:39:59.928 0xa022500         jcl_net.2         - NET_SocketClose(descriptor=14)

xmac nio tracepoints

19:11:52.798*0x1b303000         jcl_nio.1         - nio_ch_Net_Connect(descriptor=20, connect_to(AF_INET6: addr=::ffff:127.0.0.1 port=55700 scope_id=0), length=28)
19:11:52.801 0x1b303000         jcl_nio.5         - nio_ch_FileDispatcherImpl_close(descriptor=20)

19:14:41.534*0xda73000         jcl_nio.0         - nio_ch_Net_Connect(descriptor=20, connect_to(AF_INET: addr=127.0.0.1 port=55709), length=16)
19:14:41.538 0xda73000         jcl_nio.5         - nio_ch_FileDispatcherImpl_close(descriptor=20)

AIX java(io) tracepoints

19:08:14.186 0x30010700        jcl_java.2         - io_handleOpen(filename=myfile.txt, access=0x502, sharing=0x1b6, creation=0x0, attributes=0x0, handle=17)
19:08:14.186 0x30010700        jcl_java.4         - io_createFileExclusively_close(handle=17)
19:08:14.186 0x30010700        jcl_java.2         - io_handleOpen(filename=myfile2.txt, access=0x301, sharing=0x1b6, creation=0x0, attributes=0x0, handle=17)
19:08:14.187 0x30010700        jcl_java.0         - io_fileDescriptorClose(handle=17)

AIX net tracepoints

02:11:41.304*0x30010700         jcl_net.1         - NET_Connect(descriptor=11, connect_to(AF_INET6: addr=::ffff:127.0.0.1 port=43613 scope_id=0), length=28)
02:11:41.305 0x30010700         jcl_net.2         - NET_SocketClose(descriptor=11)

02:12:21.644*0x30010700         jcl_net.0         - NET_Connect(descriptor=12, connect_to(AF_INET: addr=127.0.0.1 port=43616), length=16)
02:12:21.645 0x30010700         jcl_net.2         - NET_SocketClose(descriptor=12)

AIX nio tracepoints

19:09:22.459*0x30010700         jcl_nio.1         - nio_ch_Net_Connect(descriptor=9, connect_to(AF_INET6: addr=::ffff:127.0.0.1 port=40894 scope_id=0), length=28)
19:09:22.460 0x30010700         jcl_nio.5         - nio_ch_FileDispatcherImpl_close(descriptor=9)

19:09:52.063*0x30010700         jcl_nio.0         - nio_ch_Net_Connect(descriptor=17, connect_to(AF_INET: addr=127.0.0.1 port=40897), length=16)
19:09:52.064 0x30010700         jcl_nio.5         - nio_ch_FileDispatcherImpl_close(descriptor=17)

@pshipton
Copy link
Member Author

Fixed compilation on AIX and Mac.

@pshipton pshipton force-pushed the jcltracepoints branch 2 times, most recently from 0b66620 to 49366bd Compare January 21, 2025 02:33
Comment on lines 37 to 39
/* These definitions required by j9.h are in the OpenJ9 jni.h, but OpenJDK jni.h is used here. */
struct GCStatus;
typedef struct GCStatus GCStatus;
struct JavaVMQuery;
typedef struct JavaVMQuery JavaVMQuery;
struct JVMExtensionInterface_;
typedef const struct JVMExtensionInterface_ *JVMExt;

#define COPY_PROGRESS_INFO_MASK 0
#if defined(AIX)
#define AIXPPC
#define RS6000
#endif /* defined(AIX) */
#if defined(MACOSX)
#define OSX
#endif /* defined(MACOSX) */
#if defined(WIN32)
#define OMR_OS_WINDOWS
#endif /* defined(WIN32) */

#include "j9.h"
#include "tracehelp.c"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this sequence should be captured in a new header file (perhaps in openj9) to eliminate the repetition.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created jcltracepoints.h in the OpenJ9 include directory.

@pshipton
Copy link
Member Author

@paulcheeseman are you happy with these tracepoints?

@pshipton pshipton force-pushed the jcltracepoints branch 2 times, most recently from 2336c23 to aa11d15 Compare January 23, 2025 22:05
@paulcheeseman
Copy link

@pshipton

are you happy with these tracepoints?

The output you posted above looks good to me.

@pshipton pshipton force-pushed the jcltracepoints branch 2 times, most recently from a371faf to f757271 Compare January 27, 2025 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants