3 # Babeltrace Python module common definitions
5 # Copyright 2012-2015 EfficiOS Inc.
7 # Author: Danny Serres <danny.serres@efficios.com>
8 # Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 # Permission is hereby granted, free of charge, to any person obtaining a copy
11 # of this software and associated documentation files (the "Software"), to deal
12 # in the Software without restriction, including without limitation the rights
13 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 # copies of the Software, and to permit persons to whom the Software is
15 # furnished to do so, subject to the following conditions:
17 # The above copyright notice and this permission notice shall be included in
18 # all copies or substantial portions of the Software.
20 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28 class CTFStringEncoding
:
46 # Based on the enum in ctf-writer/writer.h
56 BYTE_ORDER_LITTLE_ENDIAN
= 1
59 BYTE_ORDER_BIG_ENDIAN
= 2
61 #: Network byte order (big-endian)
62 BYTE_ORDER_NETWORK
= 3
65 BYTE_ORDER_UNKNOWN
= 4 # Python-specific entry
68 # enum equivalent, accessible constants
69 # These are taken directly from ctf/events.h
70 # All changes to enums must also be made here
73 CTF numeric type identifiers.
82 #: Floating point number
110 Returns the name of the CTF numeric type identifier *id*.
113 name
= "UNKNOWN_TYPE"
115 attr
for attr
in dir(CTFTypeId
) if not callable(
118 attr
)) and not attr
.startswith("__")]
120 for attr
in constants
:
121 if getattr(CTFTypeId
, attr
) == id:
134 TRACE_PACKET_HEADER
= 0
137 STREAM_PACKET_CONTEXT
= 1
140 STREAM_EVENT_HEADER
= 2
142 #: Stream event context
143 STREAM_EVENT_CONTEXT
= 3
151 def scope_name(scope
):
153 Returns the name of the CTF scope *scope*.
156 name
= "UNKNOWN_SCOPE"
158 attr
for attr
in dir(CTFScope
) if not callable(
161 attr
)) and not attr
.startswith("__")]
163 for attr
in constants
:
164 if getattr(CTFScope
, attr
) == scope
:
This page took 0.038416 seconds and 4 git commands to generate.