common: rename filter bytecode types
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 6 Apr 2020 18:20:05 +0000 (14:20 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 9 Mar 2021 04:51:11 +0000 (23:51 -0500)
The filter bytecode is going to be used for implementing capture
expressions, so it's not going to be specific to filter.  This patch
renames the types related to bytecode to remove "filter" from their
names.

All the changes start in bytecode/bytecode.h, the changes in the other
files are only fallouts.

- `enum filter_op` is renamed `enum bytecode_op`.
- `FILTER_OP_*` enumerators are renamed `BYTECODE_OP_*`.
- The `filter_opcode_t` typedef is renamed `bytecode_opcode_t`.
- `struct lttng_filter_bytecode_alloc` is renamed `struct lttng_bytecode_alloc`.
- `struct lttng_filter_bytecode` is renamed `struct lttng_bytecode`.

Change-Id: Iefdc667f3fbf715f868926c90108c6a5580b6f25
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Depends-on: lttng-ust: I5a800fc92e588c2a6a0e26282b0ad5f31c044479

34 files changed:
include/lttng/event-rule/event-rule-internal.h
include/lttng/event-rule/syscall-internal.h
include/lttng/event-rule/tracepoint-internal.h
src/bin/lttng-sessiond/agent.c
src/bin/lttng-sessiond/agent.h
src/bin/lttng-sessiond/client.c
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/cmd.h
src/bin/lttng-sessiond/event.c
src/bin/lttng-sessiond/event.h
src/bin/lttng-sessiond/kernel.c
src/bin/lttng-sessiond/kernel.h
src/bin/lttng-sessiond/trace-kernel.c
src/bin/lttng-sessiond/trace-kernel.h
src/bin/lttng-sessiond/trace-ust.c
src/bin/lttng-sessiond/trace-ust.h
src/bin/lttng-sessiond/ust-app.c
src/bin/lttng-sessiond/ust-app.h
src/common/bytecode/bytecode.c
src/common/bytecode/bytecode.h
src/common/event-rule/event-rule.c
src/common/event-rule/kprobe.c
src/common/event-rule/syscall.c
src/common/event-rule/tracepoint.c
src/common/event-rule/uprobe.c
src/common/filter.c
src/common/filter.h
src/common/filter/filter-ast.h
src/common/filter/filter-visitor-generate-bytecode.c
src/common/kernel-ctl/kernel-ctl.c
src/common/kernel-ctl/kernel-ctl.h
src/common/runas.c
src/common/runas.h
src/common/sessiond-comm/sessiond-comm.h

index a8ad34fe897728731fd9bb4b0d468bbb90a4292e..dd2d7dd18636b1560c655bf2a08eb1a7ca4d3cf7 100644 (file)
@@ -46,7 +46,7 @@ typedef enum lttng_error_code (*event_rule_generate_filter_bytecode_cb)(
                const struct lttng_credentials *creds);
 typedef const char *(*event_rule_get_filter_cb)(
                const struct lttng_event_rule *event_rule);
-typedef const struct lttng_filter_bytecode *(
+typedef const struct lttng_bytecode *(
                *event_rule_get_filter_bytecode_cb)(
                const struct lttng_event_rule *event_rule);
 typedef enum lttng_event_rule_generate_exclusions_status (
@@ -126,7 +126,7 @@ const char *lttng_event_rule_get_filter(const struct lttng_event_rule *rule);
  * Caller DOES NOT own the returned object.
  */
 LTTNG_HIDDEN
-const struct lttng_filter_bytecode *lttng_event_rule_get_filter_bytecode(
+const struct lttng_bytecode *lttng_event_rule_get_filter_bytecode(
                const struct lttng_event_rule *rule);
 
 /*
index e99b69ae44ec78874f93c0a40756b92712a1bf51..b72274f5b15841c1955d6e5ca6e77b7d88800603 100644 (file)
@@ -21,7 +21,7 @@ struct lttng_event_rule_syscall {
        /* Internal use only. */
        struct {
                char *filter;
-               struct lttng_filter_bytecode *bytecode;
+               struct lttng_bytecode *bytecode;
        } internal_filter;
 };
 
index 039b0a6cf2adddda2a838aee9c6625f27ce03149..227fe6de92aa1f885e9cdf1160f2c577aabe0211 100644 (file)
@@ -39,7 +39,7 @@ struct lttng_event_rule_tracepoint {
        /* internal use only. */
        struct {
                char *filter;
-               struct lttng_filter_bytecode *bytecode;
+               struct lttng_bytecode *bytecode;
        } internal_filter;
 };
 
index 84728b7829cd5adbebed1ae0788dd74eb81f3b9a..283d5b0353e16d2832b9a37fce71b9c66ea12cd3 100644 (file)
@@ -1128,7 +1128,7 @@ error:
  */
 struct agent_event *agent_create_event(const char *name,
                enum lttng_loglevel_type loglevel_type, int loglevel_value,
-               struct lttng_filter_bytecode *filter, char *filter_expression)
+               struct lttng_bytecode *filter, char *filter_expression)
 {
        struct agent_event *event = NULL;
 
index e82f32627937c162b26464ac1024815750b7e0f3..c88af21c5a13e53536a248d87be6495905ff452f 100644 (file)
@@ -98,7 +98,7 @@ struct agent_event {
        struct lttng_ht_node_str node;
 
        /* Filter associated with the event. NULL if none. */
-       struct lttng_filter_bytecode *filter;
+       struct lttng_bytecode *filter;
        char *filter_expression;
        struct lttng_event_exclusion *exclusion;
 };
@@ -146,7 +146,7 @@ void agent_add(struct agent *agt, struct lttng_ht *ht);
 /* Agent event API. */
 struct agent_event *agent_create_event(const char *name,
                enum lttng_loglevel_type loglevel_type, int loglevel_value,
-               struct lttng_filter_bytecode *filter,
+               struct lttng_bytecode *filter,
                char *filter_expression);
 void agent_add_event(struct agent_event *event, struct agent *agt);
 
index 00b5ec7e4ab7bb4db6a67c0c32855d2e77236162..d752fb94efe9b02bbdaffb2f71c6a1463ac196e0 100644 (file)
@@ -1556,7 +1556,7 @@ error_add_context:
        {
                struct lttng_event *ev = NULL;
                struct lttng_event_exclusion *exclusion = NULL;
-               struct lttng_filter_bytecode *bytecode = NULL;
+               struct lttng_bytecode *bytecode = NULL;
                char *filter_expression = NULL;
 
                /* Handle exclusion events and receive it from the client. */
index 8d36e7192c8deb32a46ca471c5d58dafd5e19d63..2d94204d37393c549a154a8d81f6fe8fcbf1b243 100644 (file)
@@ -115,7 +115,7 @@ static int cmd_enable_event_internal(struct ltt_session *session,
                const struct lttng_domain *domain,
                char *channel_name, struct lttng_event *event,
                char *filter_expression,
-               struct lttng_filter_bytecode *filter,
+               struct lttng_bytecode *filter,
                struct lttng_event_exclusion *exclusion,
                int wpipe);
 
@@ -2083,7 +2083,7 @@ static int _cmd_enable_event(struct ltt_session *session,
                const struct lttng_domain *domain,
                char *channel_name, struct lttng_event *event,
                char *filter_expression,
-               struct lttng_filter_bytecode *filter,
+               struct lttng_bytecode *filter,
                struct lttng_event_exclusion *exclusion,
                int wpipe, bool internal_event)
 {
@@ -2166,7 +2166,7 @@ static int _cmd_enable_event(struct ltt_session *session,
                case LTTNG_EVENT_ALL:
                {
                        char *filter_expression_a = NULL;
-                       struct lttng_filter_bytecode *filter_a = NULL;
+                       struct lttng_bytecode *filter_a = NULL;
 
                        /*
                         * We need to duplicate filter_expression and filter,
@@ -2401,11 +2401,11 @@ static int _cmd_enable_event(struct ltt_session *session,
 
                {
                        char *filter_expression_copy = NULL;
-                       struct lttng_filter_bytecode *filter_copy = NULL;
+                       struct lttng_bytecode *filter_copy = NULL;
 
                        if (filter) {
                                const size_t filter_size = sizeof(
-                                               struct lttng_filter_bytecode)
+                                               struct lttng_bytecode)
                                                + filter->len;
 
                                filter_copy = zmalloc(filter_size);
@@ -2481,7 +2481,7 @@ int cmd_enable_event(struct ltt_session *session,
                const struct lttng_domain *domain,
                char *channel_name, struct lttng_event *event,
                char *filter_expression,
-               struct lttng_filter_bytecode *filter,
+               struct lttng_bytecode *filter,
                struct lttng_event_exclusion *exclusion,
                int wpipe)
 {
@@ -2498,7 +2498,7 @@ static int cmd_enable_event_internal(struct ltt_session *session,
                const struct lttng_domain *domain,
                char *channel_name, struct lttng_event *event,
                char *filter_expression,
-               struct lttng_filter_bytecode *filter,
+               struct lttng_bytecode *filter,
                struct lttng_event_exclusion *exclusion,
                int wpipe)
 {
index e434d50d6253c9d4d79324c73d178dffa90260fe..dcda2365dd0a134d3075c4f1a81af3bf25cdefec 100644 (file)
@@ -86,11 +86,11 @@ int cmd_add_context(struct ltt_session *session, enum lttng_domain_type domain,
                char *channel_name, const struct lttng_event_context *ctx, int kwpipe);
 int cmd_set_filter(struct ltt_session *session, enum lttng_domain_type domain,
                char *channel_name, struct lttng_event *event,
-               struct lttng_filter_bytecode *bytecode);
+               struct lttng_bytecode *bytecode);
 int cmd_enable_event(struct ltt_session *session, const struct lttng_domain *domain,
                char *channel_name, struct lttng_event *event,
                char *filter_expression,
-               struct lttng_filter_bytecode *filter,
+               struct lttng_bytecode *filter,
                struct lttng_event_exclusion *exclusion,
                int wpipe);
 
index c7768a547bf83e2d9e33450de1fe2362b2a5a0ec..125adb9a058bf4fdedac31a1daaeaa02733c26c5 100644 (file)
@@ -48,7 +48,7 @@ static void add_unique_ust_event(struct lttng_ht *ht,
        assert(event);
 
        key.name = event->attr.name;
-       key.filter = (struct lttng_filter_bytecode *) event->filter;
+       key.filter = (struct lttng_bytecode *) event->filter;
        key.loglevel_type = event->attr.loglevel_type;
        key.loglevel_value = event->attr.loglevel;
        key.exclusion = event->exclusion;
@@ -105,7 +105,7 @@ int event_kernel_disable_event(struct ltt_kernel_channel *kchan,
  */
 int event_kernel_enable_event(struct ltt_kernel_channel *kchan,
                struct lttng_event *event, char *filter_expression,
-               struct lttng_filter_bytecode *filter)
+               struct lttng_bytecode *filter)
 {
        int ret;
        struct ltt_kernel_event *kevent;
@@ -155,7 +155,7 @@ end:
 int event_ust_enable_tracepoint(struct ltt_ust_session *usess,
                struct ltt_ust_channel *uchan, struct lttng_event *event,
                char *filter_expression,
-               struct lttng_filter_bytecode *filter,
+               struct lttng_bytecode *filter,
                struct lttng_event_exclusion *exclusion,
                bool internal_event)
 {
@@ -393,7 +393,7 @@ static void agent_enable_all(struct agent *agt)
  */
 int event_agent_enable_all(struct ltt_ust_session *usess,
                struct agent *agt, struct lttng_event *event,
-               struct lttng_filter_bytecode *filter ,char *filter_expression)
+               struct lttng_bytecode *filter ,char *filter_expression)
 {
        int ret;
 
@@ -422,7 +422,7 @@ error:
  * contexts yet. Not an issue for now, since they are not generated by
  * the lttng-ctl library.
  */
-static int add_filter_app_ctx(struct lttng_filter_bytecode *bytecode,
+static int add_filter_app_ctx(struct lttng_bytecode *bytecode,
                const char *filter_expression, struct agent *agt)
 {
        int ret = LTTNG_OK;
@@ -481,7 +481,7 @@ end:
 
 static int agent_enable(struct agent *agt,
                struct lttng_event *event,
-               struct lttng_filter_bytecode *filter,
+               struct lttng_bytecode *filter,
                char *filter_expression)
 {
        int ret, created = 0;
@@ -551,7 +551,7 @@ end:
 int event_agent_enable(struct ltt_ust_session *usess,
                struct agent *agt,
                struct lttng_event *event,
-               struct lttng_filter_bytecode *filter,
+               struct lttng_bytecode *filter,
                char *filter_expression)
 {
        assert(usess);
@@ -581,8 +581,8 @@ int trigger_agent_enable(const struct lttng_trigger *trigger, struct agent *agt)
        const struct lttng_event_rule *rule;
        const char *filter_expression;
        char *filter_expression_copy = NULL;
-       const struct lttng_filter_bytecode *filter_bytecode;
-       struct lttng_filter_bytecode *filter_bytecode_copy = NULL;
+       const struct lttng_bytecode *filter_bytecode;
+       struct lttng_bytecode *filter_bytecode_copy = NULL;
        struct lttng_event *event = NULL;
        uid_t trigger_owner_uid = 0;
        const char *trigger_name;
@@ -631,7 +631,7 @@ int trigger_agent_enable(const struct lttng_trigger *trigger, struct agent *agt)
                filter_bytecode = lttng_event_rule_get_filter_bytecode(rule);
                if (filter_bytecode) {
                        filter_bytecode_copy =
-                                       lttng_filter_bytecode_copy(filter_bytecode);
+                                       lttng_bytecode_copy(filter_bytecode);
                        if (!filter_bytecode_copy) {
                                ret = LTTNG_ERR_NOMEM;
                                goto end;
index c7a849c0b3d46017d4660ed217a2fcd6e348eafb..8849ee7ccc8ec2bec202dc6ea32c4c74f5ae089a 100644 (file)
@@ -17,12 +17,12 @@ int event_kernel_disable_event(struct ltt_kernel_channel *kchan,
 
 int event_kernel_enable_event(struct ltt_kernel_channel *kchan,
                struct lttng_event *event, char *filter_expression,
-               struct lttng_filter_bytecode *filter);
+               struct lttng_bytecode *filter);
 
 int event_ust_enable_tracepoint(struct ltt_ust_session *usess,
                struct ltt_ust_channel *uchan, struct lttng_event *event,
                char *filter_expression,
-               struct lttng_filter_bytecode *filter,
+               struct lttng_bytecode *filter,
                struct lttng_event_exclusion *exclusion,
                bool internal_event);
 int event_ust_disable_tracepoint(struct ltt_ust_session *usess,
@@ -32,10 +32,10 @@ int event_ust_disable_all_tracepoints(struct ltt_ust_session *usess,
                struct ltt_ust_channel *uchan);
 
 int event_agent_enable(struct ltt_ust_session *usess, struct agent *agt,
-               struct lttng_event *event, struct lttng_filter_bytecode *filter,
+               struct lttng_event *event, struct lttng_bytecode *filter,
                char *filter_expression);
 int event_agent_enable_all(struct ltt_ust_session *usess, struct agent *agt,
-               struct lttng_event *event, struct lttng_filter_bytecode *filter,
+               struct lttng_event *event, struct lttng_bytecode *filter,
                char *filter_expression);
 
 int event_agent_disable(struct ltt_ust_session *usess, struct agent *agt,
index 2e920286cf60cf35cd5c23dff580f96090a49582..23e8eac2a9f82ee12ea57f879b9df4481a177af3 100644 (file)
@@ -568,7 +568,7 @@ end:
 int kernel_create_event(struct lttng_event *ev,
                struct ltt_kernel_channel *channel,
                char *filter_expression,
-               struct lttng_filter_bytecode *filter)
+               struct lttng_bytecode *filter)
 {
        int err, fd;
        enum lttng_error_code ret;
index db05cfb4473a0ed7fa7cc4aa6dfd206dc649d776..a2dd7f060394b782763082692b928a014ee4448d 100644 (file)
@@ -29,7 +29,7 @@ int kernel_create_session(struct ltt_session *session);
 int kernel_create_channel(struct ltt_kernel_session *session,
                struct lttng_channel *chan);
 int kernel_create_event(struct lttng_event *ev, struct ltt_kernel_channel *channel,
-               char *filter_expression, struct lttng_filter_bytecode *filter);
+               char *filter_expression, struct lttng_bytecode *filter);
 int kernel_disable_channel(struct ltt_kernel_channel *chan);
 int kernel_disable_event(struct ltt_kernel_event *event);
 int kernel_enable_event(struct ltt_kernel_event *event);
index 7dde1b51d0cef1862f36b1fc4d3afb6e6bce9144..2623b2971a5273a0e84dd0a711243c99268e2a80 100644 (file)
@@ -71,7 +71,7 @@ struct ltt_kernel_channel *trace_kernel_get_channel_by_name(
 struct ltt_kernel_event *trace_kernel_find_event(
                char *name, struct ltt_kernel_channel *channel,
                enum lttng_event_type type,
-               struct lttng_filter_bytecode *filter)
+               struct lttng_bytecode *filter)
 {
        struct ltt_kernel_event *ev;
        int found = 0;
@@ -330,7 +330,7 @@ error:
  */
 enum lttng_error_code trace_kernel_create_event(
                struct lttng_event *ev, char *filter_expression,
-               struct lttng_filter_bytecode *filter,
+               struct lttng_bytecode *filter,
                struct ltt_kernel_event **kernel_event)
 {
        enum lttng_error_code ret;
index 4b564ee4d44525207ff9d5f3fde77363a5f6dcb8..89a4ab19f03364222dfd4f356b7db109ca372746 100644 (file)
@@ -48,7 +48,7 @@ struct ltt_kernel_event {
        struct lttng_kernel_event *event;
        struct cds_list_head list;
        char *filter_expression;
-       struct lttng_filter_bytecode *filter;
+       struct lttng_bytecode *filter;
        struct lttng_userspace_probe_location *userspace_probe_location;
 };
 
@@ -59,7 +59,7 @@ struct ltt_kernel_event_notifier_rule {
        enum lttng_event_type type;
        struct lttng_trigger *trigger;
        uint64_t token;
-       const struct lttng_filter_bytecode *filter;
+       const struct lttng_bytecode *filter;
        struct lttng_userspace_probe_location *userspace_probe_location;
        struct cds_lfht_node ht_node;
        /* call_rcu delayed reclaim. */
@@ -146,7 +146,7 @@ struct ltt_kernel_event *trace_kernel_get_event_by_name(
 struct ltt_kernel_event *trace_kernel_find_event(
                char *name, struct ltt_kernel_channel *channel,
                enum lttng_event_type type,
-               struct lttng_filter_bytecode *filter);
+               struct lttng_bytecode *filter);
 struct ltt_kernel_channel *trace_kernel_get_channel_by_name(
                const char *name, struct ltt_kernel_session *session);
 
@@ -157,7 +157,7 @@ struct ltt_kernel_session *trace_kernel_create_session(void);
 struct ltt_kernel_channel *trace_kernel_create_channel(
                struct lttng_channel *chan);
 enum lttng_error_code trace_kernel_create_event(struct lttng_event *ev,
-               char *filter_expression, struct lttng_filter_bytecode *filter,
+               char *filter_expression, struct lttng_bytecode *filter,
                struct ltt_kernel_event **kernel_event);
 struct ltt_kernel_metadata *trace_kernel_create_metadata(void);
 struct ltt_kernel_stream *trace_kernel_create_stream(const char *name,
index 7ee379ef898a0890becd9b90e413d10687719a0f..527b354f1a5e5c287e17733202d57670e78ce687 100644 (file)
@@ -194,7 +194,7 @@ error:
  * MUST be acquired before calling this.
  */
 struct ltt_ust_event *trace_ust_find_event(struct lttng_ht *ht,
-               char *name, struct lttng_filter_bytecode *filter,
+               char *name, struct lttng_bytecode *filter,
                enum lttng_ust_loglevel_type loglevel_type, int loglevel_value,
                struct lttng_event_exclusion *exclusion)
 {
@@ -446,7 +446,7 @@ end:
  */
 enum lttng_error_code trace_ust_create_event(struct lttng_event *ev,
                char *filter_expression,
-               struct lttng_filter_bytecode *filter,
+               struct lttng_bytecode *filter,
                struct lttng_event_exclusion *exclusion,
                bool internal_event,
                struct ltt_ust_event **ust_event)
index ecd0b877166abf22e7453a62c1b3c243016d9e18..53e1ab2b5b2a98836ff520e7bf025426c909f74b 100644 (file)
@@ -24,7 +24,7 @@ struct agent;
 
 struct ltt_ust_ht_key {
        const char *name;
-       const struct lttng_filter_bytecode *filter;
+       const struct lttng_bytecode *filter;
        enum lttng_ust_loglevel_type loglevel_type;
        int loglevel_value;
        const struct lttng_event_exclusion *exclusion;
@@ -43,7 +43,7 @@ struct ltt_ust_event {
        struct lttng_ust_event attr;
        struct lttng_ht_node_str node;
        char *filter_expression;
-       struct lttng_filter_bytecode *filter;
+       struct lttng_bytecode *filter;
        struct lttng_event_exclusion *exclusion;
        /*
         * An internal event is an event which was created by the session daemon
@@ -182,7 +182,7 @@ int trace_ust_ht_match_event_by_name(struct cds_lfht_node *node,
  * Lookup functions. NULL is returned if not found.
  */
 struct ltt_ust_event *trace_ust_find_event(struct lttng_ht *ht,
-               char *name, struct lttng_filter_bytecode *filter,
+               char *name, struct lttng_bytecode *filter,
                enum lttng_ust_loglevel_type loglevel_type, int loglevel_value,
                struct lttng_event_exclusion *exclusion);
 struct ltt_ust_channel *trace_ust_find_channel_by_name(struct lttng_ht *ht,
@@ -198,7 +198,7 @@ struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *attr,
                enum lttng_domain_type domain);
 enum lttng_error_code trace_ust_create_event(struct lttng_event *ev,
                char *filter_expression,
-               struct lttng_filter_bytecode *filter,
+               struct lttng_bytecode *filter,
                struct lttng_event_exclusion *exclusion,
                bool internal_event, struct ltt_ust_event **ust_event);
 struct ltt_ust_context *trace_ust_create_context(
@@ -270,7 +270,7 @@ struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *attr,
 static inline
 enum lttng_error_code trace_ust_create_event(struct lttng_event *ev,
                const char *filter_expression,
-               struct lttng_filter_bytecode *filter,
+               struct lttng_bytecode *filter,
                struct lttng_event_exclusion *exclusion,
                bool internal_event, struct ltt_ust_event **ust_event)
 {
@@ -310,7 +310,7 @@ int trace_ust_match_context(const struct ltt_ust_context *uctx,
 }
 static inline
 struct ltt_ust_event *trace_ust_find_event(struct lttng_ht *ht,
-               char *name, struct lttng_filter_bytecode *filter,
+               char *name, struct lttng_bytecode *filter,
                enum lttng_ust_loglevel_type loglevel_type, int loglevel_value,
                struct lttng_event_exclusion *exclusion)
 {
index 5ba14748d9014b07cd5ec1aabba2dedae87940b4..9321d278984186cce37591e0c5de99347bdf4073 100644 (file)
@@ -1324,7 +1324,7 @@ error:
  * Return allocated filter or NULL on error.
  */
 static struct lttng_ust_filter_bytecode *create_ust_bytecode_from_bytecode(
-               const struct lttng_filter_bytecode *orig_f)
+               const struct lttng_bytecode *orig_f)
 {
        struct lttng_ust_filter_bytecode *filter = NULL;
 
@@ -1335,7 +1335,7 @@ static struct lttng_ust_filter_bytecode *create_ust_bytecode_from_bytecode(
                goto error;
        }
 
-       assert(sizeof(struct lttng_filter_bytecode) ==
+       assert(sizeof(struct lttng_bytecode) ==
                        sizeof(struct lttng_ust_filter_bytecode));
        memcpy(filter, orig_f, sizeof(*filter) + orig_f->len);
 error:
@@ -1394,7 +1394,7 @@ error:
  * Return an ust_app_event object or NULL on error.
  */
 static struct ust_app_event *find_ust_app_event(struct lttng_ht *ht,
-               const char *name, const struct lttng_filter_bytecode *filter,
+               const char *name, const struct lttng_bytecode *filter,
                int loglevel_value,
                const struct lttng_event_exclusion *exclusion)
 {
@@ -1503,7 +1503,7 @@ error:
  * Set the filter on the tracer.
  */
 static int set_ust_object_filter(struct ust_app *app,
-               const struct lttng_filter_bytecode *bytecode,
+               const struct lttng_bytecode *bytecode,
                struct lttng_ust_object_data *ust_object)
 {
        int ret;
@@ -2112,7 +2112,7 @@ static void shadow_copy_event(struct ust_app_event *ua_event,
 
        /* Copy filter bytecode */
        if (uevent->filter) {
-               ua_event->filter = lttng_filter_bytecode_copy(uevent->filter);
+               ua_event->filter = lttng_bytecode_copy(uevent->filter);
                /* Filter might be NULL here in case of ENONEM. */
        }
 
index 65ed6a2551eb96c63db64c900032a8faed233da3..d10c1e32f181130d2ff9cc5e6d91d6bebc32eacb 100644 (file)
@@ -22,7 +22,7 @@
 /* Process name (short). */
 #define UST_APP_PROCNAME_LEN   16
 
-struct lttng_filter_bytecode;
+struct lttng_bytecode;
 struct lttng_ust_filter_bytecode;
 
 extern int ust_consumerd64_fd, ust_consumerd32_fd;
@@ -39,7 +39,7 @@ struct ust_app_notify_sock_obj {
 
 struct ust_app_ht_key {
        const char *name;
-       const struct lttng_filter_bytecode *filter;
+       const struct lttng_bytecode *filter;
        enum lttng_ust_loglevel_type loglevel_type;
        const struct lttng_event_exclusion *exclusion;
 };
@@ -108,7 +108,7 @@ struct ust_app_event {
        struct lttng_ust_event attr;
        char name[LTTNG_UST_SYM_NAME_LEN];
        struct lttng_ht_node_str node;
-       struct lttng_filter_bytecode *filter;
+       struct lttng_bytecode *filter;
        struct lttng_event_exclusion *exclusion;
 };
 
@@ -122,7 +122,7 @@ struct ust_app_event_notifier_rule {
        uint64_t token;
        struct lttng_ht_node_u64 node;
        /* The event_rule object owns the filter. */
-       const struct lttng_filter_bytecode *filter;
+       const struct lttng_bytecode *filter;
        /* Owned by this. */
        struct lttng_event_exclusion *exclusion;
        /* For delayed reclaim. */
index e85dd66c14eb90a6584c882d9401bd70ccba0822..4f8c325b5da6a6734be6255f64ea07f4ef221f40 100644 (file)
@@ -24,11 +24,11 @@ static inline int get_count_order(unsigned int count)
 }
 
 LTTNG_HIDDEN
-int bytecode_init(struct lttng_filter_bytecode_alloc **fb)
+int bytecode_init(struct lttng_bytecode_alloc **fb)
 {
        uint32_t alloc_len;
 
-       alloc_len = sizeof(struct lttng_filter_bytecode_alloc) + INIT_ALLOC_SIZE;
+       alloc_len = sizeof(struct lttng_bytecode_alloc) + INIT_ALLOC_SIZE;
        *fb = calloc(alloc_len, 1);
        if (!*fb) {
                return -ENOMEM;
@@ -39,19 +39,19 @@ int bytecode_init(struct lttng_filter_bytecode_alloc **fb)
 }
 
 LTTNG_HIDDEN
-int32_t bytecode_reserve(struct lttng_filter_bytecode_alloc **fb, uint32_t align, uint32_t len)
+int32_t bytecode_reserve(struct lttng_bytecode_alloc **fb, uint32_t align, uint32_t len)
 {
        int32_t ret;
        uint32_t padding = offset_align((*fb)->b.len, align);
        uint32_t new_len = (*fb)->b.len + padding + len;
-       uint32_t new_alloc_len = sizeof(struct lttng_filter_bytecode_alloc) + new_len;
+       uint32_t new_alloc_len = sizeof(struct lttng_bytecode_alloc) + new_len;
        uint32_t old_alloc_len = (*fb)->alloc_len;
 
        if (new_len > LTTNG_FILTER_MAX_LEN)
                return -EINVAL;
 
        if (new_alloc_len > old_alloc_len) {
-               struct lttng_filter_bytecode_alloc *newptr;
+               struct lttng_bytecode_alloc *newptr;
 
                new_alloc_len =
                        max_t(uint32_t, 1U << get_count_order(new_alloc_len), old_alloc_len << 1);
@@ -70,7 +70,7 @@ int32_t bytecode_reserve(struct lttng_filter_bytecode_alloc **fb, uint32_t align
 }
 
 LTTNG_HIDDEN
-int bytecode_push(struct lttng_filter_bytecode_alloc **fb, const void *data,
+int bytecode_push(struct lttng_bytecode_alloc **fb, const void *data,
                uint32_t align, uint32_t len)
 {
        int32_t offset;
@@ -83,7 +83,7 @@ int bytecode_push(struct lttng_filter_bytecode_alloc **fb, const void *data,
 }
 
 LTTNG_HIDDEN
-int bytecode_push_logical(struct lttng_filter_bytecode_alloc **fb,
+int bytecode_push_logical(struct lttng_bytecode_alloc **fb,
                struct logical_op *data,
                uint32_t align, uint32_t len,
                uint16_t *skip_offset)
@@ -106,10 +106,10 @@ int bytecode_push_logical(struct lttng_filter_bytecode_alloc **fb,
  * Return allocated bytecode or NULL on error.
  */
 LTTNG_HIDDEN
-struct lttng_filter_bytecode *lttng_filter_bytecode_copy(
-               const struct lttng_filter_bytecode *orig_f)
+struct lttng_bytecode *lttng_bytecode_copy(
+               const struct lttng_bytecode *orig_f)
 {
-       struct lttng_filter_bytecode *bytecode = NULL;
+       struct lttng_bytecode *bytecode = NULL;
 
        bytecode = zmalloc(sizeof(*bytecode) + orig_f->len);
        if (!bytecode) {
index 3a639c939b45fc12b8cddb5babe2f7d8009273e0..151ca8a0fb00d0d0273d5304b415984b9f84759f 100644 (file)
@@ -47,202 +47,206 @@ struct literal_string {
        char string[0];
 } LTTNG_PACKED;
 
-enum filter_op {
-       FILTER_OP_UNKNOWN                       = 0,
+enum bytecode_op {
+       BYTECODE_OP_UNKNOWN                             = 0,
 
-       FILTER_OP_RETURN                        = 1,
+       BYTECODE_OP_RETURN                              = 1,
 
        /* binary */
-       FILTER_OP_MUL                           = 2,
-       FILTER_OP_DIV                           = 3,
-       FILTER_OP_MOD                           = 4,
-       FILTER_OP_PLUS                          = 5,
-       FILTER_OP_MINUS                         = 6,
-       FILTER_OP_BIT_RSHIFT                    = 7,
-       FILTER_OP_BIT_LSHIFT                    = 8,
-       FILTER_OP_BIT_AND                       = 9,
-       FILTER_OP_BIT_OR                        = 10,
-       FILTER_OP_BIT_XOR                       = 11,
+       BYTECODE_OP_MUL                                 = 2,
+       BYTECODE_OP_DIV                                 = 3,
+       BYTECODE_OP_MOD                                 = 4,
+       BYTECODE_OP_PLUS                                = 5,
+       BYTECODE_OP_MINUS                               = 6,
+       BYTECODE_OP_BIT_RSHIFT                          = 7,
+       BYTECODE_OP_BIT_LSHIFT                          = 8,
+       BYTECODE_OP_BIT_AND                             = 9,
+       BYTECODE_OP_BIT_OR                              = 10,
+       BYTECODE_OP_BIT_XOR                             = 11,
 
        /* binary comparators */
-       FILTER_OP_EQ                            = 12,
-       FILTER_OP_NE                            = 13,
-       FILTER_OP_GT                            = 14,
-       FILTER_OP_LT                            = 15,
-       FILTER_OP_GE                            = 16,
-       FILTER_OP_LE                            = 17,
+       BYTECODE_OP_EQ                                  = 12,
+       BYTECODE_OP_NE                                  = 13,
+       BYTECODE_OP_GT                                  = 14,
+       BYTECODE_OP_LT                                  = 15,
+       BYTECODE_OP_GE                                  = 16,
+       BYTECODE_OP_LE                                  = 17,
 
        /* string binary comparator: apply to  */
-       FILTER_OP_EQ_STRING                     = 18,
-       FILTER_OP_NE_STRING                     = 19,
-       FILTER_OP_GT_STRING                     = 20,
-       FILTER_OP_LT_STRING                     = 21,
-       FILTER_OP_GE_STRING                     = 22,
-       FILTER_OP_LE_STRING                     = 23,
+       BYTECODE_OP_EQ_STRING                           = 18,
+       BYTECODE_OP_NE_STRING                           = 19,
+       BYTECODE_OP_GT_STRING                           = 20,
+       BYTECODE_OP_LT_STRING                           = 21,
+       BYTECODE_OP_GE_STRING                           = 22,
+       BYTECODE_OP_LE_STRING                           = 23,
 
        /* s64 binary comparator */
-       FILTER_OP_EQ_S64                        = 24,
-       FILTER_OP_NE_S64                        = 25,
-       FILTER_OP_GT_S64                        = 26,
-       FILTER_OP_LT_S64                        = 27,
-       FILTER_OP_GE_S64                        = 28,
-       FILTER_OP_LE_S64                        = 29,
+       BYTECODE_OP_EQ_S64                              = 24,
+       BYTECODE_OP_NE_S64                              = 25,
+       BYTECODE_OP_GT_S64                              = 26,
+       BYTECODE_OP_LT_S64                              = 27,
+       BYTECODE_OP_GE_S64                              = 28,
+       BYTECODE_OP_LE_S64                              = 29,
 
        /* double binary comparator */
-       FILTER_OP_EQ_DOUBLE                     = 30,
-       FILTER_OP_NE_DOUBLE                     = 31,
-       FILTER_OP_GT_DOUBLE                     = 32,
-       FILTER_OP_LT_DOUBLE                     = 33,
-       FILTER_OP_GE_DOUBLE                     = 34,
-       FILTER_OP_LE_DOUBLE                     = 35,
+       BYTECODE_OP_EQ_DOUBLE                           = 30,
+       BYTECODE_OP_NE_DOUBLE                           = 31,
+       BYTECODE_OP_GT_DOUBLE                           = 32,
+       BYTECODE_OP_LT_DOUBLE                           = 33,
+       BYTECODE_OP_GE_DOUBLE                           = 34,
+       BYTECODE_OP_LE_DOUBLE                           = 35,
 
        /* Mixed S64-double binary comparators */
-       FILTER_OP_EQ_DOUBLE_S64                 = 36,
-       FILTER_OP_NE_DOUBLE_S64                 = 37,
-       FILTER_OP_GT_DOUBLE_S64                 = 38,
-       FILTER_OP_LT_DOUBLE_S64                 = 39,
-       FILTER_OP_GE_DOUBLE_S64                 = 40,
-       FILTER_OP_LE_DOUBLE_S64                 = 41,
-
-       FILTER_OP_EQ_S64_DOUBLE                 = 42,
-       FILTER_OP_NE_S64_DOUBLE                 = 43,
-       FILTER_OP_GT_S64_DOUBLE                 = 44,
-       FILTER_OP_LT_S64_DOUBLE                 = 45,
-       FILTER_OP_GE_S64_DOUBLE                 = 46,
-       FILTER_OP_LE_S64_DOUBLE                 = 47,
+       BYTECODE_OP_EQ_DOUBLE_S64                       = 36,
+       BYTECODE_OP_NE_DOUBLE_S64                       = 37,
+       BYTECODE_OP_GT_DOUBLE_S64                       = 38,
+       BYTECODE_OP_LT_DOUBLE_S64                       = 39,
+       BYTECODE_OP_GE_DOUBLE_S64                       = 40,
+       BYTECODE_OP_LE_DOUBLE_S64                       = 41,
+
+       BYTECODE_OP_EQ_S64_DOUBLE                       = 42,
+       BYTECODE_OP_NE_S64_DOUBLE                       = 43,
+       BYTECODE_OP_GT_S64_DOUBLE                       = 44,
+       BYTECODE_OP_LT_S64_DOUBLE                       = 45,
+       BYTECODE_OP_GE_S64_DOUBLE                       = 46,
+       BYTECODE_OP_LE_S64_DOUBLE                       = 47,
 
        /* unary */
-       FILTER_OP_UNARY_PLUS                    = 48,
-       FILTER_OP_UNARY_MINUS                   = 49,
-       FILTER_OP_UNARY_NOT                     = 50,
-       FILTER_OP_UNARY_PLUS_S64                = 51,
-       FILTER_OP_UNARY_MINUS_S64               = 52,
-       FILTER_OP_UNARY_NOT_S64                 = 53,
-       FILTER_OP_UNARY_PLUS_DOUBLE             = 54,
-       FILTER_OP_UNARY_MINUS_DOUBLE            = 55,
-       FILTER_OP_UNARY_NOT_DOUBLE              = 56,
+       BYTECODE_OP_UNARY_PLUS                          = 48,
+       BYTECODE_OP_UNARY_MINUS                         = 49,
+       BYTECODE_OP_UNARY_NOT                           = 50,
+       BYTECODE_OP_UNARY_PLUS_S64                      = 51,
+       BYTECODE_OP_UNARY_MINUS_S64                     = 52,
+       BYTECODE_OP_UNARY_NOT_S64                       = 53,
+       BYTECODE_OP_UNARY_PLUS_DOUBLE                   = 54,
+       BYTECODE_OP_UNARY_MINUS_DOUBLE                  = 55,
+       BYTECODE_OP_UNARY_NOT_DOUBLE                    = 56,
 
        /* logical */
-       FILTER_OP_AND                           = 57,
-       FILTER_OP_OR                            = 58,
+       BYTECODE_OP_AND                                 = 57,
+       BYTECODE_OP_OR                                  = 58,
 
        /* load field ref */
-       FILTER_OP_LOAD_FIELD_REF                = 59,
-       FILTER_OP_LOAD_FIELD_REF_STRING         = 60,
-       FILTER_OP_LOAD_FIELD_REF_SEQUENCE       = 61,
-       FILTER_OP_LOAD_FIELD_REF_S64            = 62,
-       FILTER_OP_LOAD_FIELD_REF_DOUBLE         = 63,
+       BYTECODE_OP_LOAD_FIELD_REF                      = 59,
+       BYTECODE_OP_LOAD_FIELD_REF_STRING               = 60,
+       BYTECODE_OP_LOAD_FIELD_REF_SEQUENCE             = 61,
+       BYTECODE_OP_LOAD_FIELD_REF_S64                  = 62,
+       BYTECODE_OP_LOAD_FIELD_REF_DOUBLE               = 63,
 
        /* load immediate from operand */
-       FILTER_OP_LOAD_STRING                   = 64,
-       FILTER_OP_LOAD_S64                      = 65,
-       FILTER_OP_LOAD_DOUBLE                   = 66,
+       BYTECODE_OP_LOAD_STRING                         = 64,
+       BYTECODE_OP_LOAD_S64                            = 65,
+       BYTECODE_OP_LOAD_DOUBLE                         = 66,
 
        /* cast */
-       FILTER_OP_CAST_TO_S64                   = 67,
-       FILTER_OP_CAST_DOUBLE_TO_S64            = 68,
-       FILTER_OP_CAST_NOP                      = 69,
+       BYTECODE_OP_CAST_TO_S64                         = 67,
+       BYTECODE_OP_CAST_DOUBLE_TO_S64                  = 68,
+       BYTECODE_OP_CAST_NOP                            = 69,
 
        /* get context ref */
-       FILTER_OP_GET_CONTEXT_REF               = 70,
-       FILTER_OP_GET_CONTEXT_REF_STRING        = 71,
-       FILTER_OP_GET_CONTEXT_REF_S64           = 72,
-       FILTER_OP_GET_CONTEXT_REF_DOUBLE        = 73,
+       BYTECODE_OP_GET_CONTEXT_REF                     = 70,
+       BYTECODE_OP_GET_CONTEXT_REF_STRING              = 71,
+       BYTECODE_OP_GET_CONTEXT_REF_S64                 = 72,
+       BYTECODE_OP_GET_CONTEXT_REF_DOUBLE              = 73,
 
        /* load userspace field ref */
-       FILTER_OP_LOAD_FIELD_REF_USER_STRING    = 74,
-       FILTER_OP_LOAD_FIELD_REF_USER_SEQUENCE  = 75,
+       BYTECODE_OP_LOAD_FIELD_REF_USER_STRING          = 74,
+       BYTECODE_OP_LOAD_FIELD_REF_USER_SEQUENCE        = 75,
 
        /*
         * load immediate star globbing pattern (literal string)
         * from immediate
         */
-       FILTER_OP_LOAD_STAR_GLOB_STRING         = 76,
+       BYTECODE_OP_LOAD_STAR_GLOB_STRING               = 76,
 
        /* globbing pattern binary operator: apply to */
-       FILTER_OP_EQ_STAR_GLOB_STRING           = 77,
-       FILTER_OP_NE_STAR_GLOB_STRING           = 78,
+       BYTECODE_OP_EQ_STAR_GLOB_STRING                 = 77,
+       BYTECODE_OP_NE_STAR_GLOB_STRING                 = 78,
 
        /*
         * Instructions for recursive traversal through composed types.
         */
-       FILTER_OP_GET_CONTEXT_ROOT              = 79,
-       FILTER_OP_GET_APP_CONTEXT_ROOT          = 80,
-       FILTER_OP_GET_PAYLOAD_ROOT              = 81,
-
-       FILTER_OP_GET_SYMBOL                    = 82,
-       FILTER_OP_GET_SYMBOL_FIELD              = 83,
-       FILTER_OP_GET_INDEX_U16                 = 84,
-       FILTER_OP_GET_INDEX_U64                 = 85,
-
-       FILTER_OP_LOAD_FIELD                    = 86,
-       FILTER_OP_LOAD_FIELD_S8                 = 87,
-       FILTER_OP_LOAD_FIELD_S16                = 88,
-       FILTER_OP_LOAD_FIELD_S32                = 89,
-       FILTER_OP_LOAD_FIELD_S64                = 90,
-       FILTER_OP_LOAD_FIELD_U8                 = 91,
-       FILTER_OP_LOAD_FIELD_U16                = 92,
-       FILTER_OP_LOAD_FIELD_U32                = 93,
-       FILTER_OP_LOAD_FIELD_U64                = 94,
-       FILTER_OP_LOAD_FIELD_STRING             = 95,
-       FILTER_OP_LOAD_FIELD_SEQUENCE           = 96,
-       FILTER_OP_LOAD_FIELD_DOUBLE             = 97,
-
-       FILTER_OP_UNARY_BIT_NOT                 = 98,
-
-       FILTER_OP_RETURN_S64                    = 99,
-
-       NR_FILTER_OPS,
+       BYTECODE_OP_GET_CONTEXT_ROOT                    = 79,
+       BYTECODE_OP_GET_APP_CONTEXT_ROOT                = 80,
+       BYTECODE_OP_GET_PAYLOAD_ROOT                    = 81,
+
+       BYTECODE_OP_GET_SYMBOL                          = 82,
+       BYTECODE_OP_GET_SYMBOL_FIELD                    = 83,
+       BYTECODE_OP_GET_INDEX_U16                       = 84,
+       BYTECODE_OP_GET_INDEX_U64                       = 85,
+
+       BYTECODE_OP_LOAD_FIELD                          = 86,
+       BYTECODE_OP_LOAD_FIELD_S8                       = 87,
+       BYTECODE_OP_LOAD_FIELD_S16                      = 88,
+       BYTECODE_OP_LOAD_FIELD_S32                      = 89,
+       BYTECODE_OP_LOAD_FIELD_S64                      = 90,
+       BYTECODE_OP_LOAD_FIELD_U8                       = 91,
+       BYTECODE_OP_LOAD_FIELD_U16                      = 92,
+       BYTECODE_OP_LOAD_FIELD_U32                      = 93,
+       BYTECODE_OP_LOAD_FIELD_U64                      = 94,
+       BYTECODE_OP_LOAD_FIELD_STRING                   = 95,
+       BYTECODE_OP_LOAD_FIELD_SEQUENCE                 = 96,
+       BYTECODE_OP_LOAD_FIELD_DOUBLE                   = 97,
+
+       BYTECODE_OP_UNARY_BIT_NOT                       = 98,
+
+       BYTECODE_OP_RETURN_S64                          = 99,
+
+       NR_BYTECODE_OPS,
 };
 
-typedef uint8_t filter_opcode_t;
+typedef uint8_t bytecode_opcode_t;
 
 struct load_op {
-       filter_opcode_t op;
+       bytecode_opcode_t op;
+
+       /*
+        * data to load. Size known by enum bytecode_opcode_t and null-term
+        * char.
+        */
        char data[0];
-       /* data to load. Size known by enum filter_opcode and null-term char. */
 } LTTNG_PACKED;
 
 struct binary_op {
-       filter_opcode_t op;
+       bytecode_opcode_t op;
 } LTTNG_PACKED;
 
 struct unary_op {
-       filter_opcode_t op;
+       bytecode_opcode_t op;
 } LTTNG_PACKED;
 
 /* skip_offset is absolute from start of bytecode */
 struct logical_op {
-       filter_opcode_t op;
+       bytecode_opcode_t op;
        uint16_t skip_offset;   /* bytecode insn, if skip second test */
 } LTTNG_PACKED;
 
 struct cast_op {
-       filter_opcode_t op;
+       bytecode_opcode_t op;
 } LTTNG_PACKED;
 
 struct return_op {
-       filter_opcode_t op;
+       bytecode_opcode_t op;
 } LTTNG_PACKED;
 
-struct lttng_filter_bytecode_alloc {
+struct lttng_bytecode_alloc {
        uint32_t alloc_len;
-       struct lttng_filter_bytecode b;
+       struct lttng_bytecode b;
 };
 
-LTTNG_HIDDEN int bytecode_init(struct lttng_filter_bytecode_alloc **fb);
-LTTNG_HIDDEN int32_t bytecode_reserve(struct lttng_filter_bytecode_alloc **fb,
+LTTNG_HIDDEN int bytecode_init(struct lttng_bytecode_alloc **fb);
+LTTNG_HIDDEN int32_t bytecode_reserve(struct lttng_bytecode_alloc **fb,
                uint32_t align, uint32_t len);
-LTTNG_HIDDEN int bytecode_push(struct lttng_filter_bytecode_alloc **fb,
+LTTNG_HIDDEN int bytecode_push(struct lttng_bytecode_alloc **fb,
                const void *data, uint32_t align, uint32_t len);
-LTTNG_HIDDEN int bytecode_push_logical(struct lttng_filter_bytecode_alloc **fb,
+LTTNG_HIDDEN int bytecode_push_logical(struct lttng_bytecode_alloc **fb,
                struct logical_op *data, uint32_t align, uint32_t len,
                uint16_t *skip_offset);
-LTTNG_HIDDEN struct lttng_filter_bytecode *lttng_filter_bytecode_copy(
-               const struct lttng_filter_bytecode *orig_f);
+LTTNG_HIDDEN struct lttng_bytecode *lttng_bytecode_copy(
+               const struct lttng_bytecode *orig_f);
 
 static inline
-unsigned int bytecode_get_len(struct lttng_filter_bytecode *bytecode)
+unsigned int bytecode_get_len(struct lttng_bytecode *bytecode)
 {
        return bytecode->len;
 }
index 98ff37411b90f45b6be1810da4af802c00cf8986..3a5be731b3fffe7c48d1613c538dd996c63dc930 100644 (file)
@@ -259,7 +259,7 @@ const char *lttng_event_rule_get_filter(const struct lttng_event_rule *rule)
 }
 
 LTTNG_HIDDEN
-const struct lttng_filter_bytecode *lttng_event_rule_get_filter_bytecode(
+const struct lttng_bytecode *lttng_event_rule_get_filter_bytecode(
                const struct lttng_event_rule *rule)
 {
        assert(rule->get_filter_bytecode);
index 01699caf1ade9407948e8024889095954d3948c9..12e6010ac1f25723caa73b72e74cf5d0f27df32f 100644 (file)
@@ -163,7 +163,7 @@ static const char *lttng_event_rule_kprobe_get_filter(
        return NULL;
 }
 
-static const struct lttng_filter_bytecode *
+static const struct lttng_bytecode *
 lttng_event_rule_kprobe_get_filter_bytecode(const struct lttng_event_rule *rule)
 {
        /* Not supported. */
index 98c272d40c8ece449793c6a9e7d60beeea90bbcf..b1b556aba3aa6bf5b7dcc45b65d0e408a2a7f832 100644 (file)
@@ -148,7 +148,7 @@ static enum lttng_error_code lttng_event_rule_syscall_generate_filter_bytecode(
        struct lttng_event_rule_syscall *syscall;
        enum lttng_event_rule_status status;
        const char *filter;
-       struct lttng_filter_bytecode *bytecode = NULL;
+       struct lttng_bytecode *bytecode = NULL;
 
        assert(rule);
 
@@ -205,7 +205,7 @@ static const char *lttng_event_rule_syscall_get_internal_filter(
        return syscall->internal_filter.filter;
 }
 
-static const struct lttng_filter_bytecode *
+static const struct lttng_bytecode *
 lttng_event_rule_syscall_get_internal_filter_bytecode(
                const struct lttng_event_rule *rule)
 {
index d6f3b9fb7b0b871b2c505cdf578daa60ebaff1aa..c8111a3725b5f236da76dab52117b3646a2cee71 100644 (file)
@@ -370,7 +370,7 @@ lttng_event_rule_tracepoint_generate_filter_bytecode(
        enum lttng_domain_type domain_type;
        enum lttng_event_rule_status status;
        const char *filter;
-       struct lttng_filter_bytecode *bytecode = NULL;
+       struct lttng_bytecode *bytecode = NULL;
 
        assert(rule);
 
@@ -462,7 +462,7 @@ static const char *lttng_event_rule_tracepoint_get_internal_filter(
        return tracepoint->internal_filter.filter;
 }
 
-static const struct lttng_filter_bytecode *
+static const struct lttng_bytecode *
 lttng_event_rule_tracepoint_get_internal_filter_bytecode(
                const struct lttng_event_rule *rule)
 {
index de4ee1cb0add4efa908cbc57fcd46d86f8b02cde..67f99c482ec681c4e95d39625e5ca582df41391f 100644 (file)
@@ -155,7 +155,7 @@ static const char *lttng_event_rule_uprobe_get_filter(
        return NULL;
 }
 
-static const struct lttng_filter_bytecode *
+static const struct lttng_bytecode *
 lttng_event_rule_uprobe_get_filter_bytecode(const struct lttng_event_rule *rule)
 {
        /* Unsupported. */
index fc16f1d526abaef92f0bb97d3eb4ed19f7e69b2b..5d333375dd2e8c3f3e9ec4091916e74d3878ca7e 100644 (file)
@@ -16,7 +16,7 @@ struct bytecode_symbol_iterator {
 
 LTTNG_HIDDEN
 struct bytecode_symbol_iterator *bytecode_symbol_iterator_create(
-               struct lttng_filter_bytecode *bytecode)
+               struct lttng_bytecode *bytecode)
 {
        struct bytecode_symbol_iterator *it = NULL;
 
index 2cbdd14a96764f2ed64f7824ca316f82d6418e02..a03b1d9feb02fc38f8665d5cf91f0bd72f8164c0 100644 (file)
@@ -18,7 +18,7 @@ struct bytecode_symbol_iterator;
  */
 LTTNG_HIDDEN
 struct bytecode_symbol_iterator *bytecode_symbol_iterator_create(
-               struct lttng_filter_bytecode *bytecode);
+               struct lttng_bytecode *bytecode);
 
 /*
  * Advance iterator of one element.
index a82e4f6bfd2cb77f21efdc13e045972029e3f157..93f9b9b25fd746673cc4689ff7ac7f5033779122 100644 (file)
@@ -158,8 +158,8 @@ struct filter_parser_ctx {
        struct filter_ast *ast;
        struct cds_list_head allocated_strings;
        struct ir_op *ir_root;
-       struct lttng_filter_bytecode_alloc *bytecode;
-       struct lttng_filter_bytecode_alloc *bytecode_reloc;
+       struct lttng_bytecode_alloc *bytecode;
+       struct lttng_bytecode_alloc *bytecode_reloc;
 };
 
 struct filter_parser_ctx *filter_parser_ctx_alloc(FILE *input);
index a5e7a5afe735588096aba6faaa679bd3ab362db6..51ebad130c3a30a9db044f4d3171d9a805728848 100644 (file)
@@ -31,7 +31,7 @@ int recursive_visit_gen_bytecode(struct filter_parser_ctx *ctx,
                struct ir_op *node);
 
 static
-int bytecode_patch(struct lttng_filter_bytecode_alloc **fb,
+int bytecode_patch(struct lttng_bytecode_alloc **fb,
                const void *data,
                uint16_t offset,
                uint32_t len)
@@ -55,7 +55,7 @@ int visit_node_root(struct filter_parser_ctx *ctx, struct ir_op *node)
                return ret;
 
        /* Generate end of bytecode instruction */
-       insn.op = FILTER_OP_RETURN;
+       insn.op = BYTECODE_OP_RETURN;
        return bytecode_push(&ctx->bytecode, &insn, 1, sizeof(insn));
 }
 
@@ -87,7 +87,7 @@ int append_str(char **s, const char *append)
  */
 static
 int load_expression_legacy_match(const struct ir_load_expression *exp,
-               enum filter_op *op_type,
+               enum bytecode_op *op_type,
                char **symbol)
 {
        const struct ir_load_expression_op *op;
@@ -96,21 +96,21 @@ int load_expression_legacy_match(const struct ir_load_expression *exp,
        op = exp->child;
        switch (op->type) {
        case IR_LOAD_EXPRESSION_GET_CONTEXT_ROOT:
-               *op_type = FILTER_OP_GET_CONTEXT_REF;
+               *op_type = BYTECODE_OP_GET_CONTEXT_REF;
                if (append_str(symbol, "$ctx.")) {
                        return -ENOMEM;
                }
                need_dot = false;
                break;
        case IR_LOAD_EXPRESSION_GET_APP_CONTEXT_ROOT:
-               *op_type = FILTER_OP_GET_CONTEXT_REF;
+               *op_type = BYTECODE_OP_GET_CONTEXT_REF;
                if (append_str(symbol, "$app.")) {
                        return -ENOMEM;
                }
                need_dot = false;
                break;
        case IR_LOAD_EXPRESSION_GET_PAYLOAD_ROOT:
-               *op_type = FILTER_OP_LOAD_FIELD_REF;
+               *op_type = BYTECODE_OP_LOAD_FIELD_REF;
                need_dot = false;
                break;
 
@@ -162,7 +162,7 @@ int visit_node_load_expression_legacy(struct filter_parser_ctx *ctx,
        struct field_ref ref_offset;
        uint32_t reloc_offset_u32;
        uint16_t reloc_offset;
-       enum filter_op op_type;
+       enum bytecode_op op_type;
        char *symbol = NULL;
        int ret;
 
@@ -247,7 +247,7 @@ int visit_node_load_expression(struct filter_parser_ctx *ctx,
                        insn = calloc(insn_len, 1);
                        if (!insn)
                                return -ENOMEM;
-                       insn->op = FILTER_OP_GET_CONTEXT_ROOT;
+                       insn->op = BYTECODE_OP_GET_CONTEXT_ROOT;
                        ret = bytecode_push(&ctx->bytecode, insn, 1, insn_len);
                        free(insn);
                        if (ret) {
@@ -264,7 +264,7 @@ int visit_node_load_expression(struct filter_parser_ctx *ctx,
                        insn = calloc(insn_len, 1);
                        if (!insn)
                                return -ENOMEM;
-                       insn->op = FILTER_OP_GET_APP_CONTEXT_ROOT;
+                       insn->op = BYTECODE_OP_GET_APP_CONTEXT_ROOT;
                        ret = bytecode_push(&ctx->bytecode, insn, 1, insn_len);
                        free(insn);
                        if (ret) {
@@ -281,7 +281,7 @@ int visit_node_load_expression(struct filter_parser_ctx *ctx,
                        insn = calloc(insn_len, 1);
                        if (!insn)
                                return -ENOMEM;
-                       insn->op = FILTER_OP_GET_PAYLOAD_ROOT;
+                       insn->op = BYTECODE_OP_GET_PAYLOAD_ROOT;
                        ret = bytecode_push(&ctx->bytecode, insn, 1, insn_len);
                        free(insn);
                        if (ret) {
@@ -303,7 +303,7 @@ int visit_node_load_expression(struct filter_parser_ctx *ctx,
                        insn = calloc(insn_len, 1);
                        if (!insn)
                                return -ENOMEM;
-                       insn->op = FILTER_OP_GET_SYMBOL;
+                       insn->op = BYTECODE_OP_GET_SYMBOL;
                        bytecode_reloc_offset_u32 =
                                        bytecode_get_len(&ctx->bytecode_reloc->b)
                                        + sizeof(reloc_offset);
@@ -350,7 +350,7 @@ int visit_node_load_expression(struct filter_parser_ctx *ctx,
                        insn = calloc(insn_len, 1);
                        if (!insn)
                                return -ENOMEM;
-                       insn->op = FILTER_OP_GET_INDEX_U64;
+                       insn->op = BYTECODE_OP_GET_INDEX_U64;
                        index.index = op->u.index;
                        memcpy(insn->data, &index, sizeof(index));
                        ret = bytecode_push(&ctx->bytecode, insn, 1, insn_len);
@@ -369,7 +369,7 @@ int visit_node_load_expression(struct filter_parser_ctx *ctx,
                        insn = calloc(insn_len, 1);
                        if (!insn)
                                return -ENOMEM;
-                       insn->op = FILTER_OP_LOAD_FIELD;
+                       insn->op = BYTECODE_OP_LOAD_FIELD;
                        ret = bytecode_push(&ctx->bytecode, insn, 1, insn_len);
                        free(insn);
                        if (ret) {
@@ -412,7 +412,7 @@ int visit_node_load(struct filter_parser_ctx *ctx, struct ir_op *node)
                         * that the appropriate matching function can be
                         * called. Also, see comment below.
                         */
-                       insn->op = FILTER_OP_LOAD_STAR_GLOB_STRING;
+                       insn->op = BYTECODE_OP_LOAD_STAR_GLOB_STRING;
                        break;
                default:
                        /*
@@ -425,7 +425,7 @@ int visit_node_load(struct filter_parser_ctx *ctx, struct ir_op *node)
                         * can be anywhere in the string) is a special
                         * case.
                         */
-                       insn->op = FILTER_OP_LOAD_STRING;
+                       insn->op = BYTECODE_OP_LOAD_STRING;
                        break;
                }
 
@@ -443,7 +443,7 @@ int visit_node_load(struct filter_parser_ctx *ctx, struct ir_op *node)
                insn = calloc(insn_len, 1);
                if (!insn)
                        return -ENOMEM;
-               insn->op = FILTER_OP_LOAD_S64;
+               insn->op = BYTECODE_OP_LOAD_S64;
                memcpy(insn->data, &node->u.load.u.num, sizeof(int64_t));
                ret = bytecode_push(&ctx->bytecode, insn, 1, insn_len);
                free(insn);
@@ -458,7 +458,7 @@ int visit_node_load(struct filter_parser_ctx *ctx, struct ir_op *node)
                insn = calloc(insn_len, 1);
                if (!insn)
                        return -ENOMEM;
-               insn->op = FILTER_OP_LOAD_DOUBLE;
+               insn->op = BYTECODE_OP_LOAD_DOUBLE;
                memcpy(insn->data, &node->u.load.u.flt, sizeof(double));
                ret = bytecode_push(&ctx->bytecode, insn, 1, insn_len);
                free(insn);
@@ -491,13 +491,13 @@ int visit_node_unary(struct filter_parser_ctx *ctx, struct ir_op *node)
                /* Nothing to do. */
                return 0;
        case AST_UNARY_MINUS:
-               insn.op = FILTER_OP_UNARY_MINUS;
+               insn.op = BYTECODE_OP_UNARY_MINUS;
                return bytecode_push(&ctx->bytecode, &insn, 1, sizeof(insn));
        case AST_UNARY_NOT:
-               insn.op = FILTER_OP_UNARY_NOT;
+               insn.op = BYTECODE_OP_UNARY_NOT;
                return bytecode_push(&ctx->bytecode, &insn, 1, sizeof(insn));
        case AST_UNARY_BIT_NOT:
-               insn.op = FILTER_OP_UNARY_BIT_NOT;
+               insn.op = BYTECODE_OP_UNARY_BIT_NOT;
                return bytecode_push(&ctx->bytecode, &insn, 1, sizeof(insn));
        }
 }
@@ -534,53 +534,53 @@ int visit_node_binary(struct filter_parser_ctx *ctx, struct ir_op *node)
                return -EINVAL;
 
        case AST_OP_MUL:
-               insn.op = FILTER_OP_MUL;
+               insn.op = BYTECODE_OP_MUL;
                break;
        case AST_OP_DIV:
-               insn.op = FILTER_OP_DIV;
+               insn.op = BYTECODE_OP_DIV;
                break;
        case AST_OP_MOD:
-               insn.op = FILTER_OP_MOD;
+               insn.op = BYTECODE_OP_MOD;
                break;
        case AST_OP_PLUS:
-               insn.op = FILTER_OP_PLUS;
+               insn.op = BYTECODE_OP_PLUS;
                break;
        case AST_OP_MINUS:
-               insn.op = FILTER_OP_MINUS;
+               insn.op = BYTECODE_OP_MINUS;
                break;
        case AST_OP_BIT_RSHIFT:
-               insn.op = FILTER_OP_BIT_RSHIFT;
+               insn.op = BYTECODE_OP_BIT_RSHIFT;
                break;
        case AST_OP_BIT_LSHIFT:
-               insn.op = FILTER_OP_BIT_LSHIFT;
+               insn.op = BYTECODE_OP_BIT_LSHIFT;
                break;
        case AST_OP_BIT_AND:
-               insn.op = FILTER_OP_BIT_AND;
+               insn.op = BYTECODE_OP_BIT_AND;
                break;
        case AST_OP_BIT_OR:
-               insn.op = FILTER_OP_BIT_OR;
+               insn.op = BYTECODE_OP_BIT_OR;
                break;
        case AST_OP_BIT_XOR:
-               insn.op = FILTER_OP_BIT_XOR;
+               insn.op = BYTECODE_OP_BIT_XOR;
                break;
 
        case AST_OP_EQ:
-               insn.op = FILTER_OP_EQ;
+               insn.op = BYTECODE_OP_EQ;
                break;
        case AST_OP_NE:
-               insn.op = FILTER_OP_NE;
+               insn.op = BYTECODE_OP_NE;
                break;
        case AST_OP_GT:
-               insn.op = FILTER_OP_GT;
+               insn.op = BYTECODE_OP_GT;
                break;
        case AST_OP_LT:
-               insn.op = FILTER_OP_LT;
+               insn.op = BYTECODE_OP_LT;
                break;
        case AST_OP_GE:
-               insn.op = FILTER_OP_GE;
+               insn.op = BYTECODE_OP_GE;
                break;
        case AST_OP_LE:
-               insn.op = FILTER_OP_LE;
+               insn.op = BYTECODE_OP_LE;
                break;
        }
        return bytecode_push(&ctx->bytecode, &insn, 1, sizeof(insn));
@@ -611,9 +611,9 @@ int visit_node_logical(struct filter_parser_ctx *ctx, struct ir_op *node)
                if (node->u.binary.left->data_type == IR_DATA_FIELD_REF
                                || node->u.binary.left->data_type == IR_DATA_GET_CONTEXT_REF
                                || node->u.binary.left->data_type == IR_DATA_EXPRESSION) {
-                       cast_insn.op = FILTER_OP_CAST_TO_S64;
+                       cast_insn.op = BYTECODE_OP_CAST_TO_S64;
                } else {
-                       cast_insn.op = FILTER_OP_CAST_DOUBLE_TO_S64;
+                       cast_insn.op = BYTECODE_OP_CAST_DOUBLE_TO_S64;
                }
                ret = bytecode_push(&ctx->bytecode, &cast_insn,
                                        1, sizeof(cast_insn));
@@ -627,10 +627,10 @@ int visit_node_logical(struct filter_parser_ctx *ctx, struct ir_op *node)
                return -EINVAL;
 
        case AST_OP_AND:
-               insn.op = FILTER_OP_AND;
+               insn.op = BYTECODE_OP_AND;
                break;
        case AST_OP_OR:
-               insn.op = FILTER_OP_OR;
+               insn.op = BYTECODE_OP_OR;
                break;
        }
        insn.skip_offset = (uint16_t) -1UL;     /* Temporary */
@@ -652,9 +652,9 @@ int visit_node_logical(struct filter_parser_ctx *ctx, struct ir_op *node)
                if (node->u.binary.right->data_type == IR_DATA_FIELD_REF
                                || node->u.binary.right->data_type == IR_DATA_GET_CONTEXT_REF
                                || node->u.binary.right->data_type == IR_DATA_EXPRESSION) {
-                       cast_insn.op = FILTER_OP_CAST_TO_S64;
+                       cast_insn.op = BYTECODE_OP_CAST_TO_S64;
                } else {
-                       cast_insn.op = FILTER_OP_CAST_DOUBLE_TO_S64;
+                       cast_insn.op = BYTECODE_OP_CAST_DOUBLE_TO_S64;
                }
                ret = bytecode_push(&ctx->bytecode, &cast_insn,
                                        1, sizeof(cast_insn));
index f5efaf328f08858c2eea3e135421218fac1bfc45..bb6602e2bffb57f676514313b462b5e8b62645e6 100644 (file)
@@ -437,7 +437,7 @@ int kernctl_create_event_notifier(int group_fd,
                        LTTNG_KERNEL_EVENT_NOTIFIER_CREATE, event_notifier);
 }
 
-int kernctl_filter(int fd, const struct lttng_filter_bytecode *filter)
+int kernctl_filter(int fd, const struct lttng_bytecode *filter)
 {
        struct lttng_kernel_filter_bytecode *kb;
        uint32_t len;
index 5668468e68cdc4e9318ce73facc215c7477a5748..3bbe69f48ce41c9d8b163dc3d8032fed27133406 100644 (file)
@@ -36,7 +36,7 @@ int kernctl_create_event_notifier(int fd,
                const struct lttng_kernel_event_notifier *event_notifier);
 
 /* Apply on event file descriptor. */
-int kernctl_filter(int fd, const struct lttng_filter_bytecode *filter);
+int kernctl_filter(int fd, const struct lttng_bytecode *filter);
 int kernctl_add_callsite(int fd, struct lttng_kernel_event_callsite *callsite);
 
 int kernctl_tracepoint_list(int fd);
index 21c1a91adde55648238359d736c8e7e820009de6..09fdaf40aaa172356dc7957c5ea072e99a7d0e04 100644 (file)
@@ -1800,13 +1800,13 @@ error:
 LTTNG_HIDDEN
 int run_as_generate_filter_bytecode(const char *filter_expression,
                const struct lttng_credentials *creds,
-               struct lttng_filter_bytecode **bytecode)
+               struct lttng_bytecode **bytecode)
 {
        int ret;
        struct run_as_data data = {};
        struct run_as_ret run_as_ret = {};
-       const struct lttng_filter_bytecode *view_bytecode = NULL;
-       struct lttng_filter_bytecode *local_bytecode = NULL;
+       const struct lttng_bytecode *view_bytecode = NULL;
+       struct lttng_bytecode *local_bytecode = NULL;
        const uid_t uid = lttng_credentials_get_uid(creds);
        const gid_t gid = lttng_credentials_get_gid(creds);
 
@@ -1826,7 +1826,7 @@ int run_as_generate_filter_bytecode(const char *filter_expression,
                goto error;
        }
 
-       view_bytecode = (const struct lttng_filter_bytecode *) run_as_ret.u.generate_filter_bytecode.bytecode;
+       view_bytecode = (const struct lttng_bytecode *) run_as_ret.u.generate_filter_bytecode.bytecode;
 
        local_bytecode = zmalloc(sizeof(*local_bytecode) + view_bytecode->len);
        if (!local_bytecode) {
index 40b4f91b07792864c00cc463bc1ea87f39423c52..18a053a05cbd89d174d987446117ec345198b81d 100644 (file)
@@ -73,7 +73,7 @@ int run_as_extract_sdt_probe_offsets(int fd, const char *provider_name,
 LTTNG_HIDDEN
 int run_as_generate_filter_bytecode(const char *filter_expression,
                const struct lttng_credentials *creds,
-               struct lttng_filter_bytecode **bytecode);
+               struct lttng_bytecode **bytecode);
 LTTNG_HIDDEN
 int run_as_create_worker(const char *procname,
                post_fork_cleanup_cb clean_up_func, void *clean_up_user_data);
index d946aa3a3074b8979bdc36478d3a8fe633d713db..4c1ba5ccef58fc3ba19f3e5a480da41b27baecf6 100644 (file)
@@ -522,7 +522,7 @@ struct lttcomm_session_msg {
  * starts at reloc_table_offset.
  */
 #define LTTNG_FILTER_PADDING   32
-struct lttng_filter_bytecode {
+struct lttng_bytecode {
        uint32_t len;   /* len of data */
        uint32_t reloc_table_offset;
        uint64_t seqnum;
This page took 0.102002 seconds and 4 git commands to generate.