Commit 07959be3 authored by Brice Videau's avatar Brice Videau
Browse files

Reusing old test (WIP).

parent 4418371c
Pipeline #12856 failed with stage
......@@ -202,8 +202,8 @@ libTestingCLProf_la_LDFLAGS = $(BABELTRACE2_LIBS) -avoid-version -module
TEST_FILES = \
tests/opencl_dummy_trace.dust \
tests/profiling_normal.dust \
tests/trace.dust
# profiling_normal.dust \
# profiling_inversed.dust \
# profiling_block.dust \
# profiling_fast.dust \
......
......@@ -48,8 +48,10 @@ bt_component_class_initialize_method_status opencl_dispatch_initialize(
{
<% if $sink_type == 'testing' %>
test_type_value = bt_value_map_borrow_entry_value_const(params, "test");
bt_value_get_ref(test_type_value);
<% elsif $sink_type == 'production' %>
display_mode = bt_value_map_borrow_entry_value_const(params, "display");
bt_value_get_ref(display_mode);
<% end %>
/* Allocate a private data structure */
......@@ -99,6 +101,11 @@ void opencl_dispatch_finalize(bt_self_component_sink *self_component_sink)
utarray_free(s2->callbacks);
free(s2);
}
<% if $sink_type == 'testing' %>
bt_value_put_ref(test_type_value);
<% elsif $sink_type == 'production' %>
bt_value_put_ref(display_mode);
<% end %>
/* Free the allocated structure */
free(opencl_dispatch);
}
......
#!/usr/bin/env sh
name="$(basename $1 .dust)"
echo @RUBY@ @top_srcdir@/utils/dust.rb -s @builddir@/opencl_babeltrace_model.yaml -f $1
echo BABELTRACE_PLUGIN_PATH=@builddir@/.libs/ DUST_TRACE_DIR=@srcdir@/tests @RUBY@ @top_srcdir@/utils/dust.rb -s @builddir@/opencl_babeltrace_model.yaml -f $1
BABELTRACE_PLUGIN_PATH=@builddir@/.libs/ DUST_TRACE_DIR=@srcdir@/tests @RUBY@ @top_srcdir@/utils/dust.rb -s @builddir@/opencl_babeltrace_model.yaml -f $1
---
:trace: opencl_dummy_trace.yaml
:plugins:
- sink:opencl:dispatch
- :name: sink:opencl:dispatch
---
:trace: profiling_normal.yaml
:plugins:
- :name: sink:testing_clprof:dispatch
:params:
test: profiling_normal
---
:hostname: aurora12.gov
:stream_classes:
- :name: cl_stream_class
:schemas:
- thapi_opencl
:clock_snapshot_value: true
:common_context:
- :name: vpid
:class: signed
- :name: vtid
:class: unsigned
:streams:
- :name: stream0
:class: cl_stream_class
:common_context:
vpid: -1
vtid: 2
:events:
- :name: lttng_ust_opencl:clEnqueueReadBuffer_entry
:stream: stream0
- :name: lttng_ust_opencl_profiling:event_profiling
:stream: stream0
:payload:
event: 12
- :name: lttng_ust_opencl:clEnqueueReadBuffer_exit
:stream: stream0
- :name: lttng_ust_opencl_profiling:event_profiling_results
:stream: stream0
:payload:
event: 12
start: 0
end: 10
:common_context:
vtid: 3
---
:trace: trace.yaml
:plugins:
- sink:opencl:dispatch
- :name: sink:text:pretty
......@@ -4,6 +4,7 @@ require 'optparse'
$options = {
sink: 'text:details',
sink_params: {},
schemas: [],
trace: nil
}
......@@ -23,9 +24,10 @@ OptionParser.new do |opts|
dust_schema = YAML.load_file(path)
trace = dust_schema[:trace]
plugins = dust_schema[:plugins]
sink = plugins.select { |p| p.match(/^sink/) }.last
sink = plugins.select { |p| p[:name].match(/^sink/) }.last
if sink
$options[:sink] = sink.split(":")[1..2]
$options[:sink_params] = sink[:params] if sink[:params]
$options[:sink] = sink[:name].split(":")[1..2]
end
$options[:trace] = trace
end
......@@ -257,6 +259,7 @@ dust_in_initialize_method = lambda { |self_component, _configuration, _params, _
bt_trace_class = self_component.create_trace_class
bt_trace = bt_trace_class.create_trace
bt_trace.set_environment_entry_string("hostname", in_data[:hostname]) if in_data[:hostname]
d_stream_class = schema_in_data[:stream_classes].map { |stream_class|
create_bt_stream_class(bt_trace_class, bt_clock_class, stream_class)
......@@ -308,6 +311,13 @@ dust_in_initialize_method = lambda { |self_component, _configuration, _params, _
clock_snapshot_value = clock_snapshot_values[stream]
clock_snapshot_values[stream] += 1
end
if event[:common_context]
if common_context
common_context = common_context.merge(event[:common_context])
else
common_context = event[:common_context]
end
end
[stream, event_class, common_context, event[:payload], clock_snapshot_value, 'message']
}
......@@ -336,10 +346,11 @@ sink_text_details = BT2::BTPlugin.find($options[:sink][0]).get_sink_component_cl
graph = BT2::BTGraph.new
comp1 = graph.add(dust_in_class, 'dust')
comp2 = graph.add(sink_text_details, $options[:sink].join(":"))
comp2 = graph.add(sink_text_details, $options[:sink].join(":"), params: $options[:sink_params])
op = comp1.output_port(0)
ip = comp2.input_port(0)
graph.connect_ports(op, ip)
graph.run
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