From ed4a69c02ec552b30ac71bcd1832fa747851d185 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Wed, 23 Sep 2020 18:18:08 -0400 Subject: [PATCH] barectf.h.j2: add barectf_discarded_event_records_count() barectf_discarded_event_records_count() is an alias of barectf_packet_events_discarded(). The count of discarded event records is not related to the current packet; it's a data stream variable. This change helps document the platform API. Signed-off-by: Philippe Proulx --- barectf/templates/c/barectf.c.j2 | 5 +++++ barectf/templates/c/barectf.h.j2 | 1 + 2 files changed, 6 insertions(+) diff --git a/barectf/templates/c/barectf.c.j2 b/barectf/templates/c/barectf.c.j2 index 44d9b76..f7e7a39 100644 --- a/barectf/templates/c/barectf.c.j2 +++ b/barectf/templates/c/barectf.c.j2 @@ -90,6 +90,11 @@ uint32_t {{ prefix }}packet_events_discarded(const void * const vctx) return _FROM_VOID_PTR(const struct {{ ctx_struct_name }}, vctx)->events_discarded; } +uint32_t {{ prefix }}discarded_event_records_count(const void * const vctx) +{ + return {{ prefix }}packet_events_discarded(vctx); +} + uint8_t *{{ prefix }}packet_buf(const void * const vctx) { return _FROM_VOID_PTR(const struct {{ ctx_struct_name }}, vctx)->buf; diff --git a/barectf/templates/c/barectf.h.j2 b/barectf/templates/c/barectf.h.j2 index d8691f5..405e825 100644 --- a/barectf/templates/c/barectf.h.j2 +++ b/barectf/templates/c/barectf.h.j2 @@ -68,6 +68,7 @@ uint32_t {{ prefix }}packet_size(const void *ctx); int {{ prefix }}packet_is_full(const void *ctx); int {{ prefix }}packet_is_empty(const void *ctx); uint32_t {{ prefix }}packet_events_discarded(const void *ctx); +uint32_t {{ prefix }}discarded_event_records_count(const void * const ctx); uint8_t *{{ prefix }}packet_buf(const void *ctx); void {{ prefix }}packet_set_buf(void *ctx, uint8_t *buf, uint32_t buf_size); uint32_t {{ prefix }}packet_buf_size(const void *ctx); -- 2.34.1