X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=tests%2Fust-basic-tracing%2Fust-basic-tracing.c;h=d0ba4137d9899ed760194e749b94626fc8d022b1;hb=8de38cf7e2d29984b9a699e90b3e20e9ce0882f3;hp=8e0847fa41c5828828bc9e0a6d94872402b441bb;hpb=a51070bbd35a914f8bf83d774ea92c23e3e059b4;p=lttng-ust.git diff --git a/tests/ust-basic-tracing/ust-basic-tracing.c b/tests/ust-basic-tracing/ust-basic-tracing.c index 8e0847fa..d0ba4137 100644 --- a/tests/ust-basic-tracing/ust-basic-tracing.c +++ b/tests/ust-basic-tracing/ust-basic-tracing.c @@ -56,6 +56,7 @@ static struct object_data metadata_data; static struct object_data channel_data; static struct object_data stream_data[MAX_NR_STREAMS]; static int event_handle[MAX_NR_EVENTS]; +static int context_handle; static int apps_socket = -1; static char apps_sock_path[PATH_MAX]; @@ -564,6 +565,17 @@ int send_app_msgs(int sock, const char *outputpath, printf("received event handle %u\n", event_handle[k]); } + /* Attach pthread_id context */ + memset(&lum, 0, sizeof(lum)); + lum.handle = channel_data.handle; + lum.cmd = LTTNG_UST_CONTEXT; + lum.u.context.ctx = LTTNG_UST_CONTEXT_PTHREAD_ID; + ret = send_app_cmd(sock, &lum, &lur); + if (ret) + return ret; + context_handle = lur.ret_val; + printf("received context handle %u\n", context_handle); + /* Get references to channel streams */ ret = open_streams(sock, channel_data.handle, stream_data, MAX_NR_STREAMS); @@ -604,6 +616,14 @@ int send_app_msgs(int sock, const char *outputpath, if (ret) return ret; + /* Release context */ + memset(&lum, 0, sizeof(lum)); + lum.handle = context_handle; + lum.cmd = LTTNG_UST_RELEASE; + ret = send_app_cmd(sock, &lum, &lur); + if (ret) + return ret; + /* Release events */ for (k = 0; k < nr_events; k++) { memset(&lum, 0, sizeof(lum));