Skip to content

Instantly share code, notes, and snippets.

@agentzh

agentzh/a.diff Secret

Last active June 8, 2020 20:46
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/1e5204dab98e6b4b3f7ade53109c5fff to your computer and use it in GitHub Desktop.
Save agentzh/1e5204dab98e6b4b3f7ade53109c5fff to your computer and use it in GitHub Desktop.
diff --git a/runtime/linux/task_finder2.c b/runtime/linux/task_finder2.c
index 57fad712d..34aa8cb0f 100644
--- a/runtime/linux/task_finder2.c
+++ b/runtime/linux/task_finder2.c
@@ -1294,10 +1294,10 @@ __stp_tf_quiesce_worker(struct task_work *work)
__stp_tf_handler_start();
- /* Call the callbacks. Assume that if the thread is a
- * thread group leader, it is a process. */
- __stp_call_callbacks(tgt, current, 1, (current->pid == current->tgid));
-
+ /* NB make sure we run mmap callbacks before other callbacks
+ * like 'probe process.begin' handlers so that the vma tracker
+ * is already initialized in the latter contexts */
+
/* 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 simply duplicate each other. */
@@ -1305,6 +1305,10 @@ __stp_tf_quiesce_worker(struct task_work *work)
__stp_call_mmap_callbacks_for_task(tgt, current);
}
+ /* Call the callbacks. Assume that if the thread is a
+ * thread group leader, it is a process. */
+ __stp_call_callbacks(tgt, current, 1, (current->pid == current->tgid));
+
__stp_tf_handler_end();
/* Remember that this task_work_func is finished. */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment