jVerbs trace options (Linux only)
You can trace jVerbs runtime calls down to the native level by using the standard trace options, including sending the trace output to a file.
Note: The RDMA implementation is deprecated and will likely be removed in a
future release of IBM® SDK, Java™ Technology Edition, Version 8. A possible alternative is the open source Libfabric
library.
A native implementation of the jVerbs interface is provided. Each Java call from your application makes a native call to the rdmacm or ibverbs libraries, to do remote direct memory access (RDMA) operations by using the Java Native Interface (JNI). The Java calls are routed to the native layer by internal, native dispatcher classes.
You can trace Java method calls and native method calls.
Tracing Java method calls
The jVerbs interface contains the following Java packages:
- com.ibm.net.rdma.jverbs.cm
- Connection management classes that access the rdmacm library.
- com.ibm.net.rdma.jverbs.verbs
- Verbs classes that access the ibverbs library.
- com.ibm.net.rdma.jverbs.endpoints
- An endpoint abstraction class that uses classes from the cm and verbs packages.
-Xtrace:methods={com.ibm.net.rdma.jverbs.*},print=mt
Use a more
specific pattern to trace classes at the level that you require. For example, to trace methods from
all connection management native classes, use the following command-line
option:-Xtrace:methods={com.ibm.net.rdma.jverbs.cm.Native*},print=mt
Tracing native method calls
Use the JVERBS trace point component to trace native method calls within the runtime environment.
You can trace native method entry, parameters, normal exit, and abnormal exit with error numbers.
For example:
-Xtrace:print=JVERBS
This command-line option produces output
similar to the following
text:06:22:48.672 0x21b21100 JVERBS.4 > NativeRdmaCM_createEventChannel()
06:22:48.674 0x21b21100 JVERBS.5 < NativeRdmaCM_createEventChannel(channel->fd=41,
channel=00007F9A643427A0) event channel created
06:22:48.675 0x21b21100 JVERBS.7 > NativeRdmaCM_createId(channel->fd=41, rdma_ps=262)
06:22:48.675 0x21b21100 JVERBS.8 - NativeRdmaCM_createId(channel=00007F9A643427A0, rdma_ps=262) Calling
rdma_create_id
06:22:48.675 0x21b21100 JVERBS.9 < NativeRdmaCM_createId(listen_id=00007F9A6433CB20) listen id created
06:22:48.685 0x21b21100 JVERBS.18 > NativeRdmaCM_bindAddr(id=00007F9A6433CB20, address=00007F9A643415E0)
06:22:48.685 0x21b21100 JVERBS.19 - NativeRdmaCM_bindAddr(cm_listen_id=00007F9A6433CB20) Calling
rdma_bind_addr
06:22:48.685 0x21b21100 JVERBS.20 < NativeRdmaCM_bindAddr() Passed
06:22:48.685 0x21b21100 JVERBS.23 > NativeRdmaCM_listen(id=1681115936, backlog=10)
06:22:48.685 0x21b21100 JVERBS.24 - NativeRdmaCM_listen(cm_listen_id=00007F9A6433CB20) Calling rdma_listen
06:22:48.685 0x21b21100 JVERBS.25 < NativeRdmaCM_listen() Passed
06:22:48.685 0x21b21100 JVERBS.38 > NativeRdmaCM_getCmEvent(channel=41, event=00007F9A643414D0,
listen_id=00007F9A643414D4, client_id=00007F9A643414DC)
06:22:48.685 0x21b21100 JVERBS.39 - NativeRdmaCM_getCmEvent(cm_channel=00007F9A643427A0) Calling
rdma_get_cm_event
06:23:32.329 0x21b21100 JVERBS.40 < NativeRdmaCM_getCmEvent(_event=4, _client_id=00007F9A64342930,
_listen_id=00007F9A6433CB20, cm_event->id->verbs->cmd_fd=39, cm_event->id->verbs=00007F9A6433D090,
cm_event=00007F9A643427C0) Passed
06:23:32.330 0x21b21100 JVERBS.92 > NativeRdmaCM_getContext(id=00007F9A6433CB20)
06:23:32.330 0x21b21100 JVERBS.93 - NativeRdmaCM_getContext(cm_listen_id=00007F9A6433CB20)
06:23:32.330 0x21b21100 JVERBS.94 < NativeRdmaCM_getContext(context=00007F9A6433D090, context->cmd_fd=39)
Passed
You can combine Java and native method tracing as shown by
the following
example:
-Xtrace:methods={com.ibm.net.rdma.jverbs.*},print=mt,print=JVERBS
For more information about tracing, trace components, and trace points, see the following topics:
- -Xtrace in the OpenJ9 user documentation
- Determining the tracepoint ID of a trace point in the J9 VM reference