ds_file->mmap_addr = bt_mmap((void *) 0, ds_file->mmap_len,
PROT_READ, MAP_PRIVATE, fileno(ds_file->file->fp),
ds_file->mmap_offset);
ds_file->mmap_addr = bt_mmap((void *) 0, ds_file->mmap_len,
PROT_READ, MAP_PRIVATE, fileno(ds_file->file->fp),
ds_file->mmap_offset);
BT_HIDDEN
struct bt_notif_iter_medium_ops ctf_fs_ds_file_medops = {
.request_bytes = medop_request_bytes,
BT_HIDDEN
struct bt_notif_iter_medium_ops ctf_fs_ds_file_medops = {
.request_bytes = medop_request_bytes,
struct bt_field *packet_context,
struct bt_clock_class **_timestamp_begin_cc,
struct bt_field **_timestamp_begin,
struct bt_field *packet_context,
struct bt_clock_class **_timestamp_begin_cc,
struct bt_field **_timestamp_begin,
packet_context, "timestamp_begin");
if (!timestamp_begin) {
BT_LOGD_STR("Cannot retrieve timestamp_begin field in packet context.");
packet_context, "timestamp_begin");
if (!timestamp_begin) {
BT_LOGD_STR("Cannot retrieve timestamp_begin field in packet context.");
packet_context, "timestamp_end");
if (!timestamp_end) {
BT_LOGD_STR("Cannot retrieve timestamp_end field in packet context.");
packet_context, "timestamp_end");
if (!timestamp_end) {
BT_LOGD_STR("Cannot retrieve timestamp_end field in packet context.");
struct bt_clock_class **timestamp_begin_cc,
struct bt_clock_class **timestamp_end_cc)
{
struct bt_field *packet_context = NULL;
struct bt_clock_class **timestamp_begin_cc,
struct bt_clock_class **timestamp_end_cc)
{
struct bt_field *packet_context = NULL;
- int ret = ctf_fs_ds_file_get_packet_header_context_fields(ds_file,
- NULL, &packet_context);
+ int ret = ctf_fs_ds_file_borrow_packet_header_context_fields(ds_file,
+ NULL, &packet_context);
int convert_cycles_to_ns(struct bt_clock_class *clock_class,
uint64_t cycles, int64_t *ns)
{
int convert_cycles_to_ns(struct bt_clock_class *clock_class,
uint64_t cycles, int64_t *ns)
{
- int ret = 0;
- struct bt_clock_value *clock_value;
-
- assert(ns);
- clock_value = bt_clock_value_create(clock_class, cycles);
- if (!clock_value) {
- ret = -1;
- goto end;
- }
-
- ret = bt_clock_value_get_value_ns_from_epoch(clock_value, ns);
- if (ret) {
- goto end;
- }
-end:
- bt_put(clock_value);
- return ret;
+ return bt_clock_class_cycles_to_ns(clock_class, cycles, ns);
BT_LOGD("Building index from .idx file of stream file %s",
ds_file->file->path->str);
BT_LOGD("Building index from .idx file of stream file %s",
ds_file->file->path->str);
×tamp_begin_cc, ×tamp_end_cc);
if (ret) {
BT_LOGD_STR("Cannot get clock classes of \"timestamp_begin\" "
×tamp_begin_cc, ×tamp_end_cc);
if (ret) {
BT_LOGD_STR("Cannot get clock classes of \"timestamp_begin\" "
×tamp_begin_cc, ×tamp_begin,
×tamp_end_cc, ×tamp_end);
if (ret || !timestamp_begin_cc || !timestamp_begin ||
×tamp_begin_cc, ×tamp_begin,
×tamp_end_cc, ×tamp_end);
if (ret || !timestamp_begin_cc || !timestamp_begin ||
off_t next_packet_offset;
off_t current_packet_size, current_packet_size_bytes;
struct ctf_fs_ds_index_entry *entry;
off_t next_packet_offset;
off_t current_packet_size, current_packet_size_bytes;
struct ctf_fs_ds_index_entry *entry;
- iter_status = bt_notif_iter_get_packet_header_context_fields(
- ds_file->notif_iter, NULL, &packet_context);
+ iter_status = bt_notif_iter_borrow_packet_header_context_fields(
+ ds_file->notif_iter, NULL, &packet_context);
if (current_packet_size < 0) {
BT_LOGE("Cannot get packet size: packet-offset=%jd",
current_packet_offset);
goto error;
}
current_packet_size_bytes =
if (current_packet_size < 0) {
BT_LOGE("Cannot get packet size: packet-offset=%jd",
current_packet_offset);
goto error;
}
current_packet_size_bytes =
- current_packet_size_bytes,
- current_packet_offset);
+ current_packet_size_bytes,
+ current_packet_offset);
BT_HIDDEN
struct ctf_fs_ds_file *ctf_fs_ds_file_create(
struct ctf_fs_trace *ctf_fs_trace,
BT_HIDDEN
struct ctf_fs_ds_file *ctf_fs_ds_file_create(
struct ctf_fs_trace *ctf_fs_trace,
- ds_file->notif_iter, ds_file->cc_prio_map, &ret.notification);
+ ds_file->notif_iter, ds_file->cc_prio_map, ds_file->graph,
+ &ret.notification);
struct ctf_fs_ds_file *ds_file,
struct bt_field **packet_header_field,
struct bt_field **packet_context_field)
struct ctf_fs_ds_file *ds_file,
struct bt_field **packet_header_field,
struct bt_field **packet_context_field)
ds_file->notif_iter, packet_header_field, packet_context_field);
switch (notif_iter_status) {
case BT_NOTIF_ITER_STATUS_EOF:
ds_file->notif_iter, packet_header_field, packet_context_field);
switch (notif_iter_status) {
case BT_NOTIF_ITER_STATUS_EOF: