projects
/
deliverable
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Decouple `struct lttng_session` from filter code
[deliverable/lttng-ust.git]
/
liblttng-ust
/
lttng-filter-specialize.c
diff --git
a/liblttng-ust/lttng-filter-specialize.c
b/liblttng-ust/lttng-filter-specialize.c
index ba46a103a253ae5b045660c1780a053e61eb344e..0a19896b43038fa11dc4120e1f469998bc40b3a0 100644
(file)
--- a/
liblttng-ust/lttng-filter-specialize.c
+++ b/
liblttng-ust/lttng-filter-specialize.c
@@
-507,7
+507,7
@@
static int specialize_load_object(const struct lttng_event_field *field,
return 0;
}
return 0;
}
-static int specialize_context_lookup(struct lttng_
session *session
,
+static int specialize_context_lookup(struct lttng_
ctx *ctx
,
struct bytecode_runtime *runtime,
struct load_op *insn,
struct vstack_load *load)
struct bytecode_runtime *runtime,
struct load_op *insn,
struct vstack_load *load)
@@
-518,11
+518,11
@@
static int specialize_context_lookup(struct lttng_session *session,
struct filter_get_index_data gid;
ssize_t data_offset;
struct filter_get_index_data gid;
ssize_t data_offset;
- idx = specialize_context_lookup_name(
session->
ctx, runtime, insn);
+ idx = specialize_context_lookup_name(ctx, runtime, insn);
if (idx < 0) {
return -ENOENT;
}
if (idx < 0) {
return -ENOENT;
}
- ctx_field = &
session->
ctx->fields[idx];
+ ctx_field = &ctx->fields[idx];
field = &ctx_field->event_field;
ret = specialize_load_object(field, load, true);
if (ret)
field = &ctx_field->event_field;
ret = specialize_load_object(field, load, true);
if (ret)
@@
-541,7
+541,7
@@
static int specialize_context_lookup(struct lttng_session *session,
return 0;
}
return 0;
}
-static int specialize_app_context_lookup(struct lttng_
session *session
,
+static int specialize_app_context_lookup(struct lttng_
ctx **pctx
,
struct bytecode_runtime *runtime,
struct load_op *insn,
struct vstack_load *load)
struct bytecode_runtime *runtime,
struct load_op *insn,
struct vstack_load *load)
@@
-564,19
+564,18
@@
static int specialize_app_context_lookup(struct lttng_session *session,
}
strcpy(name, "$app.");
strcat(name, orig_name);
}
strcpy(name, "$app.");
strcat(name, orig_name);
- idx = lttng_get_context_index(
session->
ctx, name);
+ idx = lttng_get_context_index(
*p
ctx, name);
if (idx < 0) {
assert(lttng_context_is_app(name));
ret = lttng_ust_add_app_context_to_ctx_rcu(name,
if (idx < 0) {
assert(lttng_context_is_app(name));
ret = lttng_ust_add_app_context_to_ctx_rcu(name,
-
&session->
ctx);
+
p
ctx);
if (ret)
return ret;
if (ret)
return ret;
- idx = lttng_get_context_index(session->ctx,
- name);
+ idx = lttng_get_context_index(*pctx, name);
if (idx < 0)
return -ENOENT;
}
if (idx < 0)
return -ENOENT;
}
- ctx_field = &
session->ctx
->fields[idx];
+ ctx_field = &
(*pctx)
->fields[idx];
field = &ctx_field->event_field;
ret = specialize_load_object(field, load, true);
if (ret)
field = &ctx_field->event_field;
ret = specialize_load_object(field, load, true);
if (ret)
@@
-685,7
+684,7
@@
int lttng_filter_specialize_bytecode(struct lttng_event *event,
int ret = -EINVAL;
struct vstack _stack;
struct vstack *stack = &_stack;
int ret = -EINVAL;
struct vstack _stack;
struct vstack *stack = &_stack;
- struct lttng_
session *session = bytecode->p.session
;
+ struct lttng_
ctx **pctx = bytecode->p.pctx
;
vstack_init(stack);
vstack_init(stack);
@@
-1412,7
+1411,7
@@
int lttng_filter_specialize_bytecode(struct lttng_event *event,
goto end;
case LOAD_ROOT_CONTEXT:
/* Lookup context field. */
goto end;
case LOAD_ROOT_CONTEXT:
/* Lookup context field. */
- ret = specialize_context_lookup(
session
,
+ ret = specialize_context_lookup(
*pctx
,
bytecode, insn,
&vstack_ax(stack)->load);
if (ret)
bytecode, insn,
&vstack_ax(stack)->load);
if (ret)
@@
-1420,7
+1419,7
@@
int lttng_filter_specialize_bytecode(struct lttng_event *event,
break;
case LOAD_ROOT_APP_CONTEXT:
/* Lookup app context field. */
break;
case LOAD_ROOT_APP_CONTEXT:
/* Lookup app context field. */
- ret = specialize_app_context_lookup(
session
,
+ ret = specialize_app_context_lookup(
pctx
,
bytecode, insn,
&vstack_ax(stack)->load);
if (ret)
bytecode, insn,
&vstack_ax(stack)->load);
if (ret)
This page took
0.043649 seconds
and
5
git commands to generate.