projects
/
lttng-ust.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a51070b
)
Add pthread id event context
author
Mathieu Desnoyers
<mathieu.desnoyers@efficios.com>
Wed, 28 Sep 2011 00:09:43 +0000
(20:09 -0400)
committer
Mathieu Desnoyers
<mathieu.desnoyers@efficios.com>
Wed, 28 Sep 2011 00:09:43 +0000
(20:09 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/ust/lttng-ust-abi.h
patch
|
blob
|
blame
|
history
libust/lttng-context-pthread-id.c
patch
|
blob
|
blame
|
history
libust/lttng-ust-abi.c
patch
|
blob
|
blame
|
history
tests/ust-basic-tracing/ust-basic-tracing.c
patch
|
blob
|
blame
|
history
diff --git
a/include/ust/lttng-ust-abi.h
b/include/ust/lttng-ust-abi.h
index ef1e7e542548140f612bcfeaef94d5cdb7c28483..04965387c1c8ad13144569e5c7b14fd41f979031 100644
(file)
--- a/
include/ust/lttng-ust-abi.h
+++ b/
include/ust/lttng-ust-abi.h
@@
-66,7
+66,7
@@
struct lttng_ust_event {
};
enum lttng_ust_context_type {
};
enum lttng_ust_context_type {
- LTTNG_UST_CONTEXT_
VTID
= 0,
+ LTTNG_UST_CONTEXT_
PTHREAD_ID
= 0,
};
struct lttng_ust_context {
};
struct lttng_ust_context {
diff --git
a/libust/lttng-context-pthread-id.c
b/libust/lttng-context-pthread-id.c
index f65968bf3c5f9c681b79de3b4d2778ec228b3859..d5ca230939eef0ad88d3b21d4c09a94b10ead1ff 100644
(file)
--- a/
libust/lttng-context-pthread-id.c
+++ b/
libust/lttng-context-pthread-id.c
@@
-17,8
+17,8
@@
size_t pthread_id_get_size(size_t offset)
{
size_t size = 0;
{
size_t size = 0;
- size += lib_ring_buffer_align(offset, lttng_alignof(
pid_t
));
- size += sizeof(
pid_t
);
+ size += lib_ring_buffer_align(offset, lttng_alignof(
unsigned long
));
+ size += sizeof(
unsigned long
);
return size;
}
return size;
}
@@
-47,8
+47,8
@@
int lttng_add_pthread_id_to_ctx(struct lttng_ctx **ctx)
}
field->event_field.name = "pthread_id";
field->event_field.type.atype = atype_integer;
}
field->event_field.name = "pthread_id";
field->event_field.type.atype = atype_integer;
- field->event_field.type.u.basic.integer.size = sizeof(
pid_t
) * CHAR_BIT;
- field->event_field.type.u.basic.integer.alignment = lttng_alignof(
pid_t
) * CHAR_BIT;
+ field->event_field.type.u.basic.integer.size = sizeof(
unsigned long
) * CHAR_BIT;
+ field->event_field.type.u.basic.integer.alignment = lttng_alignof(
unsigned long
) * CHAR_BIT;
field->event_field.type.u.basic.integer.signedness = lttng_is_signed_type(pid_t);
field->event_field.type.u.basic.integer.reverse_byte_order = 0;
field->event_field.type.u.basic.integer.base = 10;
field->event_field.type.u.basic.integer.signedness = lttng_is_signed_type(pid_t);
field->event_field.type.u.basic.integer.reverse_byte_order = 0;
field->event_field.type.u.basic.integer.base = 10;
diff --git
a/libust/lttng-ust-abi.c
b/libust/lttng-ust-abi.c
index 31306fb2c34e5997ac53ff40f317dc20922d66fd..924b7afaea342684d4510f2f121214a91addc709 100644
(file)
--- a/
libust/lttng-ust-abi.c
+++ b/
libust/lttng-ust-abi.c
@@
-272,8
+272,8
@@
long lttng_abi_add_context(int objd,
return -EPERM;
switch (context_param->ctx) {
return -EPERM;
switch (context_param->ctx) {
- case LTTNG_UST_CONTEXT_
VT
ID:
-
//TODO return lttng_add_vt
id_to_ctx(ctx);
+ case LTTNG_UST_CONTEXT_
PTHREAD_
ID:
+
return lttng_add_pthread_
id_to_ctx(ctx);
default:
return -EINVAL;
}
default:
return -EINVAL;
}
diff --git
a/tests/ust-basic-tracing/ust-basic-tracing.c
b/tests/ust-basic-tracing/ust-basic-tracing.c
index 8e0847fa41c5828828bc9e0a6d94872402b441bb..d0ba4137d9899ed760194e749b94626fc8d022b1 100644
(file)
--- 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 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];
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]);
}
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);
/* 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;
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));
/* Release events */
for (k = 0; k < nr_events; k++) {
memset(&lum, 0, sizeof(lum));
This page took
0.048718 seconds
and
5
git commands to generate.