projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Privatize struct bt_trace descriptor, move trace path
[babeltrace.git]
/
formats
/
ctf
/
ctf.c
diff --git
a/formats/ctf/ctf.c
b/formats/ctf/ctf.c
index 25f2caff3b5155a033f90363efbcc26a4e9b03ae..c3249a01775b9280d99936f7a6970a543fdcff24 100644
(file)
--- a/
formats/ctf/ctf.c
+++ b/
formats/ctf/ctf.c
@@
-426,9
+426,9
@@
void ctf_print_discarded(FILE *fp, struct ctf_stream_definition *stream,
}
fprintf(fp, "] in trace UUID ");
print_uuid(fp, stream->stream_class->trace->uuid);
}
fprintf(fp, "] in trace UUID ");
print_uuid(fp, stream->stream_class->trace->uuid);
- if (stream->stream_class->trace->path[0])
+ if (stream->stream_class->trace->pa
rent.pa
th[0])
fprintf(fp, ", at path: \"%s\"",
fprintf(fp, ", at path: \"%s\"",
- stream->stream_class->trace->path);
+ stream->stream_class->trace->pa
rent.pa
th);
fprintf(fp, ", within stream id %" PRIu64, stream->stream_id);
if (stream->path[0])
fprintf(fp, ", within stream id %" PRIu64, stream->stream_id);
if (stream->path[0])
@@
-606,7
+606,8
@@
error:
return ret;
}
return ret;
}
-int ctf_init_pos(struct ctf_stream_pos *pos, int fd, int open_flags)
+int ctf_init_pos(struct ctf_stream_pos *pos, struct bt_trace_descriptor *trace,
+ int fd, int open_flags)
{
pos->fd = fd;
if (fd >= 0) {
{
pos->fd = fd;
if (fd >= 0) {
@@
-624,12
+625,14
@@
int ctf_init_pos(struct ctf_stream_pos *pos, int fd, int open_flags)
pos->flags = MAP_PRIVATE;
pos->parent.rw_table = read_dispatch_table;
pos->parent.event_cb = ctf_read_event;
pos->flags = MAP_PRIVATE;
pos->parent.rw_table = read_dispatch_table;
pos->parent.event_cb = ctf_read_event;
+ pos->parent.trace = trace;
break;
case O_RDWR:
pos->prot = PROT_WRITE; /* Write has priority */
pos->flags = MAP_SHARED;
pos->parent.rw_table = write_dispatch_table;
pos->parent.event_cb = ctf_write_event;
break;
case O_RDWR:
pos->prot = PROT_WRITE; /* Write has priority */
pos->flags = MAP_SHARED;
pos->parent.rw_table = write_dispatch_table;
pos->parent.event_cb = ctf_write_event;
+ pos->parent.trace = trace;
if (fd >= 0)
ctf_packet_seek(&pos->parent, 0, SEEK_SET); /* position for write */
break;
if (fd >= 0)
ctf_packet_seek(&pos->parent, 0, SEEK_SET); /* position for write */
break;
@@
-1643,7
+1646,7
@@
int ctf_open_file_stream_read(struct ctf_trace *td, const char *path, int flags,
goto error_def;
}
goto error_def;
}
- ret = ctf_init_pos(&file_stream->pos, fd, flags);
+ ret = ctf_init_pos(&file_stream->pos,
&td->parent,
fd, flags);
if (ret)
goto error_def;
ret = create_trace_definitions(td, &file_stream->parent);
if (ret)
goto error_def;
ret = create_trace_definitions(td, &file_stream->parent);
@@
-1708,8
+1711,8
@@
int ctf_open_trace_read(struct ctf_trace *td,
ret = -errno;
goto error_dirfd;
}
ret = -errno;
goto error_dirfd;
}
- strncpy(td->pa
th, path, sizeof(td->
path));
- td->pa
th[sizeof(td->
path) - 1] = '\0';
+ strncpy(td->pa
rent.path, path, sizeof(td->parent.
path));
+ td->pa
rent.path[sizeof(td->parent.
path) - 1] = '\0';
/*
* Keep the metadata file separate.
/*
* Keep the metadata file separate.
This page took
0.024073 seconds
and
4
git commands to generate.