projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib: make trace IR API const-correct
[babeltrace.git]
/
plugins
/
utils
/
trimmer
/
iterator.c
diff --git
a/plugins/utils/trimmer/iterator.c
b/plugins/utils/trimmer/iterator.c
index a70fd8a16cfd5a7f46f7475956cd339f8d45a280..6b5699a299139ef5949455da6f232400f1834639 100644
(file)
--- a/
plugins/utils/trimmer/iterator.c
+++ b/
plugins/utils/trimmer/iterator.c
@@
-42,21
+42,21
@@
static
gboolean close_packets(gpointer key, gpointer value, gpointer user_data)
{
static
gboolean close_packets(gpointer key, gpointer value, gpointer user_data)
{
- struct bt_packet *writer_packet = value;
+
const
struct bt_packet *writer_packet = value;
- bt_
put
(writer_packet);
+ bt_
object_put_ref
(writer_packet);
return TRUE;
}
BT_HIDDEN
return TRUE;
}
BT_HIDDEN
-void trimmer_iterator_finalize(struct bt_
private_connection_private
_notification_iterator *it)
+void trimmer_iterator_finalize(struct bt_
self
_notification_iterator *it)
{
struct trimmer_iterator *trim_it;
{
struct trimmer_iterator *trim_it;
- trim_it = bt_
private_connection_private
_notification_iterator_get_user_data(it);
+ trim_it = bt_
self
_notification_iterator_get_user_data(it);
BT_ASSERT(trim_it);
BT_ASSERT(trim_it);
- bt_
put
(trim_it->input_iterator);
+ bt_
object_put_ref
(trim_it->input_iterator);
g_hash_table_foreach_remove(trim_it->packet_map,
close_packets, NULL);
g_hash_table_destroy(trim_it->packet_map);
g_hash_table_foreach_remove(trim_it->packet_map,
close_packets, NULL);
g_hash_table_destroy(trim_it->packet_map);
@@
-65,7
+65,7
@@
void trimmer_iterator_finalize(struct bt_private_connection_private_notification
BT_HIDDEN
enum bt_notification_iterator_status trimmer_iterator_init(
BT_HIDDEN
enum bt_notification_iterator_status trimmer_iterator_init(
- struct bt_
private_connection_private
_notification_iterator *iterator,
+ struct bt_
self
_notification_iterator *iterator,
struct bt_private_port *port)
{
enum bt_notification_iterator_status ret =
struct bt_private_port *port)
{
enum bt_notification_iterator_status ret =
@@
-74,8
+74,8
@@
enum bt_notification_iterator_status trimmer_iterator_init(
enum bt_connection_status conn_status;
struct bt_private_port *input_port = NULL;
struct bt_private_connection *connection = NULL;
enum bt_connection_status conn_status;
struct bt_private_port *input_port = NULL;
struct bt_private_connection *connection = NULL;
- struct bt_
private
_component *component =
- bt_
private_connection_private
_notification_iterator_get_private_component(iterator);
+ struct bt_
self
_component *component =
+ bt_
self
_notification_iterator_get_private_component(iterator);
struct trimmer_iterator *it_data = g_new0(struct trimmer_iterator, 1);
if (!it_data) {
struct trimmer_iterator *it_data = g_new0(struct trimmer_iterator, 1);
if (!it_data) {
@@
-84,10
+84,10
@@
enum bt_notification_iterator_status trimmer_iterator_init(
}
/* Create a new iterator on the upstream component. */
}
/* Create a new iterator on the upstream component. */
- input_port = bt_
private_component_filter_get_input_private
_port_by_name(
+ input_port = bt_
self_component_filter_get_input
_port_by_name(
component, "in");
BT_ASSERT(input_port);
component, "in");
BT_ASSERT(input_port);
- connection = bt_private_port_get_
private_
connection(input_port);
+ connection = bt_private_port_get_connection(input_port);
BT_ASSERT(connection);
conn_status = bt_private_connection_create_notification_iterator(connection,
BT_ASSERT(connection);
conn_status = bt_private_connection_create_notification_iterator(connection,
@@
-101,15
+101,15
@@
enum bt_notification_iterator_status trimmer_iterator_init(
it_data->packet_map = g_hash_table_new_full(g_direct_hash,
g_direct_equal, NULL, NULL);
it_data->packet_map = g_hash_table_new_full(g_direct_hash,
g_direct_equal, NULL, NULL);
- it_ret = bt_
private_connection_private
_notification_iterator_set_user_data(iterator,
+ it_ret = bt_
self
_notification_iterator_set_user_data(iterator,
it_data);
if (it_ret) {
goto end;
}
end:
it_data);
if (it_ret) {
goto end;
}
end:
- bt_
put
(component);
- bt_
put
(connection);
- bt_
put
(input_port);
+ bt_
object_put_ref
(component);
+ bt_
object_put_ref
(connection);
+ bt_
object_put_ref
(input_port);
return ret;
}
return ret;
}
@@
-182,12
+182,12
@@
struct bt_notification *evaluate_event_notification(
{
int64_t ts;
int clock_ret;
{
int64_t ts;
int clock_ret;
- struct bt_event *event = NULL, *writer_event;
+
const
struct bt_event *event = NULL, *writer_event;
bool in_range = true;
bool in_range = true;
- struct bt_clock_class *clock_class = NULL;
- struct bt_trace *trace = NULL;
- struct bt_stream *stream = NULL;
- struct bt_stream_class *stream_class = NULL;
+
const
struct bt_clock_class *clock_class = NULL;
+
const
struct bt_trace *trace = NULL;
+
const
struct bt_stream *stream = NULL;
+
const
struct bt_stream_class *stream_class = NULL;
struct bt_clock_value *clock_value = NULL;
bool lazy_update = false;
struct bt_notification *new_notification = NULL;
struct bt_clock_value *clock_value = NULL;
bool lazy_update = false;
struct bt_notification *new_notification = NULL;
@@
-202,7
+202,7
@@
struct bt_notification *evaluate_event_notification(
BT_ASSERT(writer_event);
new_notification = bt_notification_event_create(writer_event, cc_prio_map);
BT_ASSERT(new_notification);
BT_ASSERT(writer_event);
new_notification = bt_notification_event_create(writer_event, cc_prio_map);
BT_ASSERT(new_notification);
- bt_
put
(cc_prio_map);
+ bt_
object_put_ref
(cc_prio_map);
stream = bt_event_get_stream(event);
BT_ASSERT(stream);
stream = bt_event_get_stream(event);
BT_ASSERT(stream);
@@
-254,39
+254,39
@@
struct bt_notification *evaluate_event_notification(
goto end;
error:
goto end;
error:
- BT_
PU
T(new_notification);
+ BT_
OBJECT_PUT_REF_AND_RESE
T(new_notification);
end:
end:
- bt_
put
(event);
- bt_
put
(writer_event);
- bt_
put
(clock_class);
- bt_
put
(trace);
- bt_
put
(stream);
- bt_
put
(stream_class);
- bt_
put
(clock_value);
+ bt_
object_put_ref
(event);
+ bt_
object_put_ref
(writer_event);
+ bt_
object_put_ref
(clock_class);
+ bt_
object_put_ref
(trace);
+ bt_
object_put_ref
(stream);
+ bt_
object_put_ref
(stream_class);
+ bt_
object_put_ref
(clock_value);
*_event_in_range = in_range;
return new_notification;
}
static
*_event_in_range = in_range;
return new_notification;
}
static
-int ns_from_integer_field(struct bt_field *integer, int64_t *ns)
+int ns_from_integer_field(
const
struct bt_field *integer, int64_t *ns)
{
int ret = 0;
int is_signed;
uint64_t raw_clock_value;
{
int ret = 0;
int is_signed;
uint64_t raw_clock_value;
-
struct bt_field_type *integer_type
= NULL;
- struct bt_clock_class *clock_class = NULL;
+
const struct bt_field_class *integer_class
= NULL;
+
const
struct bt_clock_class *clock_class = NULL;
struct bt_clock_value *clock_value = NULL;
struct bt_clock_value *clock_value = NULL;
- integer_
type = bt_field_get_type
(integer);
- BT_ASSERT(integer_
type
);
- clock_class = bt_field_
type
_integer_get_mapped_clock_class(
- integer_
type
);
+ integer_
class = bt_field_get_class
(integer);
+ BT_ASSERT(integer_
class
);
+ clock_class = bt_field_
class
_integer_get_mapped_clock_class(
+ integer_
class
);
if (!clock_class) {
ret = -1;
goto end;
}
if (!clock_class) {
ret = -1;
goto end;
}
- is_signed = bt_
ctf_field_type_integer_get_signed(integer_type
);
+ is_signed = bt_
field_class_integer_is_signed(integer_class
);
if (!is_signed) {
ret = bt_field_unsigned_integer_get_value(integer,
&raw_clock_value);
if (!is_signed) {
ret = bt_field_unsigned_integer_get_value(integer,
&raw_clock_value);
@@
-306,9
+306,9
@@
int ns_from_integer_field(struct bt_field *integer, int64_t *ns)
ret = bt_clock_value_get_value_ns_from_epoch(clock_value, ns);
end:
ret = bt_clock_value_get_value_ns_from_epoch(clock_value, ns);
end:
- bt_
put(integer_type
);
- bt_
put
(clock_class);
- bt_
put
(clock_value);
+ bt_
object_put_ref(integer_class
);
+ bt_
object_put_ref
(clock_class);
+ bt_
object_put_ref
(clock_value);
return ret;
}
return ret;
}
@@
-329,14
+329,14
@@
static uint64_t ns_from_value(uint64_t frequency, uint64_t value)
* timestamp minus the offset.
*/
static
* timestamp minus the offset.
*/
static
-int64_t get_raw_timestamp(struct bt_packet *writer_packet,
+int64_t get_raw_timestamp(
const
struct bt_packet *writer_packet,
int64_t timestamp)
{
int64_t timestamp)
{
- struct bt_clock_class *writer_clock_class;
+
const
struct bt_clock_class *writer_clock_class;
int64_t sec_offset, cycles_offset, ns;
int64_t sec_offset, cycles_offset, ns;
- struct bt_trace *writer_trace;
- struct bt_stream *writer_stream;
- struct bt_stream_class *writer_stream_class;
+
const
struct bt_trace *writer_trace;
+
const
struct bt_stream *writer_stream;
+
const
struct bt_stream_class *writer_stream_class;
int ret;
uint64_t freq;
int ret;
uint64_t freq;
@@
-366,10
+366,10
@@
int64_t get_raw_timestamp(struct bt_packet *writer_packet,
ns += ns_from_value(freq, cycles_offset);
ns += ns_from_value(freq, cycles_offset);
- bt_
put
(writer_clock_class);
- bt_
put
(writer_trace);
- bt_
put
(writer_stream_class);
- bt_
put
(writer_stream);
+ bt_
object_put_ref
(writer_clock_class);
+ bt_
object_put_ref
(writer_trace);
+ bt_
object_put_ref
(writer_stream_class);
+ bt_
object_put_ref
(writer_stream);
return timestamp - ns;
}
return timestamp - ns;
}
@@
-383,8
+383,8
@@
struct bt_notification *evaluate_packet_notification(
{
int64_t begin_ns, pkt_begin_ns, end_ns, pkt_end_ns;
bool in_range = true;
{
int64_t begin_ns, pkt_begin_ns, end_ns, pkt_end_ns;
bool in_range = true;
- struct bt_packet *packet = NULL, *writer_packet = NULL;
- struct bt_field *packet_context = NULL,
+
const
struct bt_packet *packet = NULL, *writer_packet = NULL;
+
const
struct bt_field *packet_context = NULL,
*timestamp_begin = NULL,
*timestamp_end = NULL;
struct bt_notification *new_notification = NULL;
*timestamp_begin = NULL,
*timestamp_end = NULL;
struct bt_notification *new_notification = NULL;
@@
-492,11
+492,11
@@
end:
}
end_no_notif:
*_packet_in_range = in_range;
}
end_no_notif:
*_packet_in_range = in_range;
- bt_
put
(packet);
- bt_
put
(writer_packet);
- bt_
put
(packet_context);
- bt_
put
(timestamp_begin);
- bt_
put
(timestamp_end);
+ bt_
object_put_ref
(packet);
+ bt_
object_put_ref
(writer_packet);
+ bt_
object_put_ref
(packet_context);
+ bt_
object_put_ref
(timestamp_begin);
+ bt_
object_put_ref
(timestamp_end);
return new_notification;
}
return new_notification;
}
@@
-505,7
+505,7
@@
struct bt_notification *evaluate_stream_notification(
struct bt_notification *notification,
struct trimmer_iterator *trim_it)
{
struct bt_notification *notification,
struct trimmer_iterator *trim_it)
{
- struct bt_stream *stream;
+
const
struct bt_stream *stream;
stream = bt_notification_stream_end_get_stream(notification);
BT_ASSERT(stream);
stream = bt_notification_stream_end_get_stream(notification);
BT_ASSERT(stream);
@@
-545,7
+545,7
@@
enum bt_notification_iterator_status evaluate_notification(
default:
break;
}
default:
break;
}
- BT_
PU
T(*notification);
+ BT_
OBJECT_PUT_REF_AND_RESE
T(*notification);
*notification = new_notification;
if (finished) {
*notification = new_notification;
if (finished) {
@@
-557,10
+557,10
@@
enum bt_notification_iterator_status evaluate_notification(
BT_HIDDEN
struct bt_notification_iterator_next_method_return trimmer_iterator_next(
BT_HIDDEN
struct bt_notification_iterator_next_method_return trimmer_iterator_next(
- struct bt_
private_connection_private
_notification_iterator *iterator)
+ struct bt_
self
_notification_iterator *iterator)
{
struct trimmer_iterator *trim_it = NULL;
{
struct trimmer_iterator *trim_it = NULL;
- struct bt_
private
_component *component = NULL;
+ struct bt_
self
_component *component = NULL;
struct trimmer *trimmer = NULL;
struct bt_notification_iterator *source_it = NULL;
struct bt_notification_iterator_next_method_return ret = {
struct trimmer *trimmer = NULL;
struct bt_notification_iterator *source_it = NULL;
struct bt_notification_iterator_next_method_return ret = {
@@
-569,13
+569,13
@@
struct bt_notification_iterator_next_method_return trimmer_iterator_next(
};
bool notification_in_range = false;
};
bool notification_in_range = false;
- trim_it = bt_
private_connection_private
_notification_iterator_get_user_data(iterator);
+ trim_it = bt_
self
_notification_iterator_get_user_data(iterator);
BT_ASSERT(trim_it);
BT_ASSERT(trim_it);
- component = bt_
private_connection_private
_notification_iterator_get_private_component(
+ component = bt_
self
_notification_iterator_get_private_component(
iterator);
BT_ASSERT(component);
iterator);
BT_ASSERT(component);
- trimmer = bt_
private
_component_get_user_data(component);
+ trimmer = bt_
self
_component_get_user_data(component);
BT_ASSERT(trimmer);
source_it = trim_it->input_iterator;
BT_ASSERT(trimmer);
source_it = trim_it->input_iterator;
@@
-598,7
+598,7
@@
struct bt_notification_iterator_next_method_return trimmer_iterator_next(
&trimmer->begin, &trimmer->end,
¬ification_in_range);
if (!notification_in_range) {
&trimmer->begin, &trimmer->end,
¬ification_in_range);
if (!notification_in_range) {
- BT_
PU
T(ret.notification);
+ BT_
OBJECT_PUT_REF_AND_RESE
T(ret.notification);
}
if (ret.status != BT_NOTIFICATION_ITERATOR_STATUS_OK) {
}
if (ret.status != BT_NOTIFICATION_ITERATOR_STATUS_OK) {
@@
-606,6
+606,6
@@
struct bt_notification_iterator_next_method_return trimmer_iterator_next(
}
}
end:
}
}
end:
- bt_
put
(component);
+ bt_
object_put_ref
(component);
return ret;
}
return ret;
}
This page took
0.029455 seconds
and
4
git commands to generate.