diff --git a/cuda/Makefile.am b/cuda/Makefile.am index d28c3833..d8093bc7 100644 --- a/cuda/Makefile.am +++ b/cuda/Makefile.am @@ -156,7 +156,7 @@ CUDART_MODEL = \ $(top_srcdir)/utils/LTTng.rb \ $(srcdir)/cudart.h.include -cuda_babeltrace_model.yaml: $(srcdir)/gen_babeltrace_cuda_model.rb $(CUDA_MODEL) +cuda_babeltrace_model.yaml: $(srcdir)/gen_babeltrace_cuda_model.rb $(CUDA_MODEL) $(top_srcdir)/utils/gen_babeltrace_model_helper.rb SRC_DIR=$(srcdir) $(RUBY) $< > $@ CLEANFILES += \ diff --git a/hip/Makefile.am b/hip/Makefile.am index 5453798b..f387ae7a 100644 --- a/hip/Makefile.am +++ b/hip/Makefile.am @@ -222,7 +222,7 @@ HIP_MODEL = \ $(top_srcdir)/utils/LTTng.rb \ hip.h.include -hip_babeltrace_model.yaml: $(srcdir)/gen_babeltrace_hip_model.rb $(HIP_MODEL) +hip_babeltrace_model.yaml: $(srcdir)/gen_babeltrace_hip_model.rb $(HIP_MODEL) $(top_srcdir)/utils/gen_babeltrace_model_helper.rb SRC_DIR=$(srcdir) $(RUBY) $< > $@ CLEANFILES += \ diff --git a/mpi/Makefile.am b/mpi/Makefile.am index 43f7f70d..b3424df0 100644 --- a/mpi/Makefile.am +++ b/mpi/Makefile.am @@ -49,7 +49,7 @@ MPI_MODEL = \ $(top_srcdir)/utils/LTTng.rb \ $(MPI_EXTRACTED) -mpi_babeltrace_model.yaml: $(srcdir)/gen_babeltrace_mpi_model.rb $(MPI_MODEL) +mpi_babeltrace_model.yaml: $(srcdir)/gen_babeltrace_mpi_model.rb $(MPI_MODEL) $(top_srcdir)/utils/gen_babeltrace_model_helper.rb SRC_DIR=$(srcdir) $(RUBY) $< > $@ CLEANFILES += \ diff --git a/omp/Makefile.am b/omp/Makefile.am index 65d432b7..69545c12 100644 --- a/omp/Makefile.am +++ b/omp/Makefile.am @@ -57,6 +57,7 @@ BTX_OMP_GENERATED = \ btx_filter_omp/btx_main.c OMP_LIB_GEN = \ + $(top_srcdir)/utils/gen_babeltrace_model_helper.rb \ $(top_srcdir)/utils/gen_library_base.rb \ $(srcdir)/gen_omp_library_base.rb \ $(srcdir)/gen_probe_base.rb diff --git a/utils/gen_babeltrace_model_helper.rb b/utils/gen_babeltrace_model_helper.rb index 3dcbbd29..a6757e71 100644 --- a/utils/gen_babeltrace_model_helper.rb +++ b/utils/gen_babeltrace_model_helper.rb @@ -13,6 +13,8 @@ def get_extra_fields_types_name(event) }.flatten(1) end +$types_by_name = $all_types.map { |ty| [ty.name, ty] }.to_h + def gen_bt_field_model(lttng_name, type, name, lttng) field = { name: name, cast_type: type} case lttng_name @@ -42,16 +44,15 @@ def gen_bt_field_model(lttng_name, type, name, lttng) field[:length] = lttng.length when 'ctf_string' field[:class] = 'string' - when 'ctf_sequence_text' + when 'ctf_sequence_text', 'ctf_array_text' field[:class] = 'string' - if $all_struct_names.include?(type.sub(" *", "")) - field[:be_class] = to_scoped_class_name(type.sub(" *", "")) + field[:length] = lttng.length if lttng_name == 'ctf_array_text' + t = type.sub(" *", "") + while $types_by_name.include?(t) && $types_by_name[t].type.kind_of?(YAMLCAst::CustomType) + t = $types_by_name[t].type.name end - when 'ctf_array_text' - field[:class] = 'string' - field[:length] = lttng.length - if $all_struct_names.include?(type.sub(" *", "")) - field[:be_class] = to_scoped_class_name(type.sub(" *", "")) + if $all_struct_names.include?(t) + field[:be_class] = to_scoped_class_name(t) end else raise "unsupported lttng type: #{lttng.inspect}" diff --git a/ze/Makefile.am b/ze/Makefile.am index bc4ca036..20d14200 100644 --- a/ze/Makefile.am +++ b/ze/Makefile.am @@ -199,6 +199,7 @@ install-data-hook: $(RM) -r $(DESTDIR)$(tmplibdir) ZE_LIB_GEN = \ + $(top_srcdir)/utils/gen_babeltrace_model_helper.rb \ $(top_srcdir)/utils/gen_library_base.rb \ $(srcdir)/gen_ze_library_base.rb \ $(srcdir)/gen_probe_base.rb diff --git a/ze/zel_meta_parameters.yaml b/ze/zel_meta_parameters.yaml index 47c41e98..bacb5b85 100644 --- a/ze/zel_meta_parameters.yaml +++ b/ze/zel_meta_parameters.yaml @@ -2,10 +2,6 @@ meta_parameters: zelTracerCreate: - [ InScalar, desc ] - zelTracerSetPrologues: - - [ InScalar, pCoreCbs ] - zelTracerSetEpilogues: - - [ InScalar, pCoreCbs ] zelLoaderGetVersions: - [ InOutScalar, num_elems ] - [ OutArray, versions, num_elems ] diff --git a/ze/zet_meta_parameters.yaml b/ze/zet_meta_parameters.yaml index d4e40abf..832fa3a1 100644 --- a/ze/zet_meta_parameters.yaml +++ b/ze/zet_meta_parameters.yaml @@ -97,7 +97,3 @@ meta_parameters: zetTracerExpCreate: - [ InScalar, desc ] - [ OutScalar, phTracer ] - zetTracerExpSetPrologues: - - [ InScalar, pCoreCbs ] - zetTracerExpSetEpilogues: - - [ InScalar, pCoreCbs ]