Skip to content

Instantly share code, notes, and snippets.

@agentzh
Last active June 7, 2020 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agentzh/048567e84017955fd5b4fee7eb56a59a to your computer and use it in GitHub Desktop.
Save agentzh/048567e84017955fd5b4fee7eb56a59a to your computer and use it in GitHub Desktop.
diff --git a/runtime/linux/task_finder2.c b/runtime/linux/task_finder2.c
index 2a9a50a76..bcae0b81b 100644
--- a/runtime/linux/task_finder2.c
+++ b/runtime/linux/task_finder2.c
@@ -1381,10 +1381,6 @@ __stp_utrace_task_finder_target_quiesce(u32 action,
}
}
else {
- /* Call the callbacks. Assume that if the thread is a
- * thread group leader, it is a process. */
- __stp_call_callbacks(tgt, tsk, 1, (tsk->pid == tsk->tgid));
-
/* If this is just a thread other than the thread
group leader, don't bother inform map callback
clients about its memory map, since they will
@@ -1392,6 +1388,10 @@ __stp_utrace_task_finder_target_quiesce(u32 action,
if (tgt->mmap_events == 1 && tsk->tgid == tsk->pid) {
__stp_call_mmap_callbacks_for_task(tgt, tsk);
}
+
+ /* Call the callbacks. Assume that if the thread is a
+ * thread group leader, it is a process. */
+ __stp_call_callbacks(tgt, tsk, 1, (tsk->pid == tsk->tgid));
}
__stp_tf_handler_end();
diff --git a/tapset-utrace.cxx b/tapset-utrace.cxx
index bc7cbf6ef..b88e225bf 100644
--- a/tapset-utrace.cxx
+++ b/tapset-utrace.cxx
@@ -871,6 +871,8 @@ utrace_derived_probe_group::emit_module_linux_decls (systemtap_session& s)
"stp_probe_type_utrace");
// call probe function
+ s.op->newline() << "c->uregs = _stp_current_pt_regs();";
+ s.op->newline() << "c->user_mode_p = 1;";
s.op->newline() << "dbug_task(2, \"calling UDPF probe function\");";
s.op->newline() << "(*p->probe->ph) (c);";
common_probe_entryfn_epilogue (s, true, otf_safe_context(s));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment