action: Mark parameter of lttng_action_get_type as const
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 23 Sep 2020 18:34:59 +0000 (14:34 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 28 Oct 2020 20:48:28 +0000 (16:48 -0400)
Remove lttng_action_get_type_const as it is no longer needed.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I1525bc2c89eb37ab3e75d915c6ff50bd2a7f5d21

include/lttng/action/action-internal.h
include/lttng/action/action.h
src/bin/lttng-sessiond/action-executor.c
src/bin/lttng-sessiond/notification-thread-events.c
src/common/actions/action.c
src/common/actions/group.c
src/common/actions/rotate-session.c
src/common/actions/snapshot-session.c
src/common/actions/start-session.c
src/common/actions/stop-session.c

index 20faea69713e050db033beeaeccbef50aca6d913..9e43a34d026491726e064acc6bede25bf3e92b88 100644 (file)
@@ -61,10 +61,6 @@ LTTNG_HIDDEN
 ssize_t lttng_action_create_from_payload(struct lttng_payload_view *view,
                struct lttng_action **action);
 
-LTTNG_HIDDEN
-enum lttng_action_type lttng_action_get_type_const(
-               const struct lttng_action *action);
-
 LTTNG_HIDDEN
 bool lttng_action_is_equal(const struct lttng_action *a,
                const struct lttng_action *b);
index 1309f85bd9128c34baa566064f1849ba7bf41cd8..be7e397d0629e6f94091ac4a0eccaf1061366d2b 100644 (file)
@@ -38,7 +38,7 @@ enum lttng_action_status {
  * Returns the type of an action on success, LTTNG_ACTION_TYPE_UNKNOWN on error.
  */
 extern enum lttng_action_type lttng_action_get_type(
-               struct lttng_action *action);
+               const struct lttng_action *action);
 
 /*
  * Destroy (frees) an action object.
index 2e6e27a8ce3febcfd0db7cbb100369ff7d974ca4..fc7d03d70a9fa4a3701ec5cce53ff98422df0a76 100644 (file)
@@ -104,7 +104,7 @@ static const char *action_type_names[] = {
 
 static const char *get_action_name(const struct lttng_action *action)
 {
-       return action_type_names[lttng_action_get_type_const(action)];
+       return action_type_names[lttng_action_get_type(action)];
 }
 
 /* Check if this trigger allowed to interect with a given session. */
@@ -486,7 +486,7 @@ static int action_executor_generic_handler(struct action_executor *executor,
                        work_item->trigger,
                        work_item->id);
 
-       return action_executors[lttng_action_get_type_const(action)](
+       return action_executors[lttng_action_get_type(action)](
                        executor, work_item, action);
 }
 
index 95101178f2f08c7d40bd0ae242ddf79193e45095..e01a00538ba8d2f04c389086860ebfd933798e9f 100644 (file)
@@ -2058,7 +2058,7 @@ bool is_trigger_action_notify(const struct lttng_trigger *trigger)
        enum lttng_action_type action_type;
 
        assert(action);
-       action_type = lttng_action_get_type_const(action);
+       action_type = lttng_action_get_type(action);
        if (action_type == LTTNG_ACTION_TYPE_NOTIFY) {
                is_notify = true;
                goto end;
@@ -2074,7 +2074,7 @@ bool is_trigger_action_notify(const struct lttng_trigger *trigger)
                                lttng_action_group_get_at_index(
                                                action, i);
 
-               action_type = lttng_action_get_type_const(inner_action);
+               action_type = lttng_action_get_type(inner_action);
                if (action_type == LTTNG_ACTION_TYPE_NOTIFY) {
                        is_notify = true;
                        goto end;
index 11b3c5501dace3d515f5f4d3759a0e2acf61bc93..86628542bc50186c32b20a0bc026530a235672d6 100644 (file)
@@ -38,18 +38,11 @@ const char *lttng_action_type_string(enum lttng_action_type action_type)
        }
 }
 
-enum lttng_action_type lttng_action_get_type(struct lttng_action *action)
+enum lttng_action_type lttng_action_get_type(const struct lttng_action *action)
 {
        return action ? action->type : LTTNG_ACTION_TYPE_UNKNOWN;
 }
 
-LTTNG_HIDDEN
-enum lttng_action_type lttng_action_get_type_const(
-               const struct lttng_action *action)
-{
-       return action->type;
-}
-
 LTTNG_HIDDEN
 void lttng_action_init(
                struct lttng_action *action,
index f5720741598af8c1288c1a383e38f3bd7c9be6e0..31c6f456ebcdf2c11c3e0da702f5733befd13eac 100644 (file)
@@ -16,7 +16,7 @@
 #include <lttng/action/group.h>
 
 #define IS_GROUP_ACTION(action) \
-       (lttng_action_get_type_const(action) == LTTNG_ACTION_TYPE_GROUP)
+       (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_GROUP)
 
 struct lttng_action_group {
        struct lttng_action parent;
index 9255034da076e23ac2df409c0313929f66021691..a492876607a4e68c53cf640f82cc8f08cd3f16d8 100644 (file)
@@ -13,7 +13,7 @@
 #include <lttng/action/rotate-session.h>
 
 #define IS_ROTATE_SESSION_ACTION(action) \
-       (lttng_action_get_type_const(action) == LTTNG_ACTION_TYPE_ROTATE_SESSION)
+       (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_ROTATE_SESSION)
 
 struct lttng_action_rotate_session {
        struct lttng_action parent;
index 667166770d30839c2ee13c066e70e1deb09223fb..ccf54dc772eeff3c01049b2202ec6842373d6669 100644 (file)
@@ -19,7 +19,7 @@
 #include <inttypes.h>
 
 #define IS_SNAPSHOT_SESSION_ACTION(action) \
-       (lttng_action_get_type_const(action) == LTTNG_ACTION_TYPE_SNAPSHOT_SESSION)
+       (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_SNAPSHOT_SESSION)
 
 struct lttng_action_snapshot_session {
        struct lttng_action parent;
index eeb00a5daba23f7ed303b5dc916cde15575fed1d..f21aaaae97448f13d3b7c13f0c19b1d1bfeb92f3 100644 (file)
@@ -13,7 +13,7 @@
 #include <lttng/action/start-session.h>
 
 #define IS_START_SESSION_ACTION(action) \
-       (lttng_action_get_type_const(action) == LTTNG_ACTION_TYPE_START_SESSION)
+       (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_START_SESSION)
 
 struct lttng_action_start_session {
        struct lttng_action parent;
index 33077b6766d0773ca9ed0ddf87b6072e7bf1794c..5bd753f7c56b261c853d73b0bb3669f97a324af9 100644 (file)
@@ -13,7 +13,7 @@
 #include <lttng/action/stop-session.h>
 
 #define IS_STOP_SESSION_ACTION(action) \
-       (lttng_action_get_type_const(action) == LTTNG_ACTION_TYPE_STOP_SESSION)
+       (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_STOP_SESSION)
 
 struct lttng_action_stop_session {
        struct lttng_action parent;
This page took 0.03123 seconds and 4 git commands to generate.