# Generates the preamble of the packet opening/closing functions for
# the data stream type `dst`.
#}
-{% macro open_close_func_preamble(dst) %}
+{% macro open_close_func_preamble(dst, ts_feature) %}
struct {{ prefix }}ctx * const ctx = &sctx->parent;
-{% if dst.default_clock_type %}
+{% if dst.default_clock_type and ts_feature %}
const {{ cg_opts.clock_type_c_types[dst.default_clock_type] }} ts = ctx->use_cur_last_event_ts ?
sctx->cur_last_event_ts :
ctx->cbs.{{ dst.default_clock_type.name }}_clock_get_value(ctx->data);
{% include 'c/open-func-proto.j2' %}
{
- {{ macros.open_close_func_preamble(dst) | indent_tab }}
+ {{ macros.open_close_func_preamble(dst, dst.features.packet_features.beginning_timestamp_field_type) | indent_tab }}
/*
* This function is either called by a tracing function, or
{% include 'c/close-func-proto.j2' %}
{
- {{ macros.open_close_func_preamble(dst) | indent_tab }}
+ {{ macros.open_close_func_preamble(dst, dst.features.packet_features.end_timestamp_field_type) | indent_tab }}
/*
* This function is either called by a tracing function, or
const uint32_t ert_id)
{
struct {{ ctx_struct_name }} * const ctx = _FROM_VOID_PTR(struct {{ ctx_struct_name }}, vctx);
- {% if def_clk_type %}
+ {% if def_clk_type and dst.features.event_record_features.timestamp_field_type %}
struct {{ sctx_name }}_ctx * const sctx = _FROM_VOID_PTR(struct {{ sctx_name }}_ctx, vctx);
const {{ cg_opts.clock_type_c_types[def_clk_type] }} ts = sctx->cur_last_event_ts;
{% endif %}