Commit ce4058ca authored by Brice Videau's avatar Brice Videau
Browse files

Added basic tools to dump babeltrace2 trace format.

parent 4a37710b
Pipeline #12961 canceled with stage
......@@ -111,6 +111,9 @@ libTracerOpenCL_la_LDFLAGS += -Wl,--version-script,$(srcdir)/ -
libTracerOpenCL_la_DEPENDS = $(srcdir)/
libTracerOpenCL_la_LIBADD =
$(top_srcdir)/utils/ ./.libs/ lttng_ust_opencl:\*,lttng_ust_opencl_build:\*,lttng_ust_opencl_arguments:\*,lttng_ust_opencl_dump:\*,lttng_ust_opencl_profiling:\*,lttng_ust_opencl_source:\*,lttng_ust_opencl_devices:\*
$(MKDIR_P) $(DESTDIR)$(pkglibdir)/opencl
$(LN_S) -f $(DESTDIR)$(libdir)/ $(DESTDIR)$(pkglibdir)/opencl/
require 'babeltrace2'
require 'yaml'
require 'find'
require 'set'
path = ARGV[0]
trace_location = Find.find(path).select { |f|
File.basename(f) == "metadata" }.collect { |f|
graph =
ctf_fs = BT2::BTPlugin.find("ctf").get_source_component_class_by_name("fs")
utils_muxer = BT2::BTPlugin.find("utils").get_filter_component_class_by_name("muxer")
printed = false
comp1 = graph.add(ctf_fs, "trace", params: {"inputs" => trace_location})
comp2 = graph.add(utils_muxer, "mux")
comp3 = graph.add_simple_sink("print", lambda { |iterator, _|
mess = iterator.next_messages
mess.each { |m|
if !printed
puts YAML.dump(
printed = true
comp1.output_ports.each_with_index { |op, i|
ip = comp2.input_port(i)
graph.connect_ports(op, ip)
graph.connect_ports(comp2.output_port(0), comp3.input_port(0))
lttng-sessiond --daemonize --quiet
lttng create thapi-session --output=./thapi-session
lttng enable-channel --userspace --blocking-timeout=inf blocking-channel
lttng add-context --userspace --channel=blocking-channel -t vpid -t vtid
lttng enable-event --channel=blocking-channel --userspace $2
lttng start
lttng stop
lttng destroy
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