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
29 class CTFStringEncoding
:
47 # Based on the enum in ctf-writer/writer.h
57 BYTE_ORDER_LITTLE_ENDIAN
= 1
60 BYTE_ORDER_BIG_ENDIAN
= 2
62 #: Network byte order (big-endian)
63 BYTE_ORDER_NETWORK
= 3
66 BYTE_ORDER_UNKNOWN
= 4 # Python-specific entry
69 # enum equivalent, accessible constants
70 # These are taken directly from ctf/events.h
71 # All changes to enums must also be made here
74 CTF numeric type identifiers.
83 #: Floating point number
111 Returns the name of the CTF numeric type identifier *id*.
114 name
= "UNKNOWN_TYPE"
116 attr
for attr
in dir(CTFTypeId
) if not callable(
119 attr
)) and not attr
.startswith("__")]
121 for attr
in constants
:
122 if getattr(CTFTypeId
, attr
) == id:
135 TRACE_PACKET_HEADER
= 0
138 STREAM_PACKET_CONTEXT
= 1
141 STREAM_EVENT_HEADER
= 2
143 #: Stream event context
144 STREAM_EVENT_CONTEXT
= 3
152 def scope_name(scope
):
154 Returns the name of the CTF scope *scope*.
157 name
= "UNKNOWN_SCOPE"
159 attr
for attr
in dir(CTFScope
) if not callable(
162 attr
)) and not attr
.startswith("__")]
164 for attr
in constants
:
165 if getattr(CTFScope
, attr
) == scope
:
This page took 0.039079 seconds and 4 git commands to generate.