]> git.cworth.org Git - apitrace/blob - trace_format.hpp
Remove EVENT_MESSAGE.
[apitrace] / trace_format.hpp
1 /**************************************************************************
2  *
3  * Copyright 2010 VMware, Inc.
4  * All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  *
24  **************************************************************************/
25
26 /*
27  * Binary trace format decription.
28  */
29
30 #ifndef _TRACE_FORMAT_HPP_
31 #define _TRACE_FORMAT_HPP_
32
33 namespace Trace {
34
35 #define TRACE_VERSION 1
36
37 enum Event {
38     EVENT_ENTER = 0,
39     EVENT_LEAVE,
40 };
41
42 enum CallDetail {
43     CALL_END = 0,
44     CALL_ARG,
45     CALL_RET,
46     CALL_THREAD,
47 };
48
49 enum Type {
50     TYPE_NULL = 0,
51     TYPE_FALSE,
52     TYPE_TRUE,
53     TYPE_SINT,
54     TYPE_UINT,
55     TYPE_FLOAT,
56     TYPE_DOUBLE,
57     TYPE_STRING, // Null terminated, human readible string
58     TYPE_BLOB, // Block of bytes
59     TYPE_ENUM,
60     TYPE_BITMASK,
61     TYPE_ARRAY,
62     TYPE_STRUCT,
63     TYPE_OPAQUE,
64 };
65
66 /*
67  * XXX: Update grammar.
68  *
69  * trace = call* EOF
70  *
71  * call = name (detail)* END
72  *
73  * detail = ARG name value
74  *        | RET value
75  *        | ...
76  *
77  * value = VOID
78  *       | BOOL BOOL_VALUE
79  *       | SINT INT_VALUE
80  *       | UINT INT_VALUE
81  *       | FLOAT FLOAT_VALUE
82  *       | STRING string
83  *       | BLOB string
84  *       | CONST name value
85  *       | BITMASK value+
86  *       | ARRAY length 
87  *
88  * bool = 0 | 1
89  *
90  * name = string
91  *
92  * string = length (BYTE)*
93  *
94  * length = INT_VALUE
95  */
96
97
98 } /* namespace Trace */
99
100 #endif /* _TRACE_FORMAT_HPP_ */