* Re: UST context causes empty trace
[not found] <518EEC19.6080504@gmail.com>
@ 2013-05-12 3:08 ` Mathieu Desnoyers
[not found] ` <20130512030802.GE405@Krystal>
1 sibling, 0 replies; 5+ messages in thread
From: Mathieu Desnoyers @ 2013-05-12 3:08 UTC (permalink / raw)
To: Francis Giraldeau, dgoulet; +Cc: lttng-dev
Yes, it's broken here too. Can you open a bug report against UST please?
it looks like those are missing when we enable UST contexts:
libust[26034/26049]: Sent register channel notification: chan_id 0, header_type 1
(in ustcomm_register_channel() at lttng-ust-comm.c:1053)
[...]
libust[26034/26034]: Sent register event notification for name "ust_tests_hello:tptest": ret_code 0, event_id 0
(in ustcomm_register_event() at lttng-ust-comm.c:948)
libust[26034/26034]: Sent register event notification for name "ust_tests_hello:tptest_sighandler": ret_code 0, event_id 1
(in ustcomm_register_event() at lttng-ust-comm.c:948)
(I get those in a run where I don't enable any UST context, but not in
the problematic case)
the rest seems to be there when launching the app with LTTNG_UST_DEBUG=1
env var set. So it looks like an issue within UST.
Thanks,
Mathieu
* Francis Giraldeau (francis.giraldeau@gmail.com) wrote:
> With 2.2.0-rc2, when enabling some context for UST, the generated trace
> is empty. Here is a small script to reproduce the problem:
>
> $ cat do.sh
> lttng create
> lttng enable-channel u -u
> lttng enable-event -c u -a -u
> lttng add-context -c u -u -t vpid -t vtid
> lttng start
> $@
> lttng stop
> lttng view
> lttng destroy
>
> When commenting out the "add-context" command, then the trace is
> generated correctly. Does someone else is able to confirm the problem?
>
> Thanks,
>
> Francis Giraldeau
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: UST context causes empty trace
[not found] ` <20130512030802.GE405@Krystal>
@ 2013-05-12 9:27 ` Zifei Tong
[not found] ` <CAJ7wx-EoDjkgv=Pk8RjtbhyRy6eOM7RoJmhBEg5XA_xOxLMgWA@mail.gmail.com>
1 sibling, 0 replies; 5+ messages in thread
From: Zifei Tong @ 2013-05-12 9:27 UTC (permalink / raw)
To: Mathieu Desnoyers; +Cc: lttng-dev
Hi,
I did some debugging one this issue. The problem only occurs when we
have more than one context field.
So this will not work, too:
lttng create
lttng enable-event -a -u
lttng add-context -u -t vpid
lttng add-context -u -t vtid
lttng start
$@
lttng stop
sleep 1
lttng view
lttng destroy
The problem I found out is wrong `fields` argument passed into
`ustcomm_register_channel`.
The `fields` argument passed is a pointer to the `event_field` of the
first element in a `lttng_ctx_field` array,
but not a `lttng_event_field` array as expected.
Please see the patch for more details.
The patch works on my machine. But I wonder if there is something
wrong or maybe a better fix.
Please review.
Thanks,
Zifei Tong
Signed-off-by: Zifei Tong <soariez@gmail.com>
---
liblttng-ust/lttng-events.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c
index e4faf60..7afe13f 100644
--- a/liblttng-ust/lttng-events.c
+++ b/liblttng-ust/lttng-events.c
@@ -260,9 +260,10 @@ int lttng_session_enable(struct lttng_session *session)
*/
cds_list_for_each_entry(chan, &session->chan_head, node) {
const struct lttng_ctx *ctx;
- const struct lttng_event_field *fields = NULL;
+ struct lttng_event_field *fields = NULL;
size_t nr_fields = 0;
uint32_t chan_id;
+ int i;
/* don't change it if session stop/restart */
if (chan->header_type)
@@ -270,7 +271,9 @@ int lttng_session_enable(struct lttng_session *session)
ctx = chan->ctx;
if (ctx) {
nr_fields = ctx->nr_fields;
- fields = &ctx->fields->event_field;
+ fields = malloc(nr_fields * sizeof(struct lttng_event_field));
+ for (i = 0; i < nr_fields; i++)
+ fields[i] = ctx->fields[i].event_field;
}
ret = ustcomm_register_channel(notify_socket,
session->objd,
@@ -279,6 +282,8 @@ int lttng_session_enable(struct lttng_session *session)
fields,
&chan_id,
&chan->header_type);
+ if (fields != NULL)
+ free(fields);
if (ret) {
DBG("Error (%d) registering channel to sessiond", ret);
return ret;
--
1.8.2.2
On 5/12/13, Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:
> Yes, it's broken here too. Can you open a bug report against UST please?
>
> it looks like those are missing when we enable UST contexts:
>
> libust[26034/26049]: Sent register channel notification: chan_id 0,
> header_type 1
> (in ustcomm_register_channel() at lttng-ust-comm.c:1053)
> [...]
> libust[26034/26034]: Sent register event notification for name
> "ust_tests_hello:tptest": ret_code 0, event_id 0
> (in ustcomm_register_event() at lttng-ust-comm.c:948)
> libust[26034/26034]: Sent register event notification for name
> "ust_tests_hello:tptest_sighandler": ret_code 0, event_id 1
> (in ustcomm_register_event() at lttng-ust-comm.c:948)
>
> (I get those in a run where I don't enable any UST context, but not in
> the problematic case)
>
> the rest seems to be there when launching the app with LTTNG_UST_DEBUG=1
> env var set. So it looks like an issue within UST.
>
> Thanks,
>
> Mathieu
>
> * Francis Giraldeau (francis.giraldeau@gmail.com) wrote:
>> With 2.2.0-rc2, when enabling some context for UST, the generated trace
>> is empty. Here is a small script to reproduce the problem:
>>
>> $ cat do.sh
>> lttng create
>> lttng enable-channel u -u
>> lttng enable-event -c u -a -u
>> lttng add-context -c u -u -t vpid -t vtid
>> lttng start
>> $@
>> lttng stop
>> lttng view
>> lttng destroy
>>
>> When commenting out the "add-context" command, then the trace is
>> generated correctly. Does someone else is able to confirm the problem?
>>
>> Thanks,
>>
>> Francis Giraldeau
>>
>
>
>
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev@lists.lttng.org
>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
>
> --
> Mathieu Desnoyers
> EfficiOS Inc.
> http://www.efficios.com
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
--
--
Best Regards,
仝子飞 (Zifei Tong)
College of Computer Science and Technology, Zhejiang University
soariez@gmail.com / tongzifei@zju.edu.cn
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: UST context causes empty trace
[not found] ` <CAJ7wx-EoDjkgv=Pk8RjtbhyRy6eOM7RoJmhBEg5XA_xOxLMgWA@mail.gmail.com>
@ 2013-05-12 15:00 ` Francis Giraldeau
2013-05-13 10:06 ` Mathieu Desnoyers
1 sibling, 0 replies; 5+ messages in thread
From: Francis Giraldeau @ 2013-05-12 15:00 UTC (permalink / raw)
To: lttng-dev
[-- Attachment #1.1: Type: text/plain, Size: 2426 bytes --]
I confirm that this patch solved the problem.
Thanks!
Francis
Le 2013-05-12 05:27, Zifei Tong a écrit :
> Hi,
>
> I did some debugging one this issue. The problem only occurs when we
> have more than one context field.
> So this will not work, too:
>
> lttng create
> lttng enable-event -a -u
> lttng add-context -u -t vpid
> lttng add-context -u -t vtid
> lttng start
> $@
> lttng stop
> sleep 1
> lttng view
> lttng destroy
>
> The problem I found out is wrong `fields` argument passed into
> `ustcomm_register_channel`.
> The `fields` argument passed is a pointer to the `event_field` of the
> first element in a `lttng_ctx_field` array,
> but not a `lttng_event_field` array as expected.
>
> Please see the patch for more details.
>
> The patch works on my machine. But I wonder if there is something
> wrong or maybe a better fix.
> Please review.
>
> Thanks,
>
> Zifei Tong
>
> Signed-off-by: Zifei Tong <soariez@gmail.com>
> ---
> liblttng-ust/lttng-events.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c
> index e4faf60..7afe13f 100644
> --- a/liblttng-ust/lttng-events.c
> +++ b/liblttng-ust/lttng-events.c
> @@ -260,9 +260,10 @@ int lttng_session_enable(struct lttng_session *session)
> */
> cds_list_for_each_entry(chan, &session->chan_head, node) {
> const struct lttng_ctx *ctx;
> - const struct lttng_event_field *fields = NULL;
> + struct lttng_event_field *fields = NULL;
> size_t nr_fields = 0;
> uint32_t chan_id;
> + int i;
>
> /* don't change it if session stop/restart */
> if (chan->header_type)
> @@ -270,7 +271,9 @@ int lttng_session_enable(struct lttng_session *session)
> ctx = chan->ctx;
> if (ctx) {
> nr_fields = ctx->nr_fields;
> - fields = &ctx->fields->event_field;
> + fields = malloc(nr_fields * sizeof(struct lttng_event_field));
> + for (i = 0; i < nr_fields; i++)
> + fields[i] = ctx->fields[i].event_field;
> }
> ret = ustcomm_register_channel(notify_socket,
> session->objd,
> @@ -279,6 +282,8 @@ int lttng_session_enable(struct lttng_session *session)
> fields,
> &chan_id,
> &chan->header_type);
> + if (fields != NULL)
> + free(fields);
> if (ret) {
> DBG("Error (%d) registering channel to sessiond", ret);
> return ret;
[-- Attachment #1.2: Signature cryptographique S/MIME --]
[-- Type: application/pkcs7-signature, Size: 4489 bytes --]
[-- Attachment #2: Type: text/plain, Size: 155 bytes --]
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: UST context causes empty trace
[not found] ` <CAJ7wx-EoDjkgv=Pk8RjtbhyRy6eOM7RoJmhBEg5XA_xOxLMgWA@mail.gmail.com>
2013-05-12 15:00 ` Francis Giraldeau
@ 2013-05-13 10:06 ` Mathieu Desnoyers
1 sibling, 0 replies; 5+ messages in thread
From: Mathieu Desnoyers @ 2013-05-13 10:06 UTC (permalink / raw)
To: Zifei Tong; +Cc: lttng-dev
Fixed by:
commit 83e43212040a26aca40a4f8fefaa3682e9edaa57
Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Date: Mon May 13 06:02:55 2013 -0400
Fix: incorrect support for multi-context
* Zifei Tong <soariez@gmail.com> wrote:
> I did some debugging one this issue. The problem only occurs when we
> have more than one context field.
> So this will not work, too:
>
> lttng create
> lttng enable-event -a -u
> lttng add-context -u -t vpid
> lttng add-context -u -t vtid
> lttng start
> $@
> lttng stop
> sleep 1
> lttng view
> lttng destroy
>
> The problem I found out is wrong `fields` argument passed into
> `ustcomm_register_channel`.
> The `fields` argument passed is a pointer to the `event_field` of the
> first element in a `lttng_ctx_field` array, but not a
> `lttng_event_field` array as expected.
Fixes #529
Reported-by: Francis Giraldeau <francis.giraldeau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thanks!
Mathieu
* Zifei Tong (soariez@gmail.com) wrote:
> Hi,
>
> I did some debugging one this issue. The problem only occurs when we
> have more than one context field.
> So this will not work, too:
>
> lttng create
> lttng enable-event -a -u
> lttng add-context -u -t vpid
> lttng add-context -u -t vtid
> lttng start
> $@
> lttng stop
> sleep 1
> lttng view
> lttng destroy
>
> The problem I found out is wrong `fields` argument passed into
> `ustcomm_register_channel`.
> The `fields` argument passed is a pointer to the `event_field` of the
> first element in a `lttng_ctx_field` array,
> but not a `lttng_event_field` array as expected.
>
> Please see the patch for more details.
>
> The patch works on my machine. But I wonder if there is something
> wrong or maybe a better fix.
> Please review.
>
> Thanks,
>
> Zifei Tong
>
> Signed-off-by: Zifei Tong <soariez@gmail.com>
> ---
> liblttng-ust/lttng-events.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c
> index e4faf60..7afe13f 100644
> --- a/liblttng-ust/lttng-events.c
> +++ b/liblttng-ust/lttng-events.c
> @@ -260,9 +260,10 @@ int lttng_session_enable(struct lttng_session *session)
> */
> cds_list_for_each_entry(chan, &session->chan_head, node) {
> const struct lttng_ctx *ctx;
> - const struct lttng_event_field *fields = NULL;
> + struct lttng_event_field *fields = NULL;
> size_t nr_fields = 0;
> uint32_t chan_id;
> + int i;
>
> /* don't change it if session stop/restart */
> if (chan->header_type)
> @@ -270,7 +271,9 @@ int lttng_session_enable(struct lttng_session *session)
> ctx = chan->ctx;
> if (ctx) {
> nr_fields = ctx->nr_fields;
> - fields = &ctx->fields->event_field;
> + fields = malloc(nr_fields * sizeof(struct lttng_event_field));
> + for (i = 0; i < nr_fields; i++)
> + fields[i] = ctx->fields[i].event_field;
> }
> ret = ustcomm_register_channel(notify_socket,
> session->objd,
> @@ -279,6 +282,8 @@ int lttng_session_enable(struct lttng_session *session)
> fields,
> &chan_id,
> &chan->header_type);
> + if (fields != NULL)
> + free(fields);
> if (ret) {
> DBG("Error (%d) registering channel to sessiond", ret);
> return ret;
> --
> 1.8.2.2
>
> On 5/12/13, Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:
> > Yes, it's broken here too. Can you open a bug report against UST please?
> >
> > it looks like those are missing when we enable UST contexts:
> >
> > libust[26034/26049]: Sent register channel notification: chan_id 0,
> > header_type 1
> > (in ustcomm_register_channel() at lttng-ust-comm.c:1053)
> > [...]
> > libust[26034/26034]: Sent register event notification for name
> > "ust_tests_hello:tptest": ret_code 0, event_id 0
> > (in ustcomm_register_event() at lttng-ust-comm.c:948)
> > libust[26034/26034]: Sent register event notification for name
> > "ust_tests_hello:tptest_sighandler": ret_code 0, event_id 1
> > (in ustcomm_register_event() at lttng-ust-comm.c:948)
> >
> > (I get those in a run where I don't enable any UST context, but not in
> > the problematic case)
> >
> > the rest seems to be there when launching the app with LTTNG_UST_DEBUG=1
> > env var set. So it looks like an issue within UST.
> >
> > Thanks,
> >
> > Mathieu
> >
> > * Francis Giraldeau (francis.giraldeau@gmail.com) wrote:
> >> With 2.2.0-rc2, when enabling some context for UST, the generated trace
> >> is empty. Here is a small script to reproduce the problem:
> >>
> >> $ cat do.sh
> >> lttng create
> >> lttng enable-channel u -u
> >> lttng enable-event -c u -a -u
> >> lttng add-context -c u -u -t vpid -t vtid
> >> lttng start
> >> $@
> >> lttng stop
> >> lttng view
> >> lttng destroy
> >>
> >> When commenting out the "add-context" command, then the trace is
> >> generated correctly. Does someone else is able to confirm the problem?
> >>
> >> Thanks,
> >>
> >> Francis Giraldeau
> >>
> >
> >
> >
> >> _______________________________________________
> >> lttng-dev mailing list
> >> lttng-dev@lists.lttng.org
> >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> >
> >
> > --
> > Mathieu Desnoyers
> > EfficiOS Inc.
> > http://www.efficios.com
> >
> > _______________________________________________
> > lttng-dev mailing list
> > lttng-dev@lists.lttng.org
> > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> >
>
>
> --
> --
> Best Regards,
> 仝子飞 (Zifei Tong)
> College of Computer Science and Technology, Zhejiang University
>
> soariez@gmail.com / tongzifei@zju.edu.cn
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply [flat|nested] 5+ messages in thread
* UST context causes empty trace
@ 2013-05-12 1:10 Francis Giraldeau
0 siblings, 0 replies; 5+ messages in thread
From: Francis Giraldeau @ 2013-05-12 1:10 UTC (permalink / raw)
To: lttng-dev
[-- Attachment #1.1: Type: text/plain, Size: 493 bytes --]
With 2.2.0-rc2, when enabling some context for UST, the generated trace
is empty. Here is a small script to reproduce the problem:
$ cat do.sh
lttng create
lttng enable-channel u -u
lttng enable-event -c u -a -u
lttng add-context -c u -u -t vpid -t vtid
lttng start
$@
lttng stop
lttng view
lttng destroy
When commenting out the "add-context" command, then the trace is
generated correctly. Does someone else is able to confirm the problem?
Thanks,
Francis Giraldeau
[-- Attachment #1.2: Signature cryptographique S/MIME --]
[-- Type: application/pkcs7-signature, Size: 4489 bytes --]
[-- Attachment #2: Type: text/plain, Size: 155 bytes --]
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-05-13 10:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <518EEC19.6080504@gmail.com>
2013-05-12 3:08 ` UST context causes empty trace Mathieu Desnoyers
[not found] ` <20130512030802.GE405@Krystal>
2013-05-12 9:27 ` Zifei Tong
[not found] ` <CAJ7wx-EoDjkgv=Pk8RjtbhyRy6eOM7RoJmhBEg5XA_xOxLMgWA@mail.gmail.com>
2013-05-12 15:00 ` Francis Giraldeau
2013-05-13 10:06 ` Mathieu Desnoyers
2013-05-12 1:10 Francis Giraldeau
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.