Open docs/tutorials/tutorial1/Client.java, we will be adding (by uncommenting) 7 lines of code to this class...
At the beginning of the file, uncomment the following lines of code to import the X-Trace classes we'll use to instrument their Client class::
import edu.berkeley.xtrace.XTraceContext;
import edu.berkeley.xtrace.XTraceMetadata;
Setup the trace and first report generation by uncommenting the following line of code at the top of the main() function in the Client class::
XTraceContext.startTrace("Client", "Run Tutorial 1" , "tutorial");
Uncomment the following two lines of code which are instrumentation points that will be triggered to send X-Trace reports with each message the client sends to the server::
XTraceContext.logEvent("ChatClient", "SendUsersMessage", "Message", msgObjOut.message);
msgObjOut.xtraceMD = XTraceContext.getThreadContext().pack();
Uncoment two more lines of code which are the instrumentation points that will send a report:
XTraceContext.setThreadContext(XTraceMetadata.createFromBytes(msgObjIn.xtraceMD,0,16));
XTraceContext.logEvent("ChatClient", "ReceivedServersMessage");
Compile Client.java, you will need to include the location of the x-trace
javac -cp /tmp/xtrace/lib/xtrace-2.0.jar:. chatapp/Client.java