* [BABELTRACE PATCH 1/2] Support ctf index version 1.1
@ 2015-08-20 1:19 Julien Desfossez
0 siblings, 0 replies; 2+ messages in thread
From: Julien Desfossez @ 2015-08-20 1:19 UTC (permalink / raw)
To: mathieu.desnoyers, jgalar; +Cc: lttng-dev, Julien Desfossez
Produced by LTTng as of 2.8 (no compatibility breakage with 1.0)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
---
formats/ctf/ctf.c | 10 +++++++++-
include/babeltrace/ctf/ctf-index.h | 5 ++++-
include/babeltrace/ctf/types.h | 3 +++
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c
index 74fcb5b..c5bb6eb 100644
--- a/formats/ctf/ctf.c
+++ b/formats/ctf/ctf.c
@@ -1547,6 +1547,8 @@ begin:
packet_index.ts_cycles.timestamp_end = 0;
packet_index.events_discarded = 0;
packet_index.events_discarded_len = 0;
+ packet_index.stream_instance_id = 0;
+ packet_index.packet_seq_num = 0;
/* read and check header, set stream id (and check) */
if (file_stream->parent.trace_packet_header) {
@@ -1833,7 +1835,7 @@ int import_stream_packet_index(struct ctf_trace *td,
struct ctf_packet_index *ctf_index = NULL;
struct ctf_packet_index_file_hdr index_hdr;
struct packet_index index;
- uint32_t packet_index_len;
+ uint32_t packet_index_len, index_minor;
int ret = 0;
int first_packet = 1;
size_t len;
@@ -1861,6 +1863,8 @@ int import_stream_packet_index(struct ctf_trace *td,
ret = -1;
goto error;
}
+ index_minor = be32toh(index_hdr.index_minor);
+
packet_index_len = be32toh(index_hdr.packet_index_len);
if (packet_index_len == 0) {
fprintf(stderr, "[error] Packet index length cannot be 0.\n");
@@ -1887,6 +1891,10 @@ int import_stream_packet_index(struct ctf_trace *td,
index.events_discarded_len = 64;
index.data_offset = -1;
stream_id = be64toh(ctf_index->stream_id);
+ if (index_minor >= 1) {
+ index.stream_instance_id = be64toh(ctf_index->stream_instance_id);
+ index.packet_seq_num = be64toh(ctf_index->packet_seq_num);
+ }
if (!first_packet) {
/* add index to packet array */
diff --git a/include/babeltrace/ctf/ctf-index.h b/include/babeltrace/ctf/ctf-index.h
index b39b523..8880c2f 100644
--- a/include/babeltrace/ctf/ctf-index.h
+++ b/include/babeltrace/ctf/ctf-index.h
@@ -29,7 +29,7 @@
#define CTF_INDEX_MAGIC 0xC1F1DCC1
#define CTF_INDEX_MAJOR 1
-#define CTF_INDEX_MINOR 0
+#define CTF_INDEX_MINOR 1
/*
* Header at the beginning of each index file.
@@ -55,6 +55,9 @@ struct ctf_packet_index {
uint64_t timestamp_end;
uint64_t events_discarded;
uint64_t stream_id;
+ /* CTF_INDEX 1.0 limit */
+ uint64_t stream_instance_id; /* ID of the channel instance */
+ uint64_t packet_seq_num; /* packet sequence number */
} __attribute__((__packed__));
#endif /* LTTNG_INDEX_H */
diff --git a/include/babeltrace/ctf/types.h b/include/babeltrace/ctf/types.h
index c336632..cc8acbf 100644
--- a/include/babeltrace/ctf/types.h
+++ b/include/babeltrace/ctf/types.h
@@ -58,6 +58,9 @@ struct packet_index {
uint64_t events_discarded_len; /* length of the field, in bits */
struct packet_index_time ts_cycles; /* timestamp in cycles */
struct packet_index_time ts_real; /* realtime timestamp */
+ /* CTF_INDEX 1.0 limit */
+ uint64_t stream_instance_id; /* ID of the channel instance */
+ uint64_t packet_seq_num; /* packet sequence number */
};
/*
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [BABELTRACE PATCH 1/2] Support ctf index version 1.1
[not found] <1440033598-14124-1-git-send-email-jdesfossez@efficios.com>
@ 2015-10-27 20:20 ` Jérémie Galarneau
0 siblings, 0 replies; 2+ messages in thread
From: Jérémie Galarneau @ 2015-10-27 20:20 UTC (permalink / raw)
To: Julien Desfossez; +Cc: lttng-dev, Jeremie Galarneau
Merged in master, thanks!
On Wed, Aug 19, 2015 at 9:19 PM, Julien Desfossez
<jdesfossez@efficios.com> wrote:
> Produced by LTTng as of 2.8 (no compatibility breakage with 1.0)
>
> Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
> ---
> formats/ctf/ctf.c | 10 +++++++++-
> include/babeltrace/ctf/ctf-index.h | 5 ++++-
> include/babeltrace/ctf/types.h | 3 +++
> 3 files changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c
> index 74fcb5b..c5bb6eb 100644
> --- a/formats/ctf/ctf.c
> +++ b/formats/ctf/ctf.c
> @@ -1547,6 +1547,8 @@ begin:
> packet_index.ts_cycles.timestamp_end = 0;
> packet_index.events_discarded = 0;
> packet_index.events_discarded_len = 0;
> + packet_index.stream_instance_id = 0;
> + packet_index.packet_seq_num = 0;
>
> /* read and check header, set stream id (and check) */
> if (file_stream->parent.trace_packet_header) {
> @@ -1833,7 +1835,7 @@ int import_stream_packet_index(struct ctf_trace *td,
> struct ctf_packet_index *ctf_index = NULL;
> struct ctf_packet_index_file_hdr index_hdr;
> struct packet_index index;
> - uint32_t packet_index_len;
> + uint32_t packet_index_len, index_minor;
> int ret = 0;
> int first_packet = 1;
> size_t len;
> @@ -1861,6 +1863,8 @@ int import_stream_packet_index(struct ctf_trace *td,
> ret = -1;
> goto error;
> }
> + index_minor = be32toh(index_hdr.index_minor);
> +
> packet_index_len = be32toh(index_hdr.packet_index_len);
> if (packet_index_len == 0) {
> fprintf(stderr, "[error] Packet index length cannot be 0.\n");
> @@ -1887,6 +1891,10 @@ int import_stream_packet_index(struct ctf_trace *td,
> index.events_discarded_len = 64;
> index.data_offset = -1;
> stream_id = be64toh(ctf_index->stream_id);
> + if (index_minor >= 1) {
> + index.stream_instance_id = be64toh(ctf_index->stream_instance_id);
> + index.packet_seq_num = be64toh(ctf_index->packet_seq_num);
> + }
>
> if (!first_packet) {
> /* add index to packet array */
> diff --git a/include/babeltrace/ctf/ctf-index.h b/include/babeltrace/ctf/ctf-index.h
> index b39b523..8880c2f 100644
> --- a/include/babeltrace/ctf/ctf-index.h
> +++ b/include/babeltrace/ctf/ctf-index.h
> @@ -29,7 +29,7 @@
>
> #define CTF_INDEX_MAGIC 0xC1F1DCC1
> #define CTF_INDEX_MAJOR 1
> -#define CTF_INDEX_MINOR 0
> +#define CTF_INDEX_MINOR 1
>
> /*
> * Header at the beginning of each index file.
> @@ -55,6 +55,9 @@ struct ctf_packet_index {
> uint64_t timestamp_end;
> uint64_t events_discarded;
> uint64_t stream_id;
> + /* CTF_INDEX 1.0 limit */
> + uint64_t stream_instance_id; /* ID of the channel instance */
> + uint64_t packet_seq_num; /* packet sequence number */
> } __attribute__((__packed__));
>
> #endif /* LTTNG_INDEX_H */
> diff --git a/include/babeltrace/ctf/types.h b/include/babeltrace/ctf/types.h
> index c336632..cc8acbf 100644
> --- a/include/babeltrace/ctf/types.h
> +++ b/include/babeltrace/ctf/types.h
> @@ -58,6 +58,9 @@ struct packet_index {
> uint64_t events_discarded_len; /* length of the field, in bits */
> struct packet_index_time ts_cycles; /* timestamp in cycles */
> struct packet_index_time ts_real; /* realtime timestamp */
> + /* CTF_INDEX 1.0 limit */
> + uint64_t stream_instance_id; /* ID of the channel instance */
> + uint64_t packet_seq_num; /* packet sequence number */
> };
>
> /*
> --
> 1.9.1
>
--
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-27 20:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-20 1:19 [BABELTRACE PATCH 1/2] Support ctf index version 1.1 Julien Desfossez
[not found] <1440033598-14124-1-git-send-email-jdesfossez@efficios.com>
2015-10-27 20:20 ` Jérémie Galarneau
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.