Commit 3e5990b0 authored by Brice Videau's avatar Brice Videau
Browse files

Add support for static arrays in babeltrace model.

parent 0b3c3d73
...@@ -44,7 +44,11 @@ def parse_field(field) ...@@ -44,7 +44,11 @@ def parse_field(field)
d[:class_properties] = props d[:class_properties] = props
when 'ctf_string', 'ctf_sequence_text' when 'ctf_string', 'ctf_sequence_text'
d[:class] = 'string' d[:class] = 'string'
when 'ctf_sequence', 'ctf_array' when 'ctf_array'
d[:class] = 'array_static'
d[:field] = parse_field({ 'lttng' => 'ctf_integer', 'type' => field['type'], 'pointer'=> field['pointer'] })
d[:length] = field['length']
when 'ctf_sequence'
d[:class] = 'array_dynamic' d[:class] = 'array_dynamic'
d[:field] = parse_field({ 'lttng' => 'ctf_integer', 'type' => field['type'], 'pointer' => field['pointer'] }) d[:field] = parse_field({ 'lttng' => 'ctf_integer', 'type' => field['type'], 'pointer' => field['pointer'] })
when 'ctf_sequence_hex' when 'ctf_sequence_hex'
......
...@@ -105,6 +105,7 @@ event_lambda = lambda { |c, dir| ...@@ -105,6 +105,7 @@ event_lambda = lambda { |c, dir|
meta_field["array"] = true if LTTng.array?(*lttng) meta_field["array"] = true if LTTng.array?(*lttng)
meta_field["string"] = true if LTTng.string?(*lttng) meta_field["string"] = true if LTTng.string?(*lttng)
meta_field["lttng"] = lttng[0] meta_field["lttng"] = lttng[0]
meta_field["length"] = lttng[4] if meta_field["lttng"].match("ctf_array")
fields[fname] = meta_field fields[fname] = meta_field
} }
else else
...@@ -142,6 +143,7 @@ event_lambda = lambda { |c, dir| ...@@ -142,6 +143,7 @@ event_lambda = lambda { |c, dir|
meta_field["array"] = true if LTTng.array?(*lttng) meta_field["array"] = true if LTTng.array?(*lttng)
meta_field["string"] = true if LTTng.string?(*lttng) meta_field["string"] = true if LTTng.string?(*lttng)
meta_field["lttng"] = lttng[0] meta_field["lttng"] = lttng[0]
meta_field["length"] = lttng[4] if meta_field["lttng"].match("ctf_array")
fields[fname] = meta_field fields[fname] = meta_field
} }
end end
......
...@@ -90,7 +90,7 @@ def create_datastructure(trace_class, l) ...@@ -90,7 +90,7 @@ def create_datastructure(trace_class, l)
end end
def callback_create_static_array(trace_class, d) def callback_create_static_array(trace_class, d)
trace_class.create_dynamic_array(callback(trace_class, d[:field]), d[:length]) trace_class.create_static_array(callback(trace_class, d[:field]), d[:length])
end end
create_callback_aliases(['array_static'], 'static_array') create_callback_aliases(['array_static'], 'static_array')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment