summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a03dd9f)
Since bt_notification_event_create() freezes its clock class priority
map, pass which clock class priority map to use each time you call
bt_ctf_notif_iter_get_next_notification().
In ctf.fs, it's always the same because all the clock classes are known
when the trace object is created.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
struct bt_ctf_event_class *event_class;
} meta;
struct bt_ctf_event_class *event_class;
} meta;
- /* Clock class priority map (owned by this) */
- struct bt_clock_class_priority_map *cc_prio_map;
-
/* Current packet (NULL if not created yet) */
struct bt_ctf_packet *packet;
/* Current packet (NULL if not created yet) */
struct bt_ctf_packet *packet;
static
void notify_event(struct bt_ctf_notif_iter *notit,
static
void notify_event(struct bt_ctf_notif_iter *notit,
+ struct bt_clock_class_priority_map *cc_prio_map,
struct bt_notification **notification)
{
struct bt_ctf_event *event;
struct bt_notification **notification)
{
struct bt_ctf_event *event;
- ret = bt_notification_event_create(event, notit->cc_prio_map);
+ ret = bt_notification_event_create(event, cc_prio_map);
BT_HIDDEN
struct bt_ctf_notif_iter *bt_ctf_notif_iter_create(struct bt_ctf_trace *trace,
BT_HIDDEN
struct bt_ctf_notif_iter *bt_ctf_notif_iter_create(struct bt_ctf_trace *trace,
- struct bt_clock_class_priority_map *cc_prio_map,
size_t max_request_sz,
struct bt_ctf_notif_iter_medium_ops medops,
void *data, FILE *err_stream)
size_t max_request_sz,
struct bt_ctf_notif_iter_medium_ops medops,
void *data, FILE *err_stream)
assert(medops.request_bytes);
assert(medops.get_stream);
notit = g_new0(struct bt_ctf_notif_iter, 1);
assert(medops.request_bytes);
assert(medops.get_stream);
notit = g_new0(struct bt_ctf_notif_iter, 1);
PERR("Failed to initialize stream clock states\n");
goto error;
}
PERR("Failed to initialize stream clock states\n");
goto error;
}
- notit->cc_prio_map = bt_get(cc_prio_map);
notit->meta.trace = bt_get(trace);
notit->medium.medops = medops;
notit->medium.max_request_sz = max_request_sz;
notit->meta.trace = bt_get(trace);
notit->medium.medops = medops;
notit->medium.max_request_sz = max_request_sz;
void bt_ctf_notif_iter_destroy(struct bt_ctf_notif_iter *notit)
{
void bt_ctf_notif_iter_destroy(struct bt_ctf_notif_iter *notit)
{
- BT_PUT(notit->cc_prio_map);
BT_PUT(notit->meta.trace);
BT_PUT(notit->meta.stream_class);
BT_PUT(notit->meta.event_class);
BT_PUT(notit->meta.trace);
BT_PUT(notit->meta.stream_class);
BT_PUT(notit->meta.event_class);
enum bt_ctf_notif_iter_status bt_ctf_notif_iter_get_next_notification(
struct bt_ctf_notif_iter *notit,
enum bt_ctf_notif_iter_status bt_ctf_notif_iter_get_next_notification(
struct bt_ctf_notif_iter *notit,
+ struct bt_clock_class_priority_map *cc_prio_map,
struct bt_notification **notification)
{
enum bt_ctf_notif_iter_status status = BT_CTF_NOTIF_ITER_STATUS_OK;
struct bt_notification **notification)
{
enum bt_ctf_notif_iter_status status = BT_CTF_NOTIF_ITER_STATUS_OK;
goto end;
case STATE_EMIT_NOTIF_EVENT:
PDBG("Emitting event notification\n");
goto end;
case STATE_EMIT_NOTIF_EVENT:
PDBG("Emitting event notification\n");
- notify_event(notit, notification);
+ notify_event(notit, cc_prio_map, notification);
if (!*notification) {
status = BT_CTF_NOTIF_ITER_STATUS_ERROR;
}
if (!*notification) {
status = BT_CTF_NOTIF_ITER_STATUS_ERROR;
}
* incremented.
*
* @param trace Trace to read
* incremented.
*
* @param trace Trace to read
- * @param cc_prio_map Clock class priority map to use when
- * creating the event notifications
* @param max_request_sz Maximum buffer size, in bytes, to
* request to
* bt_ctf_notif_iter_medium_ops::request_bytes()
* @param max_request_sz Maximum buffer size, in bytes, to
* request to
* bt_ctf_notif_iter_medium_ops::request_bytes()
*/
BT_HIDDEN
struct bt_ctf_notif_iter *bt_ctf_notif_iter_create(struct bt_ctf_trace *trace,
*/
BT_HIDDEN
struct bt_ctf_notif_iter *bt_ctf_notif_iter_create(struct bt_ctf_trace *trace,
- struct bt_clock_class_priority_map *cc_prio_map,
size_t max_request_sz, struct bt_ctf_notif_iter_medium_ops medops,
void *medops_data, FILE *err_stream);
size_t max_request_sz, struct bt_ctf_notif_iter_medium_ops medops,
void *medops_data, FILE *err_stream);
* call this function again, until another status is returned.
*
* @param notif_iter CTF notification iterator
* call this function again, until another status is returned.
*
* @param notif_iter CTF notification iterator
+ * @param cc_prio_map Clock class priority map to use when
+ * creating an event notification
* @param notification Returned notification if the function's
* return value is #BT_CTF_NOTIF_ITER_STATUS_OK
* @returns One of #bt_ctf_notif_iter_status values
* @param notification Returned notification if the function's
* return value is #BT_CTF_NOTIF_ITER_STATUS_OK
* @returns One of #bt_ctf_notif_iter_status values
BT_HIDDEN
enum bt_ctf_notif_iter_status bt_ctf_notif_iter_get_next_notification(
struct bt_ctf_notif_iter *notit,
BT_HIDDEN
enum bt_ctf_notif_iter_status bt_ctf_notif_iter_get_next_notification(
struct bt_ctf_notif_iter *notit,
+ struct bt_clock_class_priority_map *cc_prio_map,
struct bt_notification **notification);
#endif /* CTF_NOTIF_ITER_H */
struct bt_notification **notification);
#endif /* CTF_NOTIF_ITER_H */
+ stream->cc_prio_map = bt_get(ctf_fs->cc_prio_map);
g_string_assign(stream->file->path, path);
ret = ctf_fs_file_open(ctf_fs, stream->file, "rb");
if (ret) {
g_string_assign(stream->file->path, path);
ret = ctf_fs_file_open(ctf_fs, stream->file, "rb");
if (ret) {
}
stream->notif_iter = bt_ctf_notif_iter_create(ctf_fs->metadata->trace,
}
stream->notif_iter = bt_ctf_notif_iter_create(ctf_fs->metadata->trace,
- ctf_fs->cc_prio_map, ctf_fs->page_size, medops, stream,
+ ctf_fs->page_size, medops, stream,
ctf_fs->error_fp);
if (!stream->notif_iter) {
goto error;
ctf_fs->error_fp);
if (!stream->notif_iter) {
goto error;
+ bt_put(stream->cc_prio_map);
+
if (stream->file) {
ctf_fs_file_destroy(stream->file);
}
if (stream->file) {
ctf_fs_file_destroy(stream->file);
}
}
notif_iter_status = bt_ctf_notif_iter_get_next_notification(stream->notif_iter,
}
notif_iter_status = bt_ctf_notif_iter_get_next_notification(stream->notif_iter,
+ stream->cc_prio_map, &ret.notification);
if (notif_iter_status != BT_CTF_NOTIF_ITER_STATUS_OK &&
notif_iter_status != BT_CTF_NOTIF_ITER_STATUS_EOF) {
goto translate_status;
if (notif_iter_status != BT_CTF_NOTIF_ITER_STATUS_OK &&
notif_iter_status != BT_CTF_NOTIF_ITER_STATUS_EOF) {
goto translate_status;
struct ctf_fs_stream {
struct ctf_fs_file *file;
struct bt_ctf_stream *stream;
struct ctf_fs_stream {
struct ctf_fs_file *file;
struct bt_ctf_stream *stream;
+ struct bt_clock_class_priority_map *cc_prio_map;
struct bt_ctf_notif_iter *notif_iter;
/* A stream is assumed to be indexed. */
struct index index;
struct bt_ctf_notif_iter *notif_iter;
/* A stream is assumed to be indexed. */
struct index index;