]> git.cworth.org Git - apitrace/blob - trace_format.hpp
Tweaks.
[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 #ifndef _TRACE_FORMAT_HPP_
27 #define _TRACE_FORMAT_HPP_
28
29 namespace Trace {
30
31 #define TRACE_VERSION 0
32
33 enum Event {
34    EVENT_ENTER = 0,
35    EVENT_LEAVE,
36    EVENT_MESSAGE
37 };
38
39 enum CallDetail {
40    CALL_END = 0,
41    CALL_ARG,
42    CALL_RET,
43    CALL_THREAD,
44 };
45
46 enum Type {
47    TYPE_NULL = 0,
48    TYPE_FALSE,
49    TYPE_TRUE,
50    TYPE_SINT,
51    TYPE_UINT,
52    TYPE_FLOAT,
53    TYPE_DOUBLE,
54    TYPE_STRING, // Null terminated, human readible string
55    TYPE_BLOB, // Block of bytes
56    TYPE_CONST,
57    TYPE_BITMASK,
58    TYPE_ARRAY,
59    TYPE_STRUCT,
60    TYPE_OPAQUE,
61 };
62
63 /*
64  * trace = call* EOF
65  *
66  * call = name (detail)* END
67  *
68  * detail = ARG name value
69  *        | RET value
70  *        | ...
71  *
72  * value = VOID
73  *       | BOOL BOOL_VALUE
74  *       | SINT INT_VALUE
75  *       | UINT INT_VALUE
76  *       | FLOAT FLOAT_VALUE
77  *       | STRING string
78  *       | BLOB string
79  *       | CONST name value
80  *       | BITMASK value+
81  *       | ARRAY length 
82  *
83  * bool = 0 | 1
84  *
85  * name = string
86  *
87  * string = length (BYTE)*
88  *
89  * length = INT_VALUE
90  */
91
92
93 } /* namespace Trace */
94
95 #endif /* _TRACE_FORMAT_HPP_ */