[lttng-dev] Potentially inconsistent string lengths

David Goulet david.goulet at polymtl.ca
Thu Feb 2 10:40:11 EST 2012

Hash: SHA1


On 12-02-02 10:18 AM, Thibault, Daniel wrote:
>    In lttng-tools lttng/lttng.h, we have:
> struct lttng_domain {
> 	...
> 	char exec_name[NAME_MAX];
> 	...
> }
>    While in lttng-tools src/bin/lttng-sessiond/trace-ust.h, we have:
> struct ltt_ust_domain_exec {
> 	char exec_name[LTTNG_UST_SYM_NAME_LEN];
> 	...
> }

Yes this could be changed to fit both side. However, for now it's not used at
all since this domain is not yet implemented. It will *most* probably change on
the lttng-tools side so for lttng.h, it's ok.

>    If the fields of both structures are meant to refer to the same thing, they should use the same constants.
>    The same issue is present for the channel names.  In lttng-modules lib/ringbuffer/backend_types.h, we have:
> struct channel_backend {
> 	...
> 	char name[NAME_MAX];		/* Channel name */
> };
>    NAME_MAX is also used in lttng-tools src/common/sessiond-comm/sessiond-comm.h (struct lttcomm_session_msg).  However, in lttng-tools lttng/lttng.h, we have:
> struct lttng_channel {
> 	char name[LTTNG_SYMBOL_NAME_LEN];
> 	...
> };
>    On a related note, lttng.h has LTTNG_SYMBOL_NAME_LEN "copied from LTTng kernel ABI", but lttng-abi.h and lttng-kernel.h have LTTNG_SYM_NAME_LEN.  It would be safer to use the same name in all headers.

Actually, there is two defines for Kernel and UST which I think are the same
len. We keep them separate for now because at some point we want lttng-tools to
be able to compile without kernel support (like now without UST support). The
separation for now is for the future. Even if now it's the same size, this can
change and having two defines help us with that.

I can agree with you that the naming is not ideal but for now, we'll keep it
that way.


> Daniel U. Thibault
> R & D pour la défense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier)
> Système de systèmes (SdS) / System of Systems (SoS)
> Solutions informatiques et expérimentations (SIE) / Computing Solutions and Experimentations (CSE)
> 2459 Boul. Pie XI Nord
> Québec, QC  G3J 1X5
> Vox : (418) 844-4000 x4245
> Fax : (418) 844-4538
> NAC: 918V QSDJ
> Gouvernement du Canada / Government of Canada
> <http://www.valcartier.drdc-rddc.gc.ca/>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Version: GnuPG v1.4.10 (GNU/Linux)


More information about the lttng-dev mailing list