[lttng-dev] Working on some bugs

David Goulet dgoulet at efficios.com
Thu Mar 13 10:44:31 EDT 2014


On 12 Mar (22:59:20), Sandeep K Chaudhary wrote:
> Thanks for pointing it to me, David !
> 
> However I see the following in relay_add_stream in main.c
> 
>         switch (conn->minor) {
>         case 1: /* LTTng sessiond 2.1 */
>                 ret = cmd_recv_stream_2_1(conn, stream);
>                 break;
>         case 2: /* LTTng sessiond 2.2 */
>         default:
>                 ret = cmd_recv_stream_2_2(conn, stream);
>                 break;
>         }
> 
> This means that it's calling either 'cmd_recv_stream_2_1' or
> 'cmd_recv_stream_2_2' depending on the minor version number. Is this not we
> want? Though I don't understand why it should be calling
> 'cmd_recv_stream_2_2' for minor versions other than 1. Is this correct
> behavior?

Yes so for now only the minor version matter since a major number other
than 2 can't be negotiated during the send_version step (the first thing
the relayd receives for a connection).

At some point in time, we would need to check the major number to here
so calling cmd_recv_stream_2_2(...) would make more sense. Maybe it's
something you want to do here before anything, adding a layer that
checks major + minor and calls the right one? Something that could be
generic enough so we don't have those ugly switch cases in each
command... ?

Cheers!
David

> 
> Please let me know.
> 
> Thanks and regards,
> Sandeep.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 603 bytes
Desc: Digital signature
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20140313/82225cad/attachment.pgp>


More information about the lttng-dev mailing list