]> git.cworth.org Git - apitrace/blob - trace_format.hpp
Fix a few more arrays args in D3D9.
[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     EVENT_MESSAGE
41 };
42
43 enum CallDetail {
44     CALL_END = 0,
45     CALL_ARG,
46     CALL_RET,
47     CALL_THREAD,
48 };
49
50 enum Type {
51     TYPE_NULL = 0,
52     TYPE_FALSE,
53     TYPE_TRUE,
54     TYPE_SINT,
55     TYPE_UINT,
56     TYPE_FLOAT,
57     TYPE_DOUBLE,
58     TYPE_STRING, // Null terminated, human readible string
59     TYPE_BLOB, // Block of bytes
60     TYPE_ENUM,
61     TYPE_BITMASK,
62     TYPE_ARRAY,
63     TYPE_STRUCT,
64     TYPE_OPAQUE,
65 };
66
67 /*
68  * XXX: Update grammar.
69  *
70  * trace = call* EOF
71  *
72  * call = name (detail)* END
73  *
74  * detail = ARG name value
75  *        | RET value
76  *        | ...
77  *
78  * value = VOID
79  *       | BOOL BOOL_VALUE
80  *       | SINT INT_VALUE
81  *       | UINT INT_VALUE
82  *       | FLOAT FLOAT_VALUE
83  *       | STRING string
84  *       | BLOB string
85  *       | CONST name value
86  *       | BITMASK value+
87  *       | ARRAY length 
88  *
89  * bool = 0 | 1
90  *
91  * name = string
92  *
93  * string = length (BYTE)*
94  *
95  * length = INT_VALUE
96  */
97
98
99 } /* namespace Trace */
100
101 #endif /* _TRACE_FORMAT_HPP_ */