From 2dbbd473d65bb323bb8803e1d2d30f873d5b50b5 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 16 May 2013 13:38:00 -0700 Subject: [PATCH] Set the right probe_type for inode uretprobes --- tapsets.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tapsets.cxx b/tapsets.cxx index 105116f8b..ca78c8d27 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -7700,8 +7700,12 @@ uprobe_derived_probe_group::emit_module_inode_decls (systemtap_session& s) s.op->newline() << "static int stapiu_probe_handler " << "(struct stapiu_consumer *sup, struct pt_regs *regs) {"; s.op->newline(1); + + // Since we're sharing the entry function, we have to dynamically choose the probe_type + string probe_type = "(sup->return_p ? stp_probe_type_uretprobe : stp_probe_type_uprobe)"; common_probe_entryfn_prologue (s, "STAP_SESSION_RUNNING", "sup->probe", - "stp_probe_type_uprobe"); + probe_type); + s.op->newline() << "c->uregs = regs;"; s.op->newline() << "c->user_mode_p = 1;"; // NB: IP is already set by stapiu_probe_prehandler in uprobes-inode.c -- 2.43.5