babeltrace2 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/babeltrace2.gemspec +13 -0
- data/lib/babeltrace2.rb +49 -0
- data/lib/babeltrace2/error-reporting.rb +432 -0
- data/lib/babeltrace2/func-status.rb +26 -0
- data/lib/babeltrace2/graph/component-class-dev.rb +801 -0
- data/lib/babeltrace2/graph/component-class.rb +134 -0
- data/lib/babeltrace2/graph/component-descriptor-set.rb +78 -0
- data/lib/babeltrace2/graph/component.rb +362 -0
- data/lib/babeltrace2/graph/connection.rb +35 -0
- data/lib/babeltrace2/graph/graph.rb +523 -0
- data/lib/babeltrace2/graph/interrupter.rb +57 -0
- data/lib/babeltrace2/graph/message-iterator-class.rb +374 -0
- data/lib/babeltrace2/graph/message-iterator.rb +253 -0
- data/lib/babeltrace2/graph/message.rb +721 -0
- data/lib/babeltrace2/graph/port.rb +124 -0
- data/lib/babeltrace2/graph/private-query-executor.rb +4 -0
- data/lib/babeltrace2/graph/query-executor.rb +142 -0
- data/lib/babeltrace2/graph/self-component-class.rb +37 -0
- data/lib/babeltrace2/graph/self-component-port.rb +35 -0
- data/lib/babeltrace2/graph/self-component.rb +264 -0
- data/lib/babeltrace2/graph/self-message-iterator.rb +147 -0
- data/lib/babeltrace2/integer-range-set.rb +275 -0
- data/lib/babeltrace2/logging-defs.rb +19 -0
- data/lib/babeltrace2/logging.rb +77 -0
- data/lib/babeltrace2/plugin/plugin-dev.rb +335 -0
- data/lib/babeltrace2/plugin/plugin-loading.rb +459 -0
- data/lib/babeltrace2/trace-ir/clock-class.rb +258 -0
- data/lib/babeltrace2/trace-ir/clock-snapshot.rb +45 -0
- data/lib/babeltrace2/trace-ir/event-class.rb +292 -0
- data/lib/babeltrace2/trace-ir/event.rb +91 -0
- data/lib/babeltrace2/trace-ir/field-class.rb +1416 -0
- data/lib/babeltrace2/trace-ir/field-path.rb +123 -0
- data/lib/babeltrace2/trace-ir/field.rb +871 -0
- data/lib/babeltrace2/trace-ir/packet.rb +57 -0
- data/lib/babeltrace2/trace-ir/stream-class.rb +425 -0
- data/lib/babeltrace2/trace-ir/stream.rb +137 -0
- data/lib/babeltrace2/trace-ir/trace-class.rb +343 -0
- data/lib/babeltrace2/trace-ir/trace.rb +321 -0
- data/lib/babeltrace2/types.rb +667 -0
- data/lib/babeltrace2/util.rb +23 -0
- data/lib/babeltrace2/value.rb +869 -0
- data/lib/babeltrace2/version.rb +126 -0
- metadata +105 -0
@@ -0,0 +1,721 @@
|
|
1
|
+
module Babeltrace2
|
2
|
+
BT_MESSAGE_TYPE_STREAM_BEGINNING = 1 << 0
|
3
|
+
BT_MESSAGE_TYPE_STREAM_END = 1 << 1
|
4
|
+
BT_MESSAGE_TYPE_EVENT = 1 << 2
|
5
|
+
BT_MESSAGE_TYPE_PACKET_BEGINNING = 1 << 3
|
6
|
+
BT_MESSAGE_TYPE_PACKET_END = 1 << 4
|
7
|
+
BT_MESSAGE_TYPE_DISCARDED_EVENTS = 1 << 5
|
8
|
+
BT_MESSAGE_TYPE_DISCARDED_PACKETS = 1 << 6
|
9
|
+
BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY = 1 << 7
|
10
|
+
BTMessageType = enum :bt_message_type,
|
11
|
+
[ :BT_MESSAGE_TYPE_STREAM_BEGINNING,
|
12
|
+
BT_MESSAGE_TYPE_STREAM_BEGINNING,
|
13
|
+
:BT_MESSAGE_TYPE_STREAM_END,
|
14
|
+
BT_MESSAGE_TYPE_STREAM_END,
|
15
|
+
:BT_MESSAGE_TYPE_EVENT,
|
16
|
+
BT_MESSAGE_TYPE_EVENT,
|
17
|
+
:BT_MESSAGE_TYPE_PACKET_BEGINNING,
|
18
|
+
BT_MESSAGE_TYPE_PACKET_BEGINNING,
|
19
|
+
:BT_MESSAGE_TYPE_PACKET_END,
|
20
|
+
BT_MESSAGE_TYPE_PACKET_END,
|
21
|
+
:BT_MESSAGE_TYPE_DISCARDED_EVENTS,
|
22
|
+
BT_MESSAGE_TYPE_DISCARDED_EVENTS,
|
23
|
+
:BT_MESSAGE_TYPE_DISCARDED_PACKETS,
|
24
|
+
BT_MESSAGE_TYPE_DISCARDED_PACKETS,
|
25
|
+
:BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY,
|
26
|
+
BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY ]
|
27
|
+
|
28
|
+
attach_function :bt_message_get_type,
|
29
|
+
[ :bt_message_handle ],
|
30
|
+
:bt_message_type
|
31
|
+
|
32
|
+
attach_function :bt_message_get_ref,
|
33
|
+
[ :bt_message_handle ],
|
34
|
+
:void
|
35
|
+
|
36
|
+
attach_function :bt_message_put_ref,
|
37
|
+
[ :bt_message_handle ],
|
38
|
+
:void
|
39
|
+
|
40
|
+
class BTMessage < BTSharedObject
|
41
|
+
Type = BTMessageType
|
42
|
+
@get_ref = :bt_message_get_ref
|
43
|
+
@put_ref = :bt_message_put_ref
|
44
|
+
|
45
|
+
def self.from_handle(handle, retain: true, auto_release: true)
|
46
|
+
case Babeltrace2.bt_message_get_type(handle)
|
47
|
+
when :BT_MESSAGE_TYPE_STREAM_BEGINNING
|
48
|
+
StreamBeginning
|
49
|
+
when :BT_MESSAGE_TYPE_STREAM_END
|
50
|
+
StreamEnd
|
51
|
+
when :BT_MESSAGE_TYPE_EVENT
|
52
|
+
Event
|
53
|
+
when :BT_MESSAGE_TYPE_PACKET_BEGINNING
|
54
|
+
PacketBeginning
|
55
|
+
when :BT_MESSAGE_TYPE_PACKET_END
|
56
|
+
PacketEnd
|
57
|
+
when :BT_MESSAGE_TYPE_DISCARDED_EVENTS
|
58
|
+
DiscardedEvents
|
59
|
+
when :BT_MESSAGE_TYPE_DISCARDED_PACKETS
|
60
|
+
DiscardedPackets
|
61
|
+
when :BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY
|
62
|
+
MessageIteratorInactivity
|
63
|
+
else
|
64
|
+
raise Error.new("unknown message type")
|
65
|
+
end.new(handle, retain: retain, auto_release: auto_release)
|
66
|
+
end
|
67
|
+
|
68
|
+
def get_type
|
69
|
+
Babeltrace2.bt_message_get_type(@handle)
|
70
|
+
end
|
71
|
+
alias type get_type
|
72
|
+
end
|
73
|
+
|
74
|
+
BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_KNOWN = 1
|
75
|
+
BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_UNKNOWN = 0
|
76
|
+
BTMessageStreamClockSnapshotState = enum :bt_message_stream_clock_snapshot_state,
|
77
|
+
[ :BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_KNOWN,
|
78
|
+
BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_KNOWN,
|
79
|
+
:BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_UNKNOWN,
|
80
|
+
BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_UNKNOWN ]
|
81
|
+
|
82
|
+
attach_function :bt_message_stream_beginning_create,
|
83
|
+
[ :bt_self_message_iterator_handle,
|
84
|
+
:bt_stream_handle ],
|
85
|
+
:bt_message_handle
|
86
|
+
|
87
|
+
attach_function :bt_message_stream_beginning_borrow_stream,
|
88
|
+
[ :bt_message_handle ],
|
89
|
+
:bt_stream_handle
|
90
|
+
|
91
|
+
attach_function :bt_message_stream_beginning_borrow_stream_const,
|
92
|
+
[ :bt_message_handle ],
|
93
|
+
:bt_stream_handle
|
94
|
+
|
95
|
+
attach_function :bt_message_stream_beginning_set_default_clock_snapshot,
|
96
|
+
[ :bt_message_handle, :uint64_t ],
|
97
|
+
:void
|
98
|
+
|
99
|
+
attach_function :bt_message_stream_beginning_borrow_default_clock_snapshot_const,
|
100
|
+
[ :bt_message_handle, :pointer ],
|
101
|
+
:bt_message_stream_clock_snapshot_state
|
102
|
+
|
103
|
+
attach_function :bt_message_stream_beginning_borrow_stream_class_default_clock_class_const,
|
104
|
+
[ :bt_message_handle ],
|
105
|
+
:bt_clock_class_handle
|
106
|
+
|
107
|
+
class BTMessage
|
108
|
+
StreamClockSnapshotState = BTMessageStreamClockSnapshotState
|
109
|
+
class StreamBeginning < BTMessage
|
110
|
+
def initialize(handle = nil, retain: true, auto_release: true,
|
111
|
+
self_message_iterator: nil, stream: nil)
|
112
|
+
if handle
|
113
|
+
super(handle, retain: retain, auto_release: auto_release)
|
114
|
+
else
|
115
|
+
handle = Babeltrace2.bt_message_stream_beginning_create(
|
116
|
+
self_message_iterator, stream)
|
117
|
+
raise Babeltrace2.process_error if handle.null?
|
118
|
+
super(handle)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
def get_stream
|
123
|
+
handle = Babeltrace2.bt_message_stream_beginning_borrow_stream(@handle)
|
124
|
+
BTStream.new(handle, retain: true, auto_release: true)
|
125
|
+
end
|
126
|
+
alias stream get_stream
|
127
|
+
|
128
|
+
def set_default_clock_snapshot(value)
|
129
|
+
Babeltrace2.bt_message_stream_beginning_set_default_clock_snapshot(@handle, value)
|
130
|
+
self
|
131
|
+
end
|
132
|
+
|
133
|
+
def default_clock_snapshot=(value)
|
134
|
+
Babeltrace2.bt_message_stream_beginning_set_default_clock_snapshot(@handle, value)
|
135
|
+
value
|
136
|
+
end
|
137
|
+
|
138
|
+
def get_default_clock_snapshot
|
139
|
+
ptr = FFI::MemoryPointer.new(:pointer)
|
140
|
+
res = Babeltrace2.bt_message_stream_beginning_borrow_default_clock_snapshot_const(@handle, ptr)
|
141
|
+
return nil if res == :BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_UNKNOWN
|
142
|
+
BTClockSnapshot.new(BTClockSnapshotHandle.new(ptr.read_pointer))
|
143
|
+
end
|
144
|
+
alias default_clock_snapshot get_default_clock_snapshot
|
145
|
+
|
146
|
+
def get_stream_class_default_clock_class
|
147
|
+
handle = Babeltrace2.bt_message_stream_beginning_borrow_stream_class_default_clock_class_const(@handle)
|
148
|
+
BTClockClass.new(handle, retain: true, auto_release: true)
|
149
|
+
end
|
150
|
+
alias stream_class_default_clock_class get_stream_class_default_clock_class
|
151
|
+
end
|
152
|
+
end
|
153
|
+
BTMessageStreamBeginning = BTMessage::StreamBeginning
|
154
|
+
|
155
|
+
attach_function :bt_message_stream_end_create,
|
156
|
+
[ :bt_self_message_iterator_handle,
|
157
|
+
:bt_stream_handle ],
|
158
|
+
:bt_message_handle
|
159
|
+
|
160
|
+
attach_function :bt_message_stream_end_borrow_stream,
|
161
|
+
[ :bt_message_handle ],
|
162
|
+
:bt_stream_handle
|
163
|
+
|
164
|
+
attach_function :bt_message_stream_end_borrow_stream_const,
|
165
|
+
[ :bt_message_handle ],
|
166
|
+
:bt_stream_handle
|
167
|
+
|
168
|
+
attach_function :bt_message_stream_end_set_default_clock_snapshot,
|
169
|
+
[ :bt_message_handle, :uint64_t ],
|
170
|
+
:void
|
171
|
+
|
172
|
+
attach_function :bt_message_stream_end_borrow_default_clock_snapshot_const,
|
173
|
+
[ :bt_message_handle, :pointer ],
|
174
|
+
:bt_message_stream_clock_snapshot_state
|
175
|
+
|
176
|
+
attach_function :bt_message_stream_end_borrow_stream_class_default_clock_class_const,
|
177
|
+
[ :bt_message_handle ],
|
178
|
+
:bt_clock_class_handle
|
179
|
+
|
180
|
+
class BTMessage
|
181
|
+
class StreamEnd < BTMessage
|
182
|
+
def initialize(handle = nil, retain: true, auto_release: true,
|
183
|
+
self_message_iterator: nil, stream: nil)
|
184
|
+
if handle
|
185
|
+
super(handle, retain: retain, auto_release: auto_release)
|
186
|
+
else
|
187
|
+
handle = Babeltrace2.bt_message_stream_end_create(
|
188
|
+
self_message_iterator, stream)
|
189
|
+
raise Babeltrace2.process_error if handle.null?
|
190
|
+
super(handle)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
def get_stream
|
195
|
+
handle = Babeltrace2.bt_message_stream_end_borrow_stream(@handle)
|
196
|
+
BTStream.new(handle, retain: true, auto_release: true)
|
197
|
+
end
|
198
|
+
alias stream get_stream
|
199
|
+
|
200
|
+
def set_default_clock_snapshot(value)
|
201
|
+
Babeltrace2.bt_message_stream_end_set_default_clock_snapshot(@handle, value)
|
202
|
+
self
|
203
|
+
end
|
204
|
+
|
205
|
+
def default_clock_snapshot=(value)
|
206
|
+
Babeltrace2.bt_message_stream_end_set_default_clock_snapshot(@handle, value)
|
207
|
+
value
|
208
|
+
end
|
209
|
+
|
210
|
+
def get_default_clock_snapshot
|
211
|
+
ptr = FFI::MemoryPointer.new(:pointer)
|
212
|
+
res = Babeltrace2.bt_message_stream_end_borrow_default_clock_snapshot_const(@handle, ptr)
|
213
|
+
return nil if res == :BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_UNKNOWN
|
214
|
+
BTClockSnapshot.new(BTClockSnapshotHandle.new(ptr.read_pointer))
|
215
|
+
end
|
216
|
+
alias default_clock_snapshot get_default_clock_snapshot
|
217
|
+
|
218
|
+
def get_stream_class_default_clock_class
|
219
|
+
handle = Babeltrace2.bt_message_stream_end_borrow_stream_class_default_clock_class_const(@handle)
|
220
|
+
BTClockClass.new(handle, retain: true, auto_release: true)
|
221
|
+
end
|
222
|
+
alias stream_class_default_clock_class get_stream_class_default_clock_class
|
223
|
+
end
|
224
|
+
end
|
225
|
+
BTMessageStreamEnd = BTMessage::StreamEnd
|
226
|
+
|
227
|
+
attach_function :bt_message_event_create,
|
228
|
+
[ :bt_self_message_iterator_handle,
|
229
|
+
:bt_event_class_handle,
|
230
|
+
:bt_stream_handle ],
|
231
|
+
:bt_message_handle
|
232
|
+
|
233
|
+
attach_function :bt_message_event_create_with_default_clock_snapshot,
|
234
|
+
[ :bt_self_message_iterator_handle,
|
235
|
+
:bt_event_class_handle,
|
236
|
+
:bt_stream_handle, :uint64 ],
|
237
|
+
:bt_message_handle
|
238
|
+
|
239
|
+
attach_function :bt_message_event_create_with_packet,
|
240
|
+
[ :bt_self_message_iterator_handle,
|
241
|
+
:bt_event_class_handle,
|
242
|
+
:bt_packet_handle ],
|
243
|
+
:bt_message_handle
|
244
|
+
|
245
|
+
attach_function :bt_message_event_create_with_packet_and_default_clock_snapshot,
|
246
|
+
[ :bt_self_message_iterator_handle,
|
247
|
+
:bt_event_class_handle,
|
248
|
+
:bt_packet_handle, :uint64 ],
|
249
|
+
:bt_message_handle
|
250
|
+
|
251
|
+
attach_function :bt_message_event_borrow_event,
|
252
|
+
[ :bt_message_handle ],
|
253
|
+
:bt_event_handle
|
254
|
+
|
255
|
+
attach_function :bt_message_event_borrow_event_const,
|
256
|
+
[ :bt_message_handle ],
|
257
|
+
:bt_event_handle
|
258
|
+
|
259
|
+
attach_function :bt_message_event_borrow_default_clock_snapshot_const,
|
260
|
+
[ :bt_message_handle ],
|
261
|
+
:bt_clock_snapshot_handle
|
262
|
+
|
263
|
+
attach_function :bt_message_event_borrow_stream_class_default_clock_class_const,
|
264
|
+
[ :bt_message_handle ],
|
265
|
+
:bt_clock_class_handle
|
266
|
+
|
267
|
+
class BTMessage
|
268
|
+
class Event < BTMessage
|
269
|
+
def initialize(handle = nil, retain: true, auto_release: true,
|
270
|
+
self_message_iterator: nil, event_class: nil, stream: nil,
|
271
|
+
clock_snapshot_value: nil, packet: nil)
|
272
|
+
if handle
|
273
|
+
super(handle, retain: retain, auto_release: auto_release)
|
274
|
+
else
|
275
|
+
handle = if clock_snapshot_value
|
276
|
+
if packet
|
277
|
+
Babeltrace2.bt_message_event_create_with_packet_and_default_clock_snapshot(
|
278
|
+
self_message_iterator, event_class, packet, clock_snapshot_value)
|
279
|
+
else
|
280
|
+
Babeltrace2.bt_message_event_create_with_default_clock_snapshot(
|
281
|
+
self_message_iterator, event_class, stream, clock_snapshot_value)
|
282
|
+
end
|
283
|
+
else
|
284
|
+
if packet
|
285
|
+
Babeltrace2.bt_message_event_create_with_packet(
|
286
|
+
self_message_iterator, event_class, packet)
|
287
|
+
else
|
288
|
+
Babeltrace2.bt_message_event_create(
|
289
|
+
self_message_iterator, event_class, stream)
|
290
|
+
end
|
291
|
+
end
|
292
|
+
raise Babeltrace2.process_error if handle.null?
|
293
|
+
super(handle)
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
297
|
+
def get_event
|
298
|
+
handle = Babeltrace2.bt_message_event_borrow_event(@handle)
|
299
|
+
BTEvent.new(handle)
|
300
|
+
end
|
301
|
+
alias event get_event
|
302
|
+
|
303
|
+
def get_default_clock_snapshot
|
304
|
+
handle = Babeltrace2.bt_message_event_borrow_default_clock_snapshot_const(@handle)
|
305
|
+
BTClockSnapshot.new(handle)
|
306
|
+
end
|
307
|
+
alias default_clock_snapshot get_default_clock_snapshot
|
308
|
+
|
309
|
+
def get_stream_class_default_clock_class
|
310
|
+
handle = Babeltrace2.bt_message_event_borrow_stream_class_default_clock_class_const(@handle)
|
311
|
+
BTClockClass.new(handle, retain: true, auto_release: true)
|
312
|
+
end
|
313
|
+
alias stream_class_default_clock_class get_stream_class_default_clock_class
|
314
|
+
end
|
315
|
+
end
|
316
|
+
BTMessageEvent = BTMessage::Event
|
317
|
+
|
318
|
+
attach_function :bt_message_packet_beginning_create,
|
319
|
+
[ :bt_self_message_iterator_handle,
|
320
|
+
:bt_packet_handle ],
|
321
|
+
:bt_message_handle
|
322
|
+
|
323
|
+
attach_function :bt_message_packet_beginning_create_with_default_clock_snapshot,
|
324
|
+
[ :bt_self_message_iterator_handle,
|
325
|
+
:bt_packet_handle, :uint64 ],
|
326
|
+
:bt_message_handle
|
327
|
+
|
328
|
+
attach_function :bt_message_packet_beginning_borrow_packet,
|
329
|
+
[ :bt_message_handle ],
|
330
|
+
:bt_packet_handle
|
331
|
+
|
332
|
+
attach_function :bt_message_packet_beginning_borrow_packet_const,
|
333
|
+
[ :bt_message_handle ],
|
334
|
+
:bt_packet_handle
|
335
|
+
|
336
|
+
attach_function :bt_message_packet_beginning_borrow_default_clock_snapshot_const,
|
337
|
+
[ :bt_message_handle ],
|
338
|
+
:bt_clock_snapshot_handle
|
339
|
+
|
340
|
+
attach_function :bt_message_packet_beginning_borrow_stream_class_default_clock_class_const,
|
341
|
+
[ :bt_message_handle ],
|
342
|
+
:bt_clock_class_handle
|
343
|
+
|
344
|
+
class BTMessage
|
345
|
+
class PacketBeginning < BTMessage
|
346
|
+
def initialize(handle = nil, retain: true, auto_release: true,
|
347
|
+
self_message_iterator: nil, packet: nil, clock_snapshot_value: nil)
|
348
|
+
if handle
|
349
|
+
super(handle, retain: retain, auto_release: auto_release)
|
350
|
+
else
|
351
|
+
handle = if clock_snapshot_value
|
352
|
+
Babeltrace2.bt_message_packet_beginning_create_with_default_clock_snapshot(
|
353
|
+
self_message_iterator, packet, clock_snapshot_value)
|
354
|
+
else
|
355
|
+
Babeltrace2.bt_message_packet_beginning_create(
|
356
|
+
self_message_iterator, packet)
|
357
|
+
end
|
358
|
+
raise Babeltrace2.process_error if handle.null?
|
359
|
+
super(handle)
|
360
|
+
end
|
361
|
+
end
|
362
|
+
|
363
|
+
def get_packet
|
364
|
+
handle = Babeltrace2.bt_message_packet_beginning_borrow_packet(@handle)
|
365
|
+
BTPacket.new(handle, retain: true, auto_release: true)
|
366
|
+
end
|
367
|
+
alias packet get_packet
|
368
|
+
|
369
|
+
def get_default_clock_snapshot
|
370
|
+
handle = Babeltrace2.bt_message_packet_beginning_borrow_default_clock_snapshot_const(@handle)
|
371
|
+
BTClockSnapshot.new(handle)
|
372
|
+
end
|
373
|
+
alias default_clock_snapshot get_default_clock_snapshot
|
374
|
+
|
375
|
+
def get_stream_class_default_clock_class
|
376
|
+
handle = Babeltrace2.bt_message_packet_beginning_borrow_stream_class_default_clock_class_const(@handle)
|
377
|
+
BTClockClass.new(handle, retain: true, auto_release: true)
|
378
|
+
end
|
379
|
+
alias stream_class_default_clock_class get_stream_class_default_clock_class
|
380
|
+
end
|
381
|
+
end
|
382
|
+
BTMessagePacketBeginning = BTMessage::PacketBeginning
|
383
|
+
|
384
|
+
attach_function :bt_message_packet_end_create,
|
385
|
+
[ :bt_self_message_iterator_handle,
|
386
|
+
:bt_packet_handle ],
|
387
|
+
:bt_message_handle
|
388
|
+
|
389
|
+
attach_function :bt_message_packet_end_create_with_default_clock_snapshot,
|
390
|
+
[ :bt_self_message_iterator_handle,
|
391
|
+
:bt_packet_handle, :uint64 ],
|
392
|
+
:bt_message_handle
|
393
|
+
|
394
|
+
attach_function :bt_message_packet_end_borrow_packet,
|
395
|
+
[ :bt_message_handle ],
|
396
|
+
:bt_packet_handle
|
397
|
+
|
398
|
+
attach_function :bt_message_packet_end_borrow_packet_const,
|
399
|
+
[ :bt_message_handle ],
|
400
|
+
:bt_packet_handle
|
401
|
+
|
402
|
+
attach_function :bt_message_packet_end_borrow_default_clock_snapshot_const,
|
403
|
+
[ :bt_message_handle ],
|
404
|
+
:bt_clock_snapshot_handle
|
405
|
+
|
406
|
+
attach_function :bt_message_packet_end_borrow_stream_class_default_clock_class_const,
|
407
|
+
[ :bt_message_handle ],
|
408
|
+
:bt_clock_class_handle
|
409
|
+
|
410
|
+
class BTMessage
|
411
|
+
class PacketEnd < BTMessage
|
412
|
+
def initialize(handle = nil, retain: true, auto_release: true,
|
413
|
+
self_message_iterator: nil, packet: nil, clock_snapshot_value: nil)
|
414
|
+
if handle
|
415
|
+
super(handle, retain: retain, auto_release: auto_release)
|
416
|
+
else
|
417
|
+
handle = if clock_snapshot_value
|
418
|
+
Babeltrace2.bt_message_packet_end_create_with_default_clock_snapshot(
|
419
|
+
self_message_iterator, packet, clock_snapshot_value)
|
420
|
+
else
|
421
|
+
Babeltrace2.bt_message_packet_end_create(
|
422
|
+
self_message_iterator, packet)
|
423
|
+
end
|
424
|
+
raise Babeltrace2.process_error if handle.null?
|
425
|
+
super(handle)
|
426
|
+
end
|
427
|
+
end
|
428
|
+
|
429
|
+
def get_packet
|
430
|
+
handle = Babeltrace2.bt_message_packet_end_borrow_packet(@handle)
|
431
|
+
BTPacket.new(handle, retain: true, auto_release: true)
|
432
|
+
end
|
433
|
+
alias packet get_packet
|
434
|
+
|
435
|
+
def get_default_clock_snapshot
|
436
|
+
handle = Babeltrace2.bt_message_packet_end_borrow_default_clock_snapshot_const(@handle)
|
437
|
+
BTClockSnapshot.new(handle)
|
438
|
+
end
|
439
|
+
alias default_clock_snapshot get_default_clock_snapshot
|
440
|
+
|
441
|
+
def get_stream_class_default_clock_class
|
442
|
+
handle = Babeltrace2.bt_message_packet_end_borrow_stream_class_default_clock_class_const(@handle)
|
443
|
+
BTClockClass.new(handle, retain: true, auto_release: true)
|
444
|
+
end
|
445
|
+
alias stream_class_default_clock_class get_stream_class_default_clock_class
|
446
|
+
end
|
447
|
+
end
|
448
|
+
BTMessagePacketEnd = BTMessage::PacketEnd
|
449
|
+
|
450
|
+
attach_function :bt_message_discarded_events_create,
|
451
|
+
[ :bt_self_message_iterator_handle,
|
452
|
+
:bt_stream_handle ],
|
453
|
+
:bt_message_handle
|
454
|
+
|
455
|
+
attach_function :bt_message_discarded_events_create_with_default_clock_snapshots,
|
456
|
+
[ :bt_self_message_iterator_handle,
|
457
|
+
:bt_stream_handle, :uint64, :uint64 ],
|
458
|
+
:bt_message_handle
|
459
|
+
|
460
|
+
attach_function :bt_message_discarded_events_borrow_stream,
|
461
|
+
[ :bt_message_handle ],
|
462
|
+
:bt_stream_handle
|
463
|
+
|
464
|
+
attach_function :bt_message_discarded_events_borrow_stream_const,
|
465
|
+
[ :bt_message_handle ],
|
466
|
+
:bt_stream_handle
|
467
|
+
|
468
|
+
attach_function :bt_message_discarded_events_borrow_beginning_default_clock_snapshot_const,
|
469
|
+
[ :bt_message_handle ],
|
470
|
+
:bt_clock_snapshot_handle
|
471
|
+
|
472
|
+
attach_function :bt_message_discarded_events_borrow_end_default_clock_snapshot_const,
|
473
|
+
[ :bt_message_handle ],
|
474
|
+
:bt_clock_snapshot_handle
|
475
|
+
|
476
|
+
attach_function :bt_message_discarded_events_borrow_stream_class_default_clock_class_const,
|
477
|
+
[ :bt_message_handle ],
|
478
|
+
:bt_clock_class_handle
|
479
|
+
|
480
|
+
attach_function :bt_message_discarded_events_set_count,
|
481
|
+
[ :bt_message_handle, :uint64 ],
|
482
|
+
:void
|
483
|
+
|
484
|
+
attach_function :bt_message_discarded_events_get_count,
|
485
|
+
[ :bt_message_handle, :pointer ],
|
486
|
+
:bt_property_availability
|
487
|
+
|
488
|
+
class BTMessage
|
489
|
+
class DiscardedEvents < BTMessage
|
490
|
+
def initialize(handle = nil, retain: true, auto_release: true,
|
491
|
+
self_message_iterator: nil, stream: nil,
|
492
|
+
beginning_clock_snapshot_value: nil,
|
493
|
+
end_clock_snapshot_value: nil)
|
494
|
+
if handle
|
495
|
+
super(handle, retain: retain, auto_release: auto_release)
|
496
|
+
else
|
497
|
+
handle = if beginning_clock_snapshot_value && end_clock_snapshot_value
|
498
|
+
Babeltrace2.bt_message_discarded_events_create_with_default_clock_snapshots(
|
499
|
+
self_message_iterator, stream,
|
500
|
+
beginning_clock_snapshot_value, end_clock_snapshot_value)
|
501
|
+
else
|
502
|
+
Babeltrace2.bt_message_discarded_events_create(
|
503
|
+
self_message_iterator, stream)
|
504
|
+
end
|
505
|
+
raise Babeltrace2.process_error if handle.null?
|
506
|
+
super(handle)
|
507
|
+
end
|
508
|
+
end
|
509
|
+
|
510
|
+
def get_stream
|
511
|
+
handle = Babeltrace2.bt_message_discarded_events_borrow_stream(@handle)
|
512
|
+
BTStream.new(handle, retain: true, auto_release: true)
|
513
|
+
end
|
514
|
+
alias stream get_stream
|
515
|
+
|
516
|
+
def get_beginning_default_clock_snapshot
|
517
|
+
handle = Babeltrace2.bt_message_discarded_events_borrow_beginning_default_clock_snapshot_const(@handle)
|
518
|
+
BTClockSnapshot.new(handle)
|
519
|
+
end
|
520
|
+
alias beginning_default_clock_snapshot get_beginning_default_clock_snapshot
|
521
|
+
|
522
|
+
def get_end_default_clock_snapshot
|
523
|
+
handle = Babeltrace2.bt_message_discarded_events_borrow_end_default_clock_snapshot_const(@handle)
|
524
|
+
BTClockSnapshot.new(handle)
|
525
|
+
end
|
526
|
+
alias end_default_clock_snapshot get_end_default_clock_snapshot
|
527
|
+
|
528
|
+
def get_stream_class_default_clock_class
|
529
|
+
handle = Babeltrace2.bt_message_discarded_events_borrow_stream_class_default_clock_class_const(@handle)
|
530
|
+
BTClockClass.new(handle, retain: true, auto_release: true)
|
531
|
+
end
|
532
|
+
alias stream_class_default_clock_class get_stream_class_default_clock_class
|
533
|
+
|
534
|
+
def set_count(count)
|
535
|
+
Babeltrace2.bt_message_discarded_events_set_count(@handle, count)
|
536
|
+
self
|
537
|
+
end
|
538
|
+
|
539
|
+
def count=(count)
|
540
|
+
set_count(count)
|
541
|
+
count
|
542
|
+
end
|
543
|
+
|
544
|
+
def get_count
|
545
|
+
ptr = FFI::MemoryPointer.new(:pointer)
|
546
|
+
res = Babeltrace2.bt_message_discarded_events_get_count(@handle, ptr)
|
547
|
+
return nil if res == :BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE
|
548
|
+
ptr.read_uint64
|
549
|
+
end
|
550
|
+
alias count get_count
|
551
|
+
end
|
552
|
+
end
|
553
|
+
BTMessageDiscardedEvents = BTMessage::DiscardedEvents
|
554
|
+
|
555
|
+
attach_function :bt_message_discarded_packets_create,
|
556
|
+
[ :bt_self_message_iterator_handle,
|
557
|
+
:bt_stream_handle ],
|
558
|
+
:bt_message_handle
|
559
|
+
|
560
|
+
attach_function :bt_message_discarded_packets_create_with_default_clock_snapshots,
|
561
|
+
[ :bt_self_message_iterator_handle,
|
562
|
+
:bt_stream_handle, :uint64, :uint64 ],
|
563
|
+
:bt_message_handle
|
564
|
+
|
565
|
+
attach_function :bt_message_discarded_packets_borrow_stream,
|
566
|
+
[ :bt_message_handle ],
|
567
|
+
:bt_stream_handle
|
568
|
+
|
569
|
+
attach_function :bt_message_discarded_packets_borrow_stream_const,
|
570
|
+
[ :bt_message_handle ],
|
571
|
+
:bt_stream_handle
|
572
|
+
|
573
|
+
attach_function :bt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const,
|
574
|
+
[ :bt_message_handle ],
|
575
|
+
:bt_clock_snapshot_handle
|
576
|
+
|
577
|
+
attach_function :bt_message_discarded_packets_borrow_end_default_clock_snapshot_const,
|
578
|
+
[ :bt_message_handle ],
|
579
|
+
:bt_clock_snapshot_handle
|
580
|
+
|
581
|
+
attach_function :bt_message_discarded_packets_borrow_stream_class_default_clock_class_const,
|
582
|
+
[ :bt_message_handle ],
|
583
|
+
:bt_clock_class_handle
|
584
|
+
|
585
|
+
attach_function :bt_message_discarded_packets_set_count,
|
586
|
+
[ :bt_message_handle, :uint64 ],
|
587
|
+
:void
|
588
|
+
|
589
|
+
attach_function :bt_message_discarded_packets_get_count,
|
590
|
+
[ :bt_message_handle, :pointer ],
|
591
|
+
:bt_property_availability
|
592
|
+
|
593
|
+
class BTMessage
|
594
|
+
class DiscardedPackets < BTMessage
|
595
|
+
def initialize(handle = nil, retain: true, auto_release: true,
|
596
|
+
self_message_iterator: nil, stream: nil,
|
597
|
+
beginning_clock_snapshot_value: nil,
|
598
|
+
end_clock_snapshot_value: nil)
|
599
|
+
if handle
|
600
|
+
super(handle, retain: retain, auto_release: auto_release)
|
601
|
+
else
|
602
|
+
handle = if beginning_clock_snapshot_value && end_clock_snapshot_value
|
603
|
+
Babeltrace2.bt_message_discarded_packets_create_with_default_clock_snapshots(
|
604
|
+
self_message_iterator, stream,
|
605
|
+
beginning_clock_snapshot_value, end_clock_snapshot_value)
|
606
|
+
else
|
607
|
+
Babeltrace2.bt_message_discarded_packets_create(
|
608
|
+
self_message_iterator, stream)
|
609
|
+
end
|
610
|
+
raise Babeltrace2.process_error if handle.null?
|
611
|
+
super(handle)
|
612
|
+
end
|
613
|
+
end
|
614
|
+
|
615
|
+
def get_stream
|
616
|
+
handle = Babeltrace2.bt_message_discarded_packets_borrow_stream(@handle)
|
617
|
+
BTStream.new(handle, retain: true, auto_release: true)
|
618
|
+
end
|
619
|
+
alias stream get_stream
|
620
|
+
|
621
|
+
def get_beginning_default_clock_snapshot
|
622
|
+
handle = Babeltrace2.bt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const(@handle)
|
623
|
+
BTClockSnapshot.new(handle)
|
624
|
+
end
|
625
|
+
alias beginning_default_clock_snapshot get_beginning_default_clock_snapshot
|
626
|
+
|
627
|
+
def get_end_default_clock_snapshot
|
628
|
+
handle = Babeltrace2.bt_message_discarded_packets_borrow_end_default_clock_snapshot_const(@handle)
|
629
|
+
BTClockSnapshot.new(handle)
|
630
|
+
end
|
631
|
+
alias end_default_clock_snapshot get_end_default_clock_snapshot
|
632
|
+
|
633
|
+
def get_stream_class_default_clock_class
|
634
|
+
handle = Babeltrace2.bt_message_discarded_packets_borrow_stream_class_default_clock_class_const(@handle)
|
635
|
+
BTClockClass.new(handle, retain: true, auto_release: true)
|
636
|
+
end
|
637
|
+
alias stream_class_default_clock_class get_stream_class_default_clock_class
|
638
|
+
|
639
|
+
def set_count(count)
|
640
|
+
Babeltrace2.bt_message_discarded_packets_set_count(@handle, count)
|
641
|
+
self
|
642
|
+
end
|
643
|
+
|
644
|
+
def count=(count)
|
645
|
+
set_count(count)
|
646
|
+
count
|
647
|
+
end
|
648
|
+
|
649
|
+
def get_count
|
650
|
+
ptr = FFI::MemoryPointer.new(:pointer)
|
651
|
+
res = Babeltrace2.bt_message_discarded_packets_get_count(@handle, ptr)
|
652
|
+
return nil if res == :BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE
|
653
|
+
ptr.read_uint64
|
654
|
+
end
|
655
|
+
alias count get_count
|
656
|
+
end
|
657
|
+
end
|
658
|
+
BTMessageDiscardedPackets = BTMessage::DiscardedPackets
|
659
|
+
|
660
|
+
attach_function :bt_message_message_iterator_inactivity_create,
|
661
|
+
[ :bt_self_message_iterator_handle,
|
662
|
+
:bt_clock_class_handle,
|
663
|
+
:uint64 ],
|
664
|
+
:bt_message_handle
|
665
|
+
|
666
|
+
attach_function :bt_message_message_iterator_inactivity_borrow_clock_snapshot_const,
|
667
|
+
[ :bt_message_handle ],
|
668
|
+
:bt_clock_snapshot_handle
|
669
|
+
|
670
|
+
class BTMessage
|
671
|
+
class MessageIteratorInactivity < BTMessage
|
672
|
+
def initialize(handle = nil, retain: true, auto_release: true,
|
673
|
+
self_message_iterator: nil, clock_class: nil,
|
674
|
+
clock_snapshot_value: nil)
|
675
|
+
if handle
|
676
|
+
super(handle, retain: retain, auto_release: auto_release)
|
677
|
+
else
|
678
|
+
handle = Babeltrace2.bt_message_message_iterator_inactivity_create(
|
679
|
+
self_message_iterator, clock_class, clock_snapshot_value)
|
680
|
+
raise Babeltrace2.process_error if handle.null?
|
681
|
+
super(handle)
|
682
|
+
end
|
683
|
+
end
|
684
|
+
|
685
|
+
def get_clock_snapshot
|
686
|
+
handle = Babeltrace2.bt_message_message_iterator_inactivity_borrow_clock_snapshot_const(@handle)
|
687
|
+
BTClockSnapshot.new(handle)
|
688
|
+
end
|
689
|
+
alias clock_snapshot get_clock_snapshot
|
690
|
+
end
|
691
|
+
end
|
692
|
+
BTMessageMessageIteratorInactivity = BTMessage::MessageIteratorInactivity
|
693
|
+
|
694
|
+
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_OK = BT_FUNC_STATUS_OK
|
695
|
+
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_NO_MATCH = BT_FUNC_STATUS_NO_MATCH
|
696
|
+
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_MEMORY_ERROR = BT_FUNC_STATUS_MEMORY_ERROR
|
697
|
+
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_ERROR = BT_FUNC_STATUS_ERROR
|
698
|
+
BTGetGreatestOperativeMipVersionStatus =
|
699
|
+
enum :bt_get_greatest_operative_mip_version_status,
|
700
|
+
[ :BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_OK,
|
701
|
+
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_OK,
|
702
|
+
:BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_NO_MATCH,
|
703
|
+
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_NO_MATCH,
|
704
|
+
:BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_MEMORY_ERROR,
|
705
|
+
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_MEMORY_ERROR,
|
706
|
+
:BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_ERROR,
|
707
|
+
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_ERROR ]
|
708
|
+
|
709
|
+
attach_function :bt_get_greatest_operative_mip_version,
|
710
|
+
[ :bt_component_descriptor_set_handle,
|
711
|
+
:bt_logging_level, :pointer ],
|
712
|
+
:bt_get_greatest_operative_mip_version_status
|
713
|
+
|
714
|
+
attach_function :bt_get_maximal_mip_version,
|
715
|
+
[],
|
716
|
+
:uint64
|
717
|
+
|
718
|
+
alias get_maximal_mip_version bt_get_maximal_mip_version
|
719
|
+
alias maximal_mip_version get_maximal_mip_version
|
720
|
+
|
721
|
+
end
|