lttng / lttng-scope

A trace viewer and analyzer for LTTng kernel and user space traces
https://lttng.org/beta/#lttng-scope
Eclipse Public License 1.0
28 stars 6 forks source link

CTF parser and unknown enum values: NULL exception #78

Open compudj opened 6 years ago

compudj commented 6 years ago

The CTF parser gets a NULL exception in the following scenario: an enumeration contains a set of labels mapped to specific values, and in the trace stream, an integer value read from the stream (which is the container for the enumeration) maps to none of the labels.

compudj commented 6 years ago

I think we may want to consider allowing the ctf reader to deal with NULL enum entries without exception, and allow it to return NULL label "strings", and audit all callers that need to look at those strings (e.g. detailed event list) to map this NULL to e.g. "".

Turning NULL into "" is something that should belong at the presentation level, not at the ctf reader level IMHO.

compudj commented 5 years ago

I think someone suggested at some point to return "" rather than NULL when a label does not exist.

But considering that "" is a valid string for an existing label, it seems more appropriate to ensure the callers can handle NULL.