#include <lttng/condition/event-rule.h>
#include <lttng/event-rule/event-rule.h>
#include <lttng/event-rule/event-rule-internal.h>
+#include <common/bytecode/bytecode.h>
#include <common/error.h>
#include <common/sessiond-comm/sessiond-comm.h>
#include <common/filter.h>
#include <urcu/compiler.h>
#include <signal.h>
+#include <common/bytecode/bytecode.h>
#include <common/compat/errno.h>
#include <common/common.h>
#include <common/hashtable/utils.h>
output->dst.session_root_path :
output->dst.net.base_dir;
}
-
-/*
- * Allocate a filter and copy the given original filter.
- *
- * Return allocated filter or NULL on error.
- */
-struct lttng_filter_bytecode *lttng_filter_bytecode_copy(
- const struct lttng_filter_bytecode *orig_f)
-{
- struct lttng_filter_bytecode *filter = NULL;
-
- /* Copy filter bytecode */
- filter = zmalloc(sizeof(*filter) + orig_f->len);
- if (!filter) {
- PERROR("zmalloc alloc filter bytecode");
- goto error;
- }
-
- memcpy(filter, orig_f, sizeof(*filter) + orig_f->len);
-
-error:
- return filter;
-}
int b_loglevel_type, int b_loglevel_value, int loglevel_all_type);
const char *session_get_base_path(const struct ltt_session *session);
const char *consumer_output_get_base_path(const struct consumer_output *output);
-struct lttng_filter_bytecode *lttng_filter_bytecode_copy(
- const struct lttng_filter_bytecode *orig_f);
#endif /* _LTT_UTILS_H */
- (void *) &(*fb)->b.data[0];
return 0;
}
+
+/*
+ * Allocate an lttng_bytecode object and copy the given original bytecode.
+ *
+ * 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_filter_bytecode *bytecode = NULL;
+
+ bytecode = zmalloc(sizeof(*bytecode) + orig_f->len);
+ if (!bytecode) {
+ goto error;
+ }
+
+ memcpy(bytecode, orig_f, sizeof(*bytecode) + orig_f->len);
+
+error:
+ return bytecode;
+}
LTTNG_HIDDEN int bytecode_push_logical(struct lttng_filter_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);
static inline
unsigned int bytecode_get_len(struct lttng_filter_bytecode *bytecode)