// If this code snippet uses a precomputed pointer,
// pass that as the first argument.
- if (pointer && dw.sess.runtime_mode != systemtap_session::bpf_runtime)
+ if (pointer)
{
assert(ctx.pointer);
fdecl->formal_args.push_back(ctx.pointer);
location_context ctx(&e, e.operand);
ctx.userspace_p = userspace_p;
+ // ctx may require extra information for --runtime=bpf
+ symbol *s;
+ bpf_context_vardecl *v;
+ if ((s = dynamic_cast<symbol *>(e.operand))
+ && (v = dynamic_cast<bpf_context_vardecl *>(s->referent)))
+ ctx.adapt_pointer_to_bpf(v->size, v->offset, v->is_signed);
+
Dwarf_Die endtype;
bool ok = false;
sym->tok = e->tok;
sym->name = "__tracepoint_arg_" + arg->name;
sym->type_details = make_shared<exp_type_dwarf>(&dw, &arg->type_die, false, false);
+
+ if (sess.runtime_mode == systemtap_session::bpf_runtime)
+ {
+ bpf_context_vardecl *v = new bpf_context_vardecl;
+
+ v->size = arg->size;
+ v->offset = arg->offset;
+ v->is_signed = arg->is_signed;
+ sym->referent = v;
+ }
+
provide (sym);
}
else
--- /dev/null
+// Test nested @casts. If this script compiles and runs then the test passes.
+probe begin {
+ printf("BEGIN\n")
+}
+
+probe kernel.trace("timer_start") {
+ printf("%d\n", @cast(@cast($timer, "timer_list", "kernel<linux/timer.h>")->function, "u_int8_t", "kernel<linux/types.h>")[2])
+}
+
+probe timer.s(1) {
+ exit()
+}
+
+probe end {
+ printf("END PASS\n")
+}