From 731087d8e045649286a83aa9909b8b0d79b3368d Mon Sep 17 00:00:00 2001 From: Julien Desfossez Date: Tue, 3 Dec 2013 17:34:56 -0500 Subject: [PATCH] Add a private pointer to the ctf_stream_pos This allows a custom packet_seek function to fetch private information about the current stream. Signed-off-by: Julien Desfossez Signed-off-by: Mathieu Desnoyers --- formats/ctf/ctf.c | 1 + include/babeltrace/ctf/types.h | 1 + include/babeltrace/format.h | 1 + 3 files changed, 3 insertions(+) diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index eef9f2ab..16a7ba0f 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -2188,6 +2188,7 @@ void ctf_init_mmap_pos(struct ctf_stream_pos *pos, pos->flags = MAP_PRIVATE; pos->parent.rw_table = read_dispatch_table; pos->parent.event_cb = ctf_read_event; + pos->priv = mmap_info->priv; } static diff --git a/include/babeltrace/ctf/types.h b/include/babeltrace/ctf/types.h index e90464dc..06c130f8 100644 --- a/include/babeltrace/ctf/types.h +++ b/include/babeltrace/ctf/types.h @@ -83,6 +83,7 @@ struct ctf_stream_pos { int dummy; /* dummy position, for length calculation */ struct bt_stream_callbacks *cb; /* Callbacks registered for iterator. */ + void *priv; }; static inline diff --git a/include/babeltrace/format.h b/include/babeltrace/format.h index 07e854fe..dea8e0e5 100644 --- a/include/babeltrace/format.h +++ b/include/babeltrace/format.h @@ -49,6 +49,7 @@ struct bt_trace_descriptor; struct bt_mmap_stream { int fd; struct bt_list_head list; + void *priv; }; struct bt_mmap_stream_list { -- 2.34.1