TSDL grammar: ctf-assignment-expression-list require semicolon
[ctf.git] / common-trace-format-proposal.txt
index 238fbadfead6c69709bcffad007f8478d558dd67..552ac32d33983d47f4b0dd30ba15abc4e198d25b 100644 (file)
@@ -193,6 +193,8 @@ TSDL meta-data representation:
     /* based used for pretty-printing output, default: decimal. */
     base = decimal OR dec OR OR d OR i OR u OR 10 OR hexadecimal OR hex OR x OR X OR p OR 16
            OR octal OR oct OR o OR 8 OR binary OR b OR 2;
     /* based used for pretty-printing output, default: decimal. */
     base = decimal OR dec OR OR d OR i OR u OR 10 OR hexadecimal OR hex OR x OR X OR p OR 16
            OR octal OR oct OR o OR 8 OR binary OR b OR 2;
+    /* character encoding, default: none */
+    encoding = none or UTF8 or ASCII;
   }
 
 Example of type inheritance (creation of a uint32_t named type):
   }
 
 Example of type inheritance (creation of a uint32_t named type):
@@ -211,6 +213,17 @@ typealias integer {
   align = 1;
 } := int5_t;
 
   align = 1;
 } := int5_t;
 
+The character encoding field can be used to specify that the integer
+must be printed as a text character when read. e.g.:
+
+typealias integer {
+  size = 8;
+  align = 8;
+  signed = false;
+  encoding = UTF8;
+} := utf_char;
+
+
 4.1.6 GNU/C bitfields
 
 The GNU/C bitfields follow closely the integer representation, with a
 4.1.6 GNU/C bitfields
 
 The GNU/C bitfields follow closely the integer representation, with a
@@ -649,7 +662,7 @@ the fields typically expected (although these fields are each optional):
 
 struct event_packet_header {
   uint32_t magic;
 
 struct event_packet_header {
   uint32_t magic;
-  uint8_t  trace_uuid[16];
+  uint8_t  uuid[16];
   uint32_t stream_id;
 };
 
   uint32_t stream_id;
 };
 
@@ -661,8 +674,8 @@ trace {
 If the magic number is not present, tools such as "file" will have no
 mean to discover the file type.
 
 If the magic number is not present, tools such as "file" will have no
 mean to discover the file type.
 
-If the trace_uuid is not present, no validation that the meta-data
-actually corresponds to the stream is performed.
+If the uuid is not present, no validation that the meta-data actually
+corresponds to the stream is performed.
 
 If the stream_id packet header field is missing, the trace can only
 contain a single stream. Its "id" field can be left out, and its events
 
 If the stream_id packet header field is missing, the trace can only
 contain a single stream. Its "id" field can be left out, and its events
@@ -886,13 +899,16 @@ beginning of the file. This magic number is also used to detect the
 endianness of the architecture by trying to read the CTF magic number
 and its counterpart in reversed endianness. The events within the
 meta-data stream have no event header nor event context. Each event only
 endianness of the architecture by trying to read the CTF magic number
 and its counterpart in reversed endianness. The events within the
 meta-data stream have no event header nor event context. Each event only
-contains a "string" payload. Each meta-data packet start with a special
-packet header, specific to the meta-data stream, which contains,
-exactly:
+contains a "sequence" payload, which is a sequence of bits using the
+"trace.packet.header.content_size" field as a placeholder for its
+length. The formatting of this sequence of bits is a plain-text
+representation of the TSDL description. Each meta-data packet start with
+a special packet header, specific to the meta-data stream, which
+contains, exactly:
 
 struct metadata_packet_header {
   uint32_t magic;                      /* 0x75D11D57 */
 
 struct metadata_packet_header {
   uint32_t magic;                      /* 0x75D11D57 */
-  uint8_t  trace_uuid[16];             /* Unique Universal Identifier */
+  uint8_t  uuid[16];                   /* Unique Universal Identifier */
   uint32_t checksum;                   /* 0 if unused */
   uint32_t content_size;               /* in bits */
   uint32_t packet_size;                        /* in bits */
   uint32_t checksum;                   /* 0 if unused */
   uint32_t content_size;               /* in bits */
   uint32_t packet_size;                        /* in bits */
@@ -1007,7 +1023,7 @@ trace {
   byte_order = be OR le;                       /* Endianness (required) */
   packet.header := struct {
     uint32_t magic;
   byte_order = be OR le;                       /* Endianness (required) */
   packet.header := struct {
     uint32_t magic;
-    uint8_t  trace_uuid[16];
+    uint8_t  uuid[16];
     uint32_t stream_id;
   };
 };
     uint32_t stream_id;
   };
 };
@@ -1451,7 +1467,7 @@ struct-or-variant-declaration-list:
 
 struct-or-variant-declaration:
        specifier-qualifier-list struct-or-variant-declarator-list ;
 
 struct-or-variant-declaration:
        specifier-qualifier-list struct-or-variant-declarator-list ;
-       declaration-specifiers storage-class-specifier declaration-specifiers declarator-list ;
+       declaration-specifiers-opt storage-class-specifier declaration-specifiers-opt declarator-list ;
        typealias declaration-specifiers abstract-declarator-list := declaration-specifiers abstract-declarator-list ;
        typealias declaration-specifiers abstract-declarator-list := declarator-list ;
 
        typealias declaration-specifiers abstract-declarator-list := declaration-specifiers abstract-declarator-list ;
        typealias declaration-specifiers abstract-declarator-list := declarator-list ;
 
@@ -1536,12 +1552,12 @@ ctf-type-specifier:
        string { ctf-assignment-expression-list-opt }
 
 ctf-assignment-expression-list:
        string { ctf-assignment-expression-list-opt }
 
 ctf-assignment-expression-list:
-       ctf-assignment-expression
-       ctf-assignment-expression-list ; ctf-assignment-expression
+       ctf-assignment-expression ;
+       ctf-assignment-expression-list ctf-assignment-expression ;
 
 ctf-assignment-expression:
        unary-expression assignment-operator unary-expression
        unary-expression type-assignment-operator type-specifier
 
 ctf-assignment-expression:
        unary-expression assignment-operator unary-expression
        unary-expression type-assignment-operator type-specifier
-       declaration-specifiers storage-class-specifier declaration-specifiers declarator-list
+       declaration-specifiers-opt storage-class-specifier declaration-specifiers-opt declarator-list
        typealias declaration-specifiers abstract-declarator-list := declaration-specifiers abstract-declarator-list
        typealias declaration-specifiers abstract-declarator-list := declarator-list
        typealias declaration-specifiers abstract-declarator-list := declaration-specifiers abstract-declarator-list
        typealias declaration-specifiers abstract-declarator-list := declarator-list
This page took 0.023238 seconds and 4 git commands to generate.