diff mbox series

[RFC,CTF,1/3] Clarify that unlisted enum values are implementation-defined

Message ID 20200423205226.496-2-mathieu.desnoyers@efficios.com
State Superseded, archived
Headers show
Series Common Trace Format Updates (upcoming 1.8.3) | expand

Commit Message

Mathieu Desnoyers April 23, 2020, 8:52 p.m. UTC
From: Genevi?ve Bastien <gbastien+lttng at versatic.net>

Signed-off-by: Genevi?ve Bastien <gbastien+lttng at versatic.net>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
---
 common-trace-format-specification.md | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jérémie Galarneau April 23, 2020, 10:51 p.m. UTC | #1
On Thu, 23 Apr 2020 at 16:52, Mathieu Desnoyers
<mathieu.desnoyers at efficios.com> wrote:
>
> From: Genevi?ve Bastien <gbastien+lttng at versatic.net>
>
> Signed-off-by: Genevi?ve Bastien <gbastien+lttng at versatic.net>
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
> ---
>  common-trace-format-specification.md | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/common-trace-format-specification.md b/common-trace-format-specification.md
> index fd49e59..f5fea51 100644
> --- a/common-trace-format-specification.md
> +++ b/common-trace-format-specification.md
> @@ -464,6 +464,9 @@ enum {
>  }
>  ~~~
>
> +The mappings in the enumeration type do not have to be exhaustive.
> +Unlisted values are implementation defined.
> +

This is too vague to be useful knowing that the main rationale for this
change is to allow enums to express some type of bitfield of flags
in the tracer and readers [1].

What is the meaning of an unmapped value? This section should at
least describe the correct interpretation of unmapped values as flags
and when it is appropriate to do so.

Thanks,
J?r?mie

[1] https://review.lttng.org/c/babeltrace/+/3045

>  ### 4.2 Compound types
>
>  Compound are aggregation of type declarations. Compound types include
> --
> 2.11.0
>
Mathieu Desnoyers April 24, 2020, 2:05 p.m. UTC | #2
----- On Apr 23, 2020, at 6:51 PM, Jeremie Galarneau jeremie.galarneau at efficios.com wrote:

> On Thu, 23 Apr 2020 at 16:52, Mathieu Desnoyers
> <mathieu.desnoyers at efficios.com> wrote:
>>
>> From: Genevi?ve Bastien <gbastien+lttng at versatic.net>
>>
>> Signed-off-by: Genevi?ve Bastien <gbastien+lttng at versatic.net>
>> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
>> ---
>>  common-trace-format-specification.md | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/common-trace-format-specification.md
>> b/common-trace-format-specification.md
>> index fd49e59..f5fea51 100644
>> --- a/common-trace-format-specification.md
>> +++ b/common-trace-format-specification.md
>> @@ -464,6 +464,9 @@ enum {
>>  }
>>  ~~~
>>
>> +The mappings in the enumeration type do not have to be exhaustive.
>> +Unlisted values are implementation defined.
>> +
> 
> This is too vague to be useful knowing that the main rationale for this
> change is to allow enums to express some type of bitfield of flags
> in the tracer and readers [1].
> 
> What is the meaning of an unmapped value? This section should at
> least describe the correct interpretation of unmapped values as flags
> and when it is appropriate to do so.

Considering that this is a patchlevel update to CTF, I would not expect
that we introduce new features in the specification. Only clarifications
to parts of the specification that were unclear.

Specifying a new behavior related to unmapped values would fall IMO into the
realm of "new feature", and would belong to a CTF 1.9 or CTF 2.0. As we
all know, there is a CTF 2.0 in the making, but it does not solve the
immediate problem of LTTng 2.12 which produces those unmapped enum values
within traces identified as CTF 1.8.

Moreover, to add to the problem, Babeltrace 2 has a strict match on CTF 1.8
in the CTF source plugin, and won't accept a CTF 1.9 trace (unlike Babeltrace 1
which would emit a warning about possibly unsupported features, but would accept
a 1.9 CTF trace nevertheless).

