Multiprocess programs on Linux

57 views
Skip to first unread message

Alex Alex

unread,
Feb 4, 2021, 9:44:58 AM2/4/21
to DynamoRIO Users
Is there a solution for process management on Linux: assign which process DynamoRIO will follow and which not? For example, we need to stop follow parent process and only follow child. Processes created by fork().

Derek Bruening

unread,
Feb 4, 2021, 12:49:27 PM2/4/21
to dynamor...@googlegroups.com
See https://dynamorio.org/dynamorio_docs/page_deploy.html#lin_deploy where whether to take over and which options to use are all configurable separately per application name via drconfig and configuration files.

On Thu, Feb 4, 2021 at 9:45 AM Alex Alex <dsfwe...@gmail.com> wrote:
Is there a solution for process management on Linux: assign which process DynamoRIO will follow and which not? For example, we need to stop follow parent process and only follow child. Processes created by fork().

--
You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynamorio-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dynamorio-users/e3316649-d33e-4f56-9ff4-aa401391ba84n%40googlegroups.com.

Raymond

unread,
Jan 16, 2022, 8:57:53 PM1/16/22
to DynamoRIO Users
Hello, I concerned the same requirement.
I try to run a large-scale MPI application which forks multiple same name processes, but I only want to trace one child process instance by DR since children have same behavior.
How to configure this scenario? By process id? But it's dynamic.

Derek Bruening

unread,
Jan 18, 2022, 1:39:35 PM1/18/22
to dynamor...@googlegroups.com
On Sun, Jan 16, 2022 at 8:57 PM Raymond <raymo...@gmail.com> wrote:
Hello, I concerned the same requirement.
I try to run a large-scale MPI application which forks multiple same name processes, but I only want to trace one child process instance by DR since children have same behavior.
How to configure this scenario? By process id? But it's dynamic.

If it's a fork without a subsequent exec there is no control point for DR's deployment interface.
You could have your client take some action in the fork child init event:
  • Simply don't instrument and let DR run by itself with no client overhead, if that base performance is acceptable.
  • Detach completely from that process: but to do that from client code requires implementing a new feature https://github.com/DynamoRIO/dynamorio/issues/2644
  • Detach completely from that process using app code via dr_app_stop_and_cleanup() but that requires modifying the app code.
  • Go native via DR_EMIT_GO_NATIVE on the first new block in the child -- but this will wait for that first new block which might not happen so maybe it first needs a flush. 

On Friday, February 5, 2021 at 1:49:27 AM UTC+8 Derek Bruening wrote:
See https://dynamorio.org/dynamorio_docs/page_deploy.html#lin_deploy where whether to take over and which options to use are all configurable separately per application name via drconfig and configuration files.

On Thu, Feb 4, 2021 at 9:45 AM Alex Alex <dsfwe...@gmail.com> wrote:
Is there a solution for process management on Linux: assign which process DynamoRIO will follow and which not? For example, we need to stop follow parent process and only follow child. Processes created by fork().

--
You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynamorio-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dynamorio-users/e3316649-d33e-4f56-9ff4-aa401391ba84n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynamorio-use...@googlegroups.com.

Raymond

unread,
Jan 19, 2022, 8:21:00 PM1/19/22
to DynamoRIO Users
Hi Derek,
The MPI application will do a exec after fork. How to control it? I only  need to instrument one or two instance(s).
B.R.

Derek Bruening

unread,
Jan 20, 2022, 12:39:00 PM1/20/22
to dynamor...@googlegroups.com
The existing ahead-of-time configuration is done by image name, so there is no direct support for this today.  You would have to figure out from the client init whether to instrument or not, maybe via a file lock or something to get just one instrumentor.

If you have a good idea for how to extend DR's process configuration to support this, please propose a feature and consider implementing in a pull request.

Reply all
Reply to author
Forward
0 new messages