projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename `enum lttng_enabler_type` to `_format_type`
[lttng-ust.git]
/
liblttng-ust
/
lttng-filter-interpreter.c
diff --git
a/liblttng-ust/lttng-filter-interpreter.c
b/liblttng-ust/lttng-filter-interpreter.c
index 6f13aa04e47f9d43973df802f2262687b2257b10..49daa211e1a59b3e24d59bfa00faceda9de2115b 100644
(file)
--- a/
liblttng-ust/lttng-filter-interpreter.c
+++ b/
liblttng-ust/lttng-filter-interpreter.c
@@
-28,7
+28,7
@@
#include <stddef.h>
#include <stdint.h>
#include <urcu-pointer.h>
#include <stddef.h>
#include <stdint.h>
#include <urcu-pointer.h>
-#include <
byteswap
.h>
+#include <
lttng/ust-endian
.h>
#include "lttng-filter.h"
#include "string-utils.h"
#include "lttng-filter.h"
#include "string-utils.h"
@@
-164,7
+164,7
@@
int stack_strcmp(struct estack *stack, int top, const char *cmp_type)
uint64_t lttng_filter_false(void *filter_data,
const char *filter_stack_data)
{
uint64_t lttng_filter_false(void *filter_data,
const char *filter_stack_data)
{
- return
0
;
+ return
LTTNG_FILTER_DISCARD
;
}
#ifdef INTERPRETER_USE_SWITCH
}
#ifdef INTERPRETER_USE_SWITCH
@@
-370,7
+370,7
@@
static int context_get_index(struct lttng_ctx *ctx,
return 0;
}
return 0;
}
-static int dynamic_get_index(struct lttng_
session *session
,
+static int dynamic_get_index(struct lttng_
ctx *ctx
,
struct bytecode_runtime *runtime,
uint64_t index, struct estack_entry *stack_top)
{
struct bytecode_runtime *runtime,
uint64_t index, struct estack_entry *stack_top)
{
@@
-437,9
+437,6
@@
static int dynamic_get_index(struct lttng_session *session,
case LOAD_ROOT_CONTEXT:
case LOAD_ROOT_APP_CONTEXT: /* Fall-through */
{
case LOAD_ROOT_CONTEXT:
case LOAD_ROOT_APP_CONTEXT: /* Fall-through */
{
- struct lttng_ctx *ctx;
-
- ctx = rcu_dereference(session->ctx);
ret = context_get_index(ctx,
&stack_top->u.ptr,
gid->ctx_index);
ret = context_get_index(ctx,
&stack_top->u.ptr,
gid->ctx_index);
@@
-634,7
+631,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
const char *filter_stack_data)
{
struct bytecode_runtime *bytecode = filter_data;
const char *filter_stack_data)
{
struct bytecode_runtime *bytecode = filter_data;
- struct lttng_
session *session = bytecode->p.session
;
+ struct lttng_
ctx *ctx = rcu_dereference(*bytecode->p.pctx)
;
void *pc, *next_pc, *start_pc;
int ret = -EINVAL;
uint64_t retval = 0;
void *pc, *next_pc, *start_pc;
int ret = -EINVAL;
uint64_t retval = 0;
@@
-793,7
+790,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
goto end;
OP(FILTER_OP_RETURN):
goto end;
OP(FILTER_OP_RETURN):
- /* LTTNG_FILTER_DISCARD
or LTTNG_FILTER_RECORD_FLAG */
+ /* LTTNG_FILTER_DISCARD or LTTNG_FILTER_RECORD_FLAG */
/* Handle dynamic typing. */
switch (estack_ax_t) {
case REG_S64:
/* Handle dynamic typing. */
switch (estack_ax_t) {
case REG_S64:
@@
-810,7
+807,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
goto end;
OP(FILTER_OP_RETURN_S64):
goto end;
OP(FILTER_OP_RETURN_S64):
- /* LTTNG_FILTER_DISCARD
or LTTNG_FILTER_RECORD_FLAG */
+ /* LTTNG_FILTER_DISCARD or LTTNG_FILTER_RECORD_FLAG */
retval = !!estack_ax_v;
ret = 0;
goto end;
retval = !!estack_ax_v;
ret = 0;
goto end;
@@
-2013,13
+2010,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
- struct lttng_ctx *ctx;
struct lttng_ctx_field *ctx_field;
struct lttng_ctx_value v;
dbg_printf("get context ref offset %u type dynamic\n",
ref->offset);
struct lttng_ctx_field *ctx_field;
struct lttng_ctx_value v;
dbg_printf("get context ref offset %u type dynamic\n",
ref->offset);
- ctx = rcu_dereference(session->ctx);
ctx_field = &ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
ctx_field = &ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
@@
-2063,13
+2058,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
- struct lttng_ctx *ctx;
struct lttng_ctx_field *ctx_field;
struct lttng_ctx_value v;
dbg_printf("get context ref offset %u type string\n",
ref->offset);
struct lttng_ctx_field *ctx_field;
struct lttng_ctx_value v;
dbg_printf("get context ref offset %u type string\n",
ref->offset);
- ctx = rcu_dereference(session->ctx);
ctx_field = &ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
ctx_field = &ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
@@
-2092,13
+2085,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
- struct lttng_ctx *ctx;
struct lttng_ctx_field *ctx_field;
struct lttng_ctx_value v;
dbg_printf("get context ref offset %u type s64\n",
ref->offset);
struct lttng_ctx_field *ctx_field;
struct lttng_ctx_value v;
dbg_printf("get context ref offset %u type s64\n",
ref->offset);
- ctx = rcu_dereference(session->ctx);
ctx_field = &ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
ctx_field = &ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
@@
-2113,13
+2104,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
- struct lttng_ctx *ctx;
struct lttng_ctx_field *ctx_field;
struct lttng_ctx_value v;
dbg_printf("get context ref offset %u type double\n",
ref->offset);
struct lttng_ctx_field *ctx_field;
struct lttng_ctx_value v;
dbg_printf("get context ref offset %u type double\n",
ref->offset);
- ctx = rcu_dereference(session->ctx);
ctx_field = &ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
ctx_field = &ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
@@
-2205,7
+2194,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
struct get_index_u16 *index = (struct get_index_u16 *) insn->data;
dbg_printf("op get index u16\n");
struct get_index_u16 *index = (struct get_index_u16 *) insn->data;
dbg_printf("op get index u16\n");
- ret = dynamic_get_index(
session
, bytecode, index->index, estack_ax(stack, top));
+ ret = dynamic_get_index(
ctx
, bytecode, index->index, estack_ax(stack, top));
if (ret)
goto end;
estack_ax_v = estack_ax(stack, top)->u.v;
if (ret)
goto end;
estack_ax_v = estack_ax(stack, top)->u.v;
@@
-2220,7
+2209,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
struct get_index_u64 *index = (struct get_index_u64 *) insn->data;
dbg_printf("op get index u64\n");
struct get_index_u64 *index = (struct get_index_u64 *) insn->data;
dbg_printf("op get index u64\n");
- ret = dynamic_get_index(
session
, bytecode, index->index, estack_ax(stack, top));
+ ret = dynamic_get_index(
ctx
, bytecode, index->index, estack_ax(stack, top));
if (ret)
goto end;
estack_ax_v = estack_ax(stack, top)->u.v;
if (ret)
goto end;
estack_ax_v = estack_ax(stack, top)->u.v;
@@
-2367,9
+2356,9
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
END_OP
end:
END_OP
end:
- /*
return 0 (discard) on error
*/
+ /*
Return _DISCARD on error.
*/
if (ret)
if (ret)
- return
0
;
+ return
LTTNG_FILTER_DISCARD
;
return retval;
}
return retval;
}
This page took
0.034737 seconds
and
4
git commands to generate.