So this is why I am proposing this minimal clarification to the CTF 1.8
specification: that unmapped enum values are implementation defined (rather
than saying nothing about them). Considering that tracers can generate this
kind of trace data anyway, it's really a consideration that should have been
explicitly expressed in the specification from the start and was an
involuntary omission.

So perhaps we need to state something more than just "implementation defined",
but it's unclear what without ending up adding features into a patchlevel
update.

Thanks,

Mathieu


> Thanks,
> J?r?mie
> 
> [1] https://review.lttng.org/c/babeltrace/+/3045
> 
>>  ### 4.2 Compound types
>>
>>  Compound are aggregation of type declarations. Compound types include
>> --
>> 2.11.0
>>
> 
> 
> --
> J?r?mie Galarneau
> EfficiOS Inc.
> http://www.efficios.com
Philippe Proulx April 28, 2020, 6:40 p.m. UTC | #3
----- Original Message -----
> From: "Mathieu Desnoyers" <mathieu.desnoyers at efficios.com>
> To: "gbastien+lttng" <gbastien+lttng at versatic.net>, "Matthew Khouzam" <matthew.khouzam at ericsson.com>,
> diamon-discuss at linuxfoundation.org, pproulx at efficios.com, "Jeremie Galarneau" <jgalar at efficios.com>
> Cc: "lttng-dev" <lttng-dev at lists.lttng.org>, "Mathieu Desnoyers" <mathieu.desnoyers at efficios.com>
> Sent: Thursday, 23 April, 2020 16:52:24
> Subject: [RFC PATCH CTF 1/3] Clarify that unlisted enum values are implementation-defined

> From: Genevi?ve Bastien <gbastien+lttng at versatic.net>
> 
> Signed-off-by: Genevi?ve Bastien <gbastien+lttng at versatic.net>
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
> ---
> common-trace-format-specification.md | 3 +++
> 1 file changed, 3 insertions(+)
> 
> diff --git a/common-trace-format-specification.md
> b/common-trace-format-specification.md
> index fd49e59..f5fea51 100644
> --- a/common-trace-format-specification.md
> +++ b/common-trace-format-specification.md
> @@ -464,6 +464,9 @@ enum {
> }
> ~~~
> 
> +The mappings in the enumeration type do not have to be exhaustive.
> +Unlisted values are implementation defined.
> +

Why not just:

    An enumeration field can have an integral value which its type does not
    map to a string.

?

Phil

> ### 4.2 Compound types
> 
> Compound are aggregation of type declarations. Compound types include
> --
> 2.11.0
Mathieu Desnoyers April 28, 2020, 6:51 p.m. UTC | #4
----- On Apr 28, 2020, at 2:40 PM, Philippe Proulx pproulx at efficios.com wrote:

> ----- Original Message -----
>> From: "Mathieu Desnoyers" <mathieu.desnoyers at efficios.com>
>> To: "gbastien+lttng" <gbastien+lttng at versatic.net>, "Matthew Khouzam"
>> <matthew.khouzam at ericsson.com>,
>> diamon-discuss at linuxfoundation.org, pproulx at efficios.com, "Jeremie Galarneau"
>> <jgalar at efficios.com>
>> Cc: "lttng-dev" <lttng-dev at lists.lttng.org>, "Mathieu Desnoyers"
>> <mathieu.desnoyers at efficios.com>
>> Sent: Thursday, 23 April, 2020 16:52:24
>> Subject: [RFC PATCH CTF 1/3] Clarify that unlisted enum values are
>> implementation-defined
> 
>> From: Genevi?ve Bastien <gbastien+lttng at versatic.net>
>> 
>> Signed-off-by: Genevi?ve Bastien <gbastien+lttng at versatic.net>
>> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
>> ---
>> common-trace-format-specification.md | 3 +++
>> 1 file changed, 3 insertions(+)
>> 
>> diff --git a/common-trace-format-specification.md
>> b/common-trace-format-specification.md
>> index fd49e59..f5fea51 100644
>> --- a/common-trace-format-specification.md
>> +++ b/common-trace-format-specification.md
>> @@ -464,6 +464,9 @@ enum {
>> }
>> ~~~
>> 
>> +The mappings in the enumeration type do not have to be exhaustive.
>> +Unlisted values are implementation defined.
>> +
> 
> Why not just:
> 
>    An enumeration field can have an integral value which its type does not
>    map to a string.
> 
> ?

Good point, I will use that wording.

Thanks,

Mathieu

> 
> Phil
> 
>> ### 4.2 Compound types
>> 
>> Compound are aggregation of type declarations. Compound types include
>> --
> > 2.11.0
Mathieu Desnoyers April 29, 2020, 12:08 p.m. UTC | #5
----- On Apr 28, 2020, at 2:51 PM, Mathieu Desnoyers mathieu.desnoyers at efficios.com wrote:

> ----- On Apr 28, 2020, at 2:40 PM, Philippe Proulx pproulx at efficios.com wrote:
> 
>> ----- Original Message -----
>>> From: "Mathieu Desnoyers" <mathieu.desnoyers at efficios.com>
>>> To: "gbastien+lttng" <gbastien+lttng at versatic.net>, "Matthew Khouzam"
>>> <matthew.khouzam at ericsson.com>,
>>> diamon-discuss at linuxfoundation.org, pproulx at efficios.com, "Jeremie Galarneau"
>>> <jgalar at efficios.com>
>>> Cc: "lttng-dev" <lttng-dev at lists.lttng.org>, "Mathieu Desnoyers"
>>> <mathieu.desnoyers at efficios.com>
>>> Sent: Thursday, 23 April, 2020 16:52:24
>>> Subject: [RFC PATCH CTF 1/3] Clarify that unlisted enum values are
>>> implementation-defined
>> 
>>> From: Genevi?ve Bastien <gbastien+lttng at versatic.net>
>>> 
>>> Signed-off-by: Genevi?ve Bastien <gbastien+lttng at versatic.net>
>>> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
>>> ---
>>> common-trace-format-specification.md | 3 +++
>>> 1 file changed, 3 insertions(+)
>>> 
>>> diff --git a/common-trace-format-specification.md
>>> b/common-trace-format-specification.md
>>> index fd49e59..f5fea51 100644
>>> --- a/common-trace-format-specification.md
>>> +++ b/common-trace-format-specification.md
>>> @@ -464,6 +464,9 @@ enum {
>>> }
>>> ~~~
>>> 
>>> +The mappings in the enumeration type do not have to be exhaustive.
>>> +Unlisted values are implementation defined.
>>> +
>> 
>> Why not just:
>> 
>>    An enumeration field can have an integral value which its type does not
>>    map to a string.
>> 
>> ?
> 
> Good point, I will use that wording.

Genevi?ve pointed out on IRC that the sentence above is weird. Would the
following convey the right meaning ?

"An enumeration field can have an integral value for which the associated enumeration
type does not map to a string."

Thanks,

Mathieu

> 
> Thanks,
> 
> Mathieu
> 
>> 
>> Phil
>> 
>>> ### 4.2 Compound types
>>> 
>>> Compound are aggregation of type declarations. Compound types include
>>> --
>> > 2.11.0
> 
> --
> Mathieu Desnoyers
> EfficiOS Inc.
> http://www.efficios.com
Philippe Proulx April 29, 2020, 4:50 p.m. UTC | #6
----- Original Message -----
> From: "Mathieu Desnoyers" <mathieu.desnoyers at efficios.com>
> To: "Philippe Proulx" <pproulx at efficios.com>
> Cc: "gbastien+lttng" <gbastien+lttng at versatic.net>, "Matthew Khouzam" <matthew.khouzam at ericsson.com>, "Jeremie
> Galarneau" <jgalar at efficios.com>, "lttng-dev" <lttng-dev at lists.lttng.org>, "diamon-discuss"
> <diamon-discuss at lists.linuxfoundation.org>
> Sent: Wednesday, 29 April, 2020 08:08:04
> Subject: Re: [RFC PATCH CTF 1/3] Clarify that unlisted enum values are implementation-defined

> ----- On Apr 28, 2020, at 2:51 PM, Mathieu Desnoyers
> mathieu.desnoyers at efficios.com wrote:
> 
>> ----- On Apr 28, 2020, at 2:40 PM, Philippe Proulx pproulx at efficios.com wrote:
>> 
>>> ----- Original Message -----
>>>> From: "Mathieu Desnoyers" <mathieu.desnoyers at efficios.com>
>>>> To: "gbastien+lttng" <gbastien+lttng at versatic.net>, "Matthew Khouzam"
>>>> <matthew.khouzam at ericsson.com>,
>>>> diamon-discuss at linuxfoundation.org, pproulx at efficios.com, "Jeremie Galarneau"
>>>> <jgalar at efficios.com>
>>>> Cc: "lttng-dev" <lttng-dev at lists.lttng.org>, "Mathieu Desnoyers"
>>>> <mathieu.desnoyers at efficios.com>
>>>> Sent: Thursday, 23 April, 2020 16:52:24
>>>> Subject: [RFC PATCH CTF 1/3] Clarify that unlisted enum values are
>>>> implementation-defined
>>> 
>>>> From: Genevi?ve Bastien <gbastien+lttng at versatic.net>
>>>> 
>>>> Signed-off-by: Genevi?ve Bastien <gbastien+lttng at versatic.net>
>>>> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
>>>> ---
>>>> common-trace-format-specification.md | 3 +++
>>>> 1 file changed, 3 insertions(+)
>>>> 
>>>> diff --git a/common-trace-format-specification.md
>>>> b/common-trace-format-specification.md
>>>> index fd49e59..f5fea51 100644
>>>> --- a/common-trace-format-specification.md
>>>> +++ b/common-trace-format-specification.md
>>>> @@ -464,6 +464,9 @@ enum {
>>>> }
>>>> ~~~
>>>> 
>>>> +The mappings in the enumeration type do not have to be exhaustive.
>>>> +Unlisted values are implementation defined.
>>>> +
>>> 
>>> Why not just:
>>> 
>>>    An enumeration field can have an integral value which its type does not
>>>    map to a string.
>>> 
>>> ?
>> 
>> Good point, I will use that wording.
> 
> Genevi?ve pointed out on IRC that the sentence above is weird. Would the
> following convey the right meaning ?
> 
> "An enumeration field can have an integral value for which the associated
> enumeration
> type does not map to a string."

Sure.

Phil

> 
> Thanks,
> 
> Mathieu
> 
>> 
>> Thanks,
>> 
>> Mathieu
>> 
>>> 
>>> Phil
>>> 
>>>> ### 4.2 Compound types
>>>> 
>>>> Compound are aggregation of type declarations. Compound types include
>>>> --
>>> > 2.11.0
>> 
>> --
>> Mathieu Desnoyers
>> EfficiOS Inc.
>> http://www.efficios.com
> 
> --
> Mathieu Desnoyers
> EfficiOS Inc.
> http://www.efficios.com
diff mbox series

Patch

diff --git a/common-trace-format-specification.md b/common-trace-format-specification.md
index fd49e59..f5fea51 100644
--- a/common-trace-format-specification.md
+++ b/common-trace-format-specification.md
@@ -464,6 +464,9 @@  enum {
 }
 ~~~
 
+The mappings in the enumeration type do not have to be exhaustive.
+Unlisted values are implementation defined.
+
 ### 4.2 Compound types
 
 Compound are aggregation of type declarations. Compound types include