X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=lib%2Fgraph%2Fnotification%2Finactivity.c;h=a8bd036756ce3754134fbfb8b32336ab0ee68720;hb=e2f7325d1e58710ee928373592adcee466f93d06;hp=605942e72ccda8fdf174ad289875413b18ce922d;hpb=65300d60e4b4f167e5fc8f584677757ce09a3844;p=babeltrace.git diff --git a/lib/graph/notification/inactivity.c b/lib/graph/notification/inactivity.c index 605942e7..a8bd0367 100644 --- a/lib/graph/notification/inactivity.c +++ b/lib/graph/notification/inactivity.c @@ -1,5 +1,5 @@ /* - * Copyright 2017 Philippe Proulx + * Copyright 2017-2018 Philippe Proulx * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -28,9 +28,11 @@ #include #include #include +#include +#include #include -#include #include +#include static void bt_notification_inactivity_destroy(struct bt_object *obj) @@ -38,7 +40,7 @@ void bt_notification_inactivity_destroy(struct bt_object *obj) struct bt_notification_inactivity *notification = (struct bt_notification_inactivity *) obj; - BT_LOGD("Destroying inactivity notification: addr=%p", notification); + BT_LIB_LOGD("Destroying inactivity notification: %!+n", notification); if (notification->default_cv) { bt_clock_value_recycle(notification->default_cv); @@ -48,15 +50,19 @@ void bt_notification_inactivity_destroy(struct bt_object *obj) } struct bt_notification *bt_notification_inactivity_create( - struct bt_private_connection_private_notification_iterator *notif_iter, + struct bt_self_notification_iterator *self_notif_iter, struct bt_clock_class *default_clock_class) { + struct bt_self_component_port_input_notification_iterator *notif_iter = + (void *) self_notif_iter; struct bt_notification_inactivity *notification; struct bt_notification *ret_notif = NULL; BT_ASSERT_PRE_NON_NULL(notif_iter, "Notification iterator"); BT_ASSERT_PRE_NON_NULL(default_clock_class, "Default clock class"); - BT_LOGD_STR("Creating inactivity notification object."); + BT_LIB_LOGD("Creating inactivity notification object: " + "%![iter-]+i, %![default-cc-]+K", notif_iter, + default_clock_class); notification = g_new0(struct bt_notification_inactivity, 1); if (!notification) { BT_LOGE_STR("Failed to allocate one inactivity notification."); @@ -71,18 +77,17 @@ struct bt_notification *bt_notification_inactivity_create( goto error; } - BT_LOGD("Created inactivity notification object: addr=%p", - ret_notif); + BT_LIB_LOGD("Created inactivity notification object: %!+n", ret_notif); goto end; error: BT_OBJECT_PUT_REF_AND_RESET(ret_notif); end: - return ret_notif; + return (void *) ret_notif; } -int bt_notification_inactivity_set_default_clock_value( +void bt_notification_inactivity_set_default_clock_value( struct bt_notification *notif, uint64_t value_cycles) { struct bt_notification_inactivity *inactivity = (void *) notif; @@ -93,11 +98,11 @@ int bt_notification_inactivity_set_default_clock_value( bt_clock_value_set_value_inline(inactivity->default_cv, value_cycles); BT_LIB_LOGV("Set inactivity notification's default clock value: " "%![notif-]+n, value=%" PRIu64, notif, value_cycles); - return 0; } -struct bt_clock_value *bt_notification_inactivity_borrow_default_clock_value( - struct bt_notification *notif) +const struct bt_clock_value * +bt_notification_inactivity_borrow_default_clock_value_const( + const struct bt_notification *notif) { struct bt_notification_inactivity *inactivity = (void *) notif